hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
63bcc1c617735d72ecc4cc47e1f8c19f53b64cf2 | 448 | py | Python | onadata/apps/logger/migrations/0010_attachment_file_size.py | childhelpline/myhelpline | d72120ee31b6713cbaec79f299f5ee8bcb7ea429 | [
"BSD-3-Clause"
] | 1 | 2018-07-15T13:13:43.000Z | 2018-07-15T13:13:43.000Z | onadata/apps/logger/migrations/0010_attachment_file_size.py | aondiaye/myhelpline | d72120ee31b6713cbaec79f299f5ee8bcb7ea429 | [
"BSD-3-Clause"
] | 14 | 2018-07-10T12:48:46.000Z | 2022-03-11T23:24:51.000Z | onadata/apps/logger/migrations/0010_attachment_file_size.py | aondiaye/myhelpline | d72120ee31b6713cbaec79f299f5ee8bcb7ea429 | [
"BSD-3-Clause"
] | 5 | 2018-07-04T07:59:14.000Z | 2020-01-28T07:50:18.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('logger', '0009_auto_20151111_0438'),
]
operations = [
migrations.AddField(
model_name='attachment',
... | 21.333333 | 57 | 0.611607 |
5a6d4d171f2bca4b2c60ba398e673b89412fa3ce | 1,049 | py | Python | Tests/test_pyexpat.py | aisk/ironpython3 | d492fd811a0cee4d0a07cd46f02a29a3c90d964b | [
"Apache-2.0"
] | 1,872 | 2015-01-02T18:56:47.000Z | 2022-03-31T07:34:39.000Z | Tests/test_pyexpat.py | aisk/ironpython3 | d492fd811a0cee4d0a07cd46f02a29a3c90d964b | [
"Apache-2.0"
] | 675 | 2015-02-27T09:01:01.000Z | 2022-03-31T14:03:25.000Z | Tests/test_pyexpat.py | aisk/ironpython3 | d492fd811a0cee4d0a07cd46f02a29a3c90d964b | [
"Apache-2.0"
] | 278 | 2015-01-02T03:48:20.000Z | 2022-03-29T20:40:44.000Z | # Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
import pyexpat
from iptest import IronPythonTestCase, run_test
class PyExpatTest(IronPythonTestCase):
def ... | 32.78125 | 77 | 0.64347 |
57588fa30827374bd09957af8a397ff0d9c39c40 | 17,077 | py | Python | scripts/spear_annotate.py | m-crown/SPEAR | 6c5823fcdf3903090381e9f5ac01f95651259ca5 | [
"MIT"
] | 14 | 2021-12-25T10:32:23.000Z | 2022-03-30T22:46:33.000Z | scripts/spear_annotate.py | m-crown/SPEAR | 6c5823fcdf3903090381e9f5ac01f95651259ca5 | [
"MIT"
] | 5 | 2021-12-08T20:42:25.000Z | 2022-02-11T16:42:44.000Z | scripts/spear_annotate.py | m-crown/SPEAR | 6c5823fcdf3903090381e9f5ac01f95651259ca5 | [
"MIT"
] | 1 | 2021-12-20T11:46:11.000Z | 2021-12-20T11:46:11.000Z | #!/usr/bin/env python3
from typing_extensions import final
from pandas.io.pytables import dropna_doc
from Bio import SeqIO
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
import pandas as pd
warnings.filterwarnings('ignore',category=pd.io.pytables.PerformanceWarning) #ignoring the perfo... | 86.685279 | 484 | 0.634069 |
0ac9ad23bfffd91aca22740c77fae95f45687d7b | 3,580 | py | Python | mresvgene/genPosMRVecs02.py | dnolivieri/MResVgene | 08d5cc2368b051ab64ac593b8ebb1b725265f30a | [
"MIT"
] | null | null | null | mresvgene/genPosMRVecs02.py | dnolivieri/MResVgene | 08d5cc2368b051ab64ac593b8ebb1b725265f30a | [
"MIT"
] | null | null | null | mresvgene/genPosMRVecs02.py | dnolivieri/MResVgene | 08d5cc2368b051ab64ac593b8ebb1b725265f30a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
dnolivieri: updated ...4 dec 2015
* used to generate the "positive" multiresolution signals.
- based upon loci.
"""
import pylab as pl
import numpy as np
import sys
from numpy import genfromtxt, savetxt
import time
import timeit
import itertools
import cPickle as pickle
from Bio... | 26.917293 | 90 | 0.549441 |
8814cce047965dcae46372d6f7fc1e5fc9e60299 | 10,184 | py | Python | src/network-manager/azext_network_manager/vendored_sdks/aio/_network_management_client.py | Liran-E/azure-cli-extensions | 053f5c511b58f7de16540d68d8aaa61efd232f15 | [
"MIT"
] | 1 | 2022-01-25T07:33:18.000Z | 2022-01-25T07:33:18.000Z | src/network-manager/azext_network_manager/vendored_sdks/aio/_network_management_client.py | Liran-E/azure-cli-extensions | 053f5c511b58f7de16540d68d8aaa61efd232f15 | [
"MIT"
] | null | null | null | src/network-manager/azext_network_manager/vendored_sdks/aio/_network_management_client.py | Liran-E/azure-cli-extensions | 053f5c511b58f7de16540d68d8aaa61efd232f15 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 65.282051 | 640 | 0.792616 |
1c7840c8d748ec96ee1781c901ad0783cc505d02 | 237,005 | py | Python | venv/Lib/site-packages/PyQt4/examples/webkit/fancybrowser/jquery_rc2.py | prateekfxtd/ns_Startup | 095a62b3a8c7bf0ff7b767355d57d993bbd2423d | [
"MIT"
] | null | null | null | venv/Lib/site-packages/PyQt4/examples/webkit/fancybrowser/jquery_rc2.py | prateekfxtd/ns_Startup | 095a62b3a8c7bf0ff7b767355d57d993bbd2423d | [
"MIT"
] | null | null | null | venv/Lib/site-packages/PyQt4/examples/webkit/fancybrowser/jquery_rc2.py | prateekfxtd/ns_Startup | 095a62b3a8c7bf0ff7b767355d57d993bbd2423d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Resource object code
#
# Created: Wed Mar 20 13:50:25 2013
# by: The Resource Compiler for PyQt (Qt v4.8.4)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\xdf\xa6\
\x2f\
\x2a\x0a\x20\x2a\x20\x6a\x51\x75\x65\x72\x79\x20\x... | 65.561549 | 97 | 0.727276 |
21d836b99430e470308cbcc599729a66142ad3b7 | 35,806 | py | Python | sympy/matrices/dense.py | galbwe/sympy | f7318dbfef2bf61e5ed8bc55f3e374880ec6ea67 | [
"BSD-3-Clause"
] | 1 | 2020-05-26T21:44:06.000Z | 2020-05-26T21:44:06.000Z | sympy/matrices/dense.py | galbwe/sympy | f7318dbfef2bf61e5ed8bc55f3e374880ec6ea67 | [
"BSD-3-Clause"
] | null | null | null | sympy/matrices/dense.py | galbwe/sympy | f7318dbfef2bf61e5ed8bc55f3e374880ec6ea67 | [
"BSD-3-Clause"
] | null | null | null | import random
from sympy.core import SympifyError, Add
from sympy.core.basic import Basic
from sympy.core.compatibility import is_sequence, reduce
from sympy.core.expr import Expr
from sympy.core.singleton import S
from sympy.core.symbol import Symbol
from sympy.core.sympify import sympify
from sympy.functions.element... | 27.374618 | 109 | 0.508965 |
b91de1483f5489dd38729e4f703f16c8d62f8f86 | 1,464 | py | Python | models/datasets/bugs_pair_dataset.py | MorMundHS-MA/predicting-bugs-gnn | 139c7a41b48f2d62c7ded44bb5e6ad56d2584a95 | [
"MIT"
] | null | null | null | models/datasets/bugs_pair_dataset.py | MorMundHS-MA/predicting-bugs-gnn | 139c7a41b48f2d62c7ded44bb5e6ad56d2584a95 | [
"MIT"
] | null | null | null | models/datasets/bugs_pair_dataset.py | MorMundHS-MA/predicting-bugs-gnn | 139c7a41b48f2d62c7ded44bb5e6ad56d2584a95 | [
"MIT"
] | null | null | null | from typing import List, Tuple
import tensorflow as tf
from bson import ObjectId
from DBConnector import DBConnector
from datasets.mongodb_datasource import MongoDBDataset
from source_graph.diff_graphs.diff_graph_input import SourceGraphDiffInput
class BugFixPairDataset(MongoDBDataset):
def __init__(... | 36.6 | 99 | 0.706284 |
c5e9c9be3f8114c3795f004aa0e4d396ba99c9bc | 1,549 | py | Python | torch_glow/tests/nodes/quantized_avgpool2d_test.py | opti-mix/glow | 4ba074df5da9822986a23a6679ab592c22660f6d | [
"Apache-2.0"
] | 1 | 2021-03-04T19:42:54.000Z | 2021-03-04T19:42:54.000Z | torch_glow/tests/nodes/quantized_avgpool2d_test.py | opti-mix/glow | 4ba074df5da9822986a23a6679ab592c22660f6d | [
"Apache-2.0"
] | 1 | 2021-04-17T11:04:55.000Z | 2021-05-17T16:50:01.000Z | torch_glow/tests/nodes/quantized_avgpool2d_test.py | opti-mix/glow | 4ba074df5da9822986a23a6679ab592c22660f6d | [
"Apache-2.0"
] | 2 | 2021-07-29T08:12:35.000Z | 2021-09-15T03:46:18.000Z | from __future__ import absolute_import, division, print_function, unicode_literals
import torch
from tests import utils
class SimpleQuantizedAvgPool2DModule(torch.nn.Module):
def __init__(self, scale, zero_point, dtype, kernel_size):
super(SimpleQuantizedAvgPool2DModule, self).__init__()
self.qua... | 36.880952 | 115 | 0.656553 |
435893a0e2c06be1d5d89aa12828453f2f639b62 | 9,026 | py | Python | gfftk/compare.py | nextgenusfs/gfftk | d2052e2b23ac98c6f073e983af196682038cdcca | [
"BSD-2-Clause"
] | null | null | null | gfftk/compare.py | nextgenusfs/gfftk | d2052e2b23ac98c6f073e983af196682038cdcca | [
"BSD-2-Clause"
] | null | null | null | gfftk/compare.py | nextgenusfs/gfftk | d2052e2b23ac98c6f073e983af196682038cdcca | [
"BSD-2-Clause"
] | null | null | null | import sys
from collections import defaultdict, OrderedDict
from natsort import natsorted
from itertools import product
import numpy as np
from .utils import zopen
from .gff import gff2dict
from .interlap import InterLap
from .consensus import getAED
def compare(args):
compareAnnotations(args.reference, args.quer... | 36.248996 | 159 | 0.530357 |
eca5a93270809cfc2ddba0504b0500f258090669 | 3,361 | py | Python | hal_hw_interface/src/hal_hw_interface/tests/test_hal_io_comp.py | cerna/hal_ros_control | 29ae5eb1e89f66abd2b0b913856fe4a5888a0430 | [
"BSD-3-Clause"
] | null | null | null | hal_hw_interface/src/hal_hw_interface/tests/test_hal_io_comp.py | cerna/hal_ros_control | 29ae5eb1e89f66abd2b0b913856fe4a5888a0430 | [
"BSD-3-Clause"
] | null | null | null | hal_hw_interface/src/hal_hw_interface/tests/test_hal_io_comp.py | cerna/hal_ros_control | 29ae5eb1e89f66abd2b0b913856fe4a5888a0430 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import pytest
from hal_hw_interface.hal_io_comp import HalIO
class TestHalIO(object):
test_class = HalIO
@pytest.fixture
def pin_params(self, mock_rospy, mock_objs):
gp = mock_objs['rospy_get_param']
test_pins = dict(
publish_pins=dict(
... | 36.934066 | 79 | 0.576317 |
e3bb5b67eb9f335da7af1f20b68490d0beeefa07 | 10,763 | py | Python | test/test_master_instance.py | almahmoud/cloudman | 41067dfd66c6334313069874f5f26e5a06884b71 | [
"MIT"
] | 1 | 2021-02-28T18:59:50.000Z | 2021-02-28T18:59:50.000Z | test/test_master_instance.py | almahmoud/cloudman | 41067dfd66c6334313069874f5f26e5a06884b71 | [
"MIT"
] | null | null | null | test/test_master_instance.py | almahmoud/cloudman | 41067dfd66c6334313069874f5f26e5a06884b71 | [
"MIT"
] | null | null | null | from unittest import TestCase
from cm.instance import Instance
from cm.instance import TIME_IN_PAST
from cm.util import instance_states
from test_utils import TestApp
from test_utils import MockBotoInstance
from test_utils import DEFAULT_MOCK_BOTO_INSTANCE_ID
from test_utils import instrument_time
class MasterInsta... | 42.374016 | 89 | 0.711697 |
f9d32109a222277b3999eaec6d60aed137891b31 | 727 | py | Python | sample_register/sample_register/doctype/contract/contract.py | TRUFIL/sampreg | d14155954b3a22b0a727d61e55f3619ade448379 | [
"MIT"
] | null | null | null | sample_register/sample_register/doctype/contract/contract.py | TRUFIL/sampreg | d14155954b3a22b0a727d61e55f3619ade448379 | [
"MIT"
] | null | null | null | sample_register/sample_register/doctype/contract/contract.py | TRUFIL/sampreg | d14155954b3a22b0a727d61e55f3619ade448379 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, indictrans and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.model.mapper import get_mapped_doc
from frappe.utils import cstr, cint
from frappe imp... | 25.068966 | 52 | 0.74553 |
cb4c4fc99c14614fa2a27f2beef1a261b18c6592 | 6,657 | py | Python | tests/test_cameras_alignment.py | jkxing/pytorch3d | 71dbebe8010a0dac3e56be464778aa48fbd3bcd3 | [
"BSD-3-Clause"
] | 6,041 | 2020-01-23T23:29:41.000Z | 2022-03-31T21:35:13.000Z | tests/test_cameras_alignment.py | jkxing/pytorch3d | 71dbebe8010a0dac3e56be464778aa48fbd3bcd3 | [
"BSD-3-Clause"
] | 1,054 | 2020-01-24T15:23:15.000Z | 2022-03-31T15:31:59.000Z | tests/test_cameras_alignment.py | jkxing/pytorch3d | 71dbebe8010a0dac3e56be464778aa48fbd3bcd3 | [
"BSD-3-Clause"
] | 943 | 2020-01-24T00:10:30.000Z | 2022-03-31T04:02:35.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import numpy as np
import torch
from common_testing import TestCaseMixin
from pytorch3d.ops impo... | 37.610169 | 88 | 0.543037 |
47491c3f6e5e385dcc29c441e20142e34a833806 | 1,668 | py | Python | token_label.py | alicekre/Python_Muehle | 358fcc4c12319a0c9bb107fe6b2d432e31f3037d | [
"Apache-2.0"
] | null | null | null | token_label.py | alicekre/Python_Muehle | 358fcc4c12319a0c9bb107fe6b2d432e31f3037d | [
"Apache-2.0"
] | null | null | null | token_label.py | alicekre/Python_Muehle | 358fcc4c12319a0c9bb107fe6b2d432e31f3037d | [
"Apache-2.0"
] | null | null | null | from PyQt5.QtCore import Qt, QMimeData
from PyQt5.QtGui import QPixmap, QDrag, QPainter
from PyQt5.QtWidgets import QLabel, QApplication
class token_label(QLabel):
def __init__(self, parent):
super(QLabel, self).__init__(parent)
self.show()
def saveDialog(self, dialog):
self.d... | 29.785714 | 105 | 0.579736 |
dacc4bbaedc8cd9e271870d733ed179f76f08971 | 2,195 | py | Python | apps/cms/forms.py | dengjinshan/bbs | b61ae9839d3b72ffba7adb94ab4327ecd78be14e | [
"MIT"
] | null | null | null | apps/cms/forms.py | dengjinshan/bbs | b61ae9839d3b72ffba7adb94ab4327ecd78be14e | [
"MIT"
] | 5 | 2021-03-19T02:01:00.000Z | 2022-03-11T23:52:57.000Z | apps/cms/forms.py | dengjinshan/bbs | b61ae9839d3b72ffba7adb94ab4327ecd78be14e | [
"MIT"
] | null | null | null | #coding:utf-8
from flask import g, current_app
from wtforms import Form, StringField, IntegerField
from wtforms.validators import Email, InputRequired, Length, EqualTo, ValidationError
from apps.forms import BaseForm
class LoginForm(BaseForm):
# 登陆验证表单
email = StringField(validators=[Email(message='邮箱格式不正确'),... | 36.583333 | 94 | 0.70615 |
b61f40f77e774c71f59d7def2af1b9d8c12ad1fd | 15,592 | py | Python | oase-root/backyards/ad_collaboration/ad_collaboration.py | wreathvine/oase-remove-file-test | 328e62aad90b888eaa8ebb3284e7f9e5b369af9e | [
"Apache-2.0"
] | null | null | null | oase-root/backyards/ad_collaboration/ad_collaboration.py | wreathvine/oase-remove-file-test | 328e62aad90b888eaa8ebb3284e7f9e5b369af9e | [
"Apache-2.0"
] | null | null | null | oase-root/backyards/ad_collaboration/ad_collaboration.py | wreathvine/oase-remove-file-test | 328e62aad90b888eaa8ebb3284e7f9e5b369af9e | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 NEC 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... | 39.979487 | 162 | 0.597678 |
25dcdb40ed28151b52e0fca27bed6253ab5925fd | 2,662 | py | Python | userbot/modules/ocr.py | AlhamFadilah/UserBotTG | 23a7d7d0500d3dc86c240636c3e5b93a376d0df6 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/ocr.py | AlhamFadilah/UserBotTG | 23a7d7d0500d3dc86c240636c3e5b93a376d0df6 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2020-07-31T10:28:19.000Z | 2020-07-31T10:28:19.000Z | userbot/modules/ocr.py | AlhamFadilah/UserBotTG | 23a7d7d0500d3dc86c240636c3e5b93a376d0df6 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
import os
import requests
from userbot import bot, OCR_SPACE_API_KEY, CMD_HELP, TEMP_DOWNLOAD_DIRECTORY
from use... | 36.465753 | 100 | 0.604808 |
9169af43a903ff4f4ee027fd561b09cc542ad3ba | 3,123 | py | Python | imcsdk/mometa/firmware/FirmwareRunning.py | kgrozis/UCS-CIMC-Scripts | 44069ee853299fe5aeed023e8c998ce2534b8d8b | [
"Apache-2.0"
] | null | null | null | imcsdk/mometa/firmware/FirmwareRunning.py | kgrozis/UCS-CIMC-Scripts | 44069ee853299fe5aeed023e8c998ce2534b8d8b | [
"Apache-2.0"
] | null | null | null | imcsdk/mometa/firmware/FirmwareRunning.py | kgrozis/UCS-CIMC-Scripts | 44069ee853299fe5aeed023e8c998ce2534b8d8b | [
"Apache-2.0"
] | null | null | null | """This module contains the general information for FirmwareRunning ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import ImcVersion, MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class FirmwareRunningConsts():
DEPLOYMENT_BOOT_LOADER = "boot-loader"
DEPLOYMENT_KERNEL = "... | 49.571429 | 249 | 0.663144 |
e59cab9925882cd393ac72c3a12effe54e89c109 | 9,334 | py | Python | docs/conf.py | localmed/pyserializer | 1b79fa9aa0155906b786e46853d7a19bceacf3f3 | [
"MIT"
] | 6 | 2015-08-11T08:24:56.000Z | 2019-03-05T03:39:27.000Z | docs/conf.py | localmed/pyserializer | 1b79fa9aa0155906b786e46853d7a19bceacf3f3 | [
"MIT"
] | 26 | 2016-01-25T16:51:30.000Z | 2018-07-13T16:51:18.000Z | docs/conf.py | localmed/pyserializer | 1b79fa9aa0155906b786e46853d7a19bceacf3f3 | [
"MIT"
] | 1 | 2016-12-27T19:46:28.000Z | 2016-12-27T19:46:28.000Z | # -*- coding: utf-8 -*-
#
# pyserializer documentation build configuration file, created by
# sphinx-quickstart on Sun Jan 31 21:45:05 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
... | 32.522648 | 79 | 0.720591 |
8e7a5f1f6bc6814b85e5bff8c1a9e8fef8ade428 | 6,745 | py | Python | podoc/utils.py | podoc/podoc | 1868e7f82a521b1722dca528802acedf9010b11a | [
"BSD-3-Clause"
] | 54 | 2015-09-28T11:00:47.000Z | 2021-11-10T13:38:56.000Z | podoc/utils.py | podoc/podoc | 1868e7f82a521b1722dca528802acedf9010b11a | [
"BSD-3-Clause"
] | 36 | 2015-09-14T15:50:44.000Z | 2018-10-16T02:44:27.000Z | podoc/utils.py | podoc/podoc | 1868e7f82a521b1722dca528802acedf9010b11a | [
"BSD-3-Clause"
] | 9 | 2015-09-15T07:15:00.000Z | 2018-05-29T02:11:38.000Z | # -*- coding: utf-8 -*-
"""Utility functions."""
from contextlib import contextmanager
from io import StringIO
import json
import logging
import os
import os.path as op
import sys
import pypandoc
pandoc = pypandoc.convert
logger = logging.getLogger(__name__)
#------------------------------------------------------... | 29.454148 | 98 | 0.49874 |
cee5eef0b22df999fe43dce808ef25832e43e269 | 6,677 | py | Python | src/demo.py | goan15910/ConvDet | 6404622cc9d0c8e8b756260c4979b6842b2d0cb0 | [
"BSD-2-Clause"
] | null | null | null | src/demo.py | goan15910/ConvDet | 6404622cc9d0c8e8b756260c4979b6842b2d0cb0 | [
"BSD-2-Clause"
] | null | null | null | src/demo.py | goan15910/ConvDet | 6404622cc9d0c8e8b756260c4979b6842b2d0cb0 | [
"BSD-2-Clause"
] | null | null | null | # Author: Bichen Wu (bichen@berkeley.edu) 08/25/2016
"""SqueezeDet Demo.
In image detection mode, for a given image, detect objects and draw bounding
boxes around them. In video detection mode, perform real-time detection on the
video stream.
"""
from __future__ import absolute_import
from __future__ import divisio... | 30.62844 | 79 | 0.608507 |
b5565c81a4bb4085afbc621f32c8f2833637e609 | 187 | py | Python | pksampler/Black/Views/__init__.py | patrickkidd/pksampler-0.3 | ffe5f1fde1d86052da34d9ee9c44934461c441e2 | [
"MIT"
] | null | null | null | pksampler/Black/Views/__init__.py | patrickkidd/pksampler-0.3 | ffe5f1fde1d86052da34d9ee9c44934461c441e2 | [
"MIT"
] | null | null | null | pksampler/Black/Views/__init__.py | patrickkidd/pksampler-0.3 | ffe5f1fde1d86052da34d9ee9c44934461c441e2 | [
"MIT"
] | null | null | null | from SampleView import SampleView
from SelectorView import SelectorView
from ControlPanelView import ControlPanelView
from LibraryView import LibraryView
from TempoView import TempoView
| 26.714286 | 45 | 0.887701 |
1ad94a45d2ca71b90980680fab172537bb2cdfa7 | 2,334 | py | Python | test/test_cluster.py | AYLIEN/aylien_newsapi_python | ab4e667e718e8f919b894d4e4ec76e5d37b2fe74 | [
"Apache-2.0"
] | 13 | 2016-04-30T12:08:24.000Z | 2021-09-14T13:57:46.000Z | test/test_cluster.py | AYLIEN/aylien_newsapi_python | ab4e667e718e8f919b894d4e4ec76e5d37b2fe74 | [
"Apache-2.0"
] | 3 | 2016-09-02T08:22:28.000Z | 2018-07-03T10:59:31.000Z | test/test_cluster.py | AYLIEN/aylien_newsapi_python | ab4e667e718e8f919b894d4e4ec76e5d37b2fe74 | [
"Apache-2.0"
] | 5 | 2016-12-20T08:17:47.000Z | 2022-01-11T22:44:43.000Z | # coding: utf-8
"""
AYLIEN News API
The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. # noqa: E501
The version of the OpenAPI document: ... | 34.835821 | 235 | 0.598972 |
a4b5c580bc90f7995f6d8e4902cd42dc28c4dcb7 | 2,870 | py | Python | cord/utilities/client_utilities.py | Esbenthorius/cord-client-python | b8526f468df1644e77dde5a8f20fe3bef71438da | [
"Apache-2.0"
] | 1 | 2022-02-24T15:21:36.000Z | 2022-02-24T15:21:36.000Z | encord/utilities/client_utilities.py | eloy-encord/encord-client-python | 59e42ac579370dad253132655e17807853d1637f | [
"Apache-2.0"
] | null | null | null | encord/utilities/client_utilities.py | eloy-encord/encord-client-python | 59e42ac579370dad253132655e17807853d1637f | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2020 Cord Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 29.285714 | 116 | 0.702787 |
800ccd1938fb2d24b5397b271ac747a44b7cfc68 | 12,366 | py | Python | homeassistant/components/flux/switch.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 3 | 2020-01-21T18:09:09.000Z | 2022-01-17T08:06:03.000Z | homeassistant/components/flux/switch.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 39 | 2016-12-16T12:40:34.000Z | 2017-02-13T17:53:42.000Z | homeassistant/components/flux/switch.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 3 | 2020-01-11T15:44:13.000Z | 2022-01-17T08:06:09.000Z | """
Flux for Home-Assistant.
The idea was taken from https://github.com/KpaBap/hue-flux/
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/switch.flux/
"""
import datetime
import logging
import voluptuous as vol
import homeassistant.helpers.config_valid... | 34.445682 | 87 | 0.622028 |
f8839a47387a9bd0db8e857b132822a7838f9ede | 551 | py | Python | np/reference/ch8code/decorator_test.py | focusunsink/study_python | 322326642db54df8725793d70a95d21ac40b6507 | [
"MIT"
] | null | null | null | np/reference/ch8code/decorator_test.py | focusunsink/study_python | 322326642db54df8725793d70a95d21ac40b6507 | [
"MIT"
] | null | null | null | np/reference/ch8code/decorator_test.py | focusunsink/study_python | 322326642db54df8725793d70a95d21ac40b6507 | [
"MIT"
] | null | null | null | from numpy.testing.decorators import setastest
from numpy.testing.decorators import skipif
from numpy.testing.decorators import knownfailureif
from numpy.testing import decorate_methods
@setastest(False)
def test_false():
pass
@setastest(True)
def test_true():
pass
@skipif(True)
def test_skip():
pass
@kno... | 15.742857 | 61 | 0.747731 |
5620b81e8a4f735c2b0eb9248a20eba6a378c4a2 | 443 | py | Python | insertion/Insert.py | jgoralcz/MGDB | 81a9e42e65550a6ee6b0e7b0cca733dde49106af | [
"MIT"
] | null | null | null | insertion/Insert.py | jgoralcz/MGDB | 81a9e42e65550a6ee6b0e7b0cca733dde49106af | [
"MIT"
] | null | null | null | insertion/Insert.py | jgoralcz/MGDB | 81a9e42e65550a6ee6b0e7b0cca733dde49106af | [
"MIT"
] | null | null | null | class Insert:
"""
INSERT IGNORE into the database.
"""
@staticmethod
def insert(table_name, tuple_str):
"""
the name of the table to INSERT IGNORE into.
:param table_name: the table name.
:type: str
:param tuple_str: the parameters of the VALUES to enter.
... | 27.6875 | 78 | 0.575621 |
7359eac6393bd9b1d66b21004b75bd2ea9c07506 | 10,887 | py | Python | scripts/make_lightcones_for_fisher.py | charlottenosam/21cmfish | c189e6cb448bf5b2970a2e5f0ca5673918f15276 | [
"MIT"
] | 3 | 2021-07-22T21:12:16.000Z | 2022-02-04T08:31:21.000Z | scripts/make_lightcones_for_fisher.py | charlottenosam/21cmfish | c189e6cb448bf5b2970a2e5f0ca5673918f15276 | [
"MIT"
] | null | null | null | scripts/make_lightcones_for_fisher.py | charlottenosam/21cmfish | c189e6cb448bf5b2970a2e5f0ca5673918f15276 | [
"MIT"
] | 1 | 2021-11-02T20:38:45.000Z | 2021-11-02T20:38:45.000Z | import py21cmfast as p21c
import os, glob
import numpy as np
import time
import itertools as it
from joblib import Parallel, delayed
import argparse
import configparser
import multiprocessing
import py21cmfish as p21fish
print(f"21cmFAST version is {p21c.__version__}")
import logging
logger = logging.getLogger("21cm... | 36.656566 | 147 | 0.620648 |
e3387a6c25866b2456628e4a59c13a0b45a702a0 | 5,244 | py | Python | azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/start_container_operations.py | Christina-Kang/azure-sdk-for-python | bbf982eb06aab04b8151f69f1d230b7f5fb96ebf | [
"MIT"
] | 1 | 2022-03-30T22:39:15.000Z | 2022-03-30T22:39:15.000Z | azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/start_container_operations.py | Christina-Kang/azure-sdk-for-python | bbf982eb06aab04b8151f69f1d230b7f5fb96ebf | [
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/start_container_operations.py | Christina-Kang/azure-sdk-for-python | bbf982eb06aab04b8151f69f1d230b7f5fb96ebf | [
"MIT"
] | 2 | 2017-01-20T18:25:46.000Z | 2017-05-12T21:31:47.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 44.440678 | 211 | 0.683638 |
ce653426470d77458f0e514cb6e868414448066f | 335 | py | Python | Demos/Module5/map_finish.py | bdheard/PythonEssentials | 89aac7177a2f8802663bbbaed876e7554ccc739d | [
"MIT"
] | null | null | null | Demos/Module5/map_finish.py | bdheard/PythonEssentials | 89aac7177a2f8802663bbbaed876e7554ccc739d | [
"MIT"
] | null | null | null | Demos/Module5/map_finish.py | bdheard/PythonEssentials | 89aac7177a2f8802663bbbaed876e7554ccc739d | [
"MIT"
] | null | null | null | #
# Map
#
# define list
price_list = [1.09, 23.56, 57.84, 4.56, 6.78]
# define tax rate
TAX_RATE = .08
# create function that will handle work
def get_price_with_tax(txn):
return txn * (1 + TAX_RATE)
# invoke map to transform the list
final_prices = map(get_price_with_tax, price_list)
# display list
print(list... | 17.631579 | 50 | 0.713433 |
dccc771cb40d751b66511e61b813e8769acb55b0 | 745 | py | Python | scrapers/manolo_scraper/spiders/tc_local.py | rmaceissoft/django-manolo | 7a447b6b06a5a9a0bbc3ed5daf754721a48bbd76 | [
"BSD-3-Clause"
] | null | null | null | scrapers/manolo_scraper/spiders/tc_local.py | rmaceissoft/django-manolo | 7a447b6b06a5a9a0bbc3ed5daf754721a48bbd76 | [
"BSD-3-Clause"
] | null | null | null | scrapers/manolo_scraper/spiders/tc_local.py | rmaceissoft/django-manolo | 7a447b6b06a5a9a0bbc3ed5daf754721a48bbd76 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
from datetime import timedelta
import scrapy
from scrapers.manolo_scraper.spiders.tc import TcSpider
class TcSpiderLocal(TcSpider):
name = "tc_local"
allowed_domains = ["127.0.0.1"]
def start_requests(self):
end_date = datetime.date.today()
delta ... | 29.8 | 82 | 0.636242 |
e6975c984e920e73a75afb78ca3ecf3b2a073390 | 2,972 | py | Python | ORStools/gui/ORStoolsDialogConfigUI.py | Mappboy/orstools-qgis-plugin | 07cac3f331cd96cc12c8555b01d84d75bda7970d | [
"MIT"
] | 21 | 2019-11-21T04:39:01.000Z | 2022-03-29T23:05:21.000Z | ORStools/gui/ORStoolsDialogConfigUI.py | Mappboy/orstools-qgis-plugin | 07cac3f331cd96cc12c8555b01d84d75bda7970d | [
"MIT"
] | 56 | 2019-08-27T12:22:48.000Z | 2022-03-09T16:01:17.000Z | ORStools/gui/ORStoolsDialogConfigUI.py | Mappboy/orstools-qgis-plugin | 07cac3f331cd96cc12c8555b01d84d75bda7970d | [
"MIT"
] | 14 | 2019-09-06T22:30:44.000Z | 2022-02-26T22:18:15.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ORStools/gui/ORStoolsDialogConfigUI.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_ORStoolsDialogConfigBase(object):
def se... | 55.037037 | 108 | 0.762786 |
b9e2f7d9116d88deeb72903823c2b9d05676bb7a | 230 | py | Python | .history/my_classes/ScopesClosuresAndDecorators/Closures_20210711165558.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/ScopesClosuresAndDecorators/Closures_20210711165558.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/ScopesClosuresAndDecorators/Closures_20210711165558.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | """ Closuers
Free variables and closures
Remember: Functions defined inside another function can access the outer (nonLocal) variables
"""
def outer():
x = 'python'
def inner():
print("{0")
| 17.692308 | 93 | 0.608696 |
9a2bddc67fac807181aac08e51d9e95209ed1b6a | 9,022 | py | Python | lingvo/model_registry.py | muntasir2000/lingvo | 1555299b817288b5a6637ded416dbbdc9b00036d | [
"Apache-2.0"
] | null | null | null | lingvo/model_registry.py | muntasir2000/lingvo | 1555299b817288b5a6637ded416dbbdc9b00036d | [
"Apache-2.0"
] | null | null | null | lingvo/model_registry.py | muntasir2000/lingvo | 1555299b817288b5a6637ded416dbbdc9b00036d | [
"Apache-2.0"
] | null | null | null | # Lint as: python2, python3
# Copyright 2018 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
#
... | 38.555556 | 80 | 0.707825 |
6e68d0a987146a8e4e9ff53cc3811ca6156d9e46 | 70,985 | py | Python | bin/Python27/Lib/site-packages/scipy/spatial/distance.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | bin/Python27/Lib/site-packages/scipy/spatial/distance.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | bin/Python27/Lib/site-packages/scipy/spatial/distance.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | 1 | 2020-08-08T12:44:48.000Z | 2020-08-08T12:44:48.000Z | """
=====================================================
Distance computations (:mod:`scipy.spatial.distance`)
=====================================================
.. sectionauthor:: Damian Eads
Function Reference
------------------
Distance matrix computation from a collection of raw observation vectors... | 32.090868 | 81 | 0.532169 |
13cfeba9adbe7ac4477aa34e1cb5c472cec58bf1 | 32,368 | py | Python | src/opendr/engine/target.py | makistsantekidis/opendr | 07dee3b59d3487b9c5a93d6946317178a02c9890 | [
"Apache-2.0"
] | 3 | 2021-06-24T01:54:25.000Z | 2021-12-12T16:21:24.000Z | src/opendr/engine/target.py | makistsantekidis/opendr | 07dee3b59d3487b9c5a93d6946317178a02c9890 | [
"Apache-2.0"
] | 79 | 2021-06-23T10:40:10.000Z | 2021-12-16T07:59:42.000Z | src/opendr/engine/target.py | makistsantekidis/opendr | 07dee3b59d3487b9c5a93d6946317178a02c9890 | [
"Apache-2.0"
] | 5 | 2021-07-04T07:38:50.000Z | 2021-12-12T16:18:47.000Z | # Copyright 2020 Aristotle University of Thessaloniki
#
# 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 ... | 30.507069 | 119 | 0.569266 |
1dd2be8974d114ba5a5e2fcb02c58b34731b56fc | 302 | py | Python | setup.py | upsideon/quantum-subset-sum | c965c5ccd0a0554421cbb0d54a9bcd8bd5f88769 | [
"MIT"
] | null | null | null | setup.py | upsideon/quantum-subset-sum | c965c5ccd0a0554421cbb0d54a9bcd8bd5f88769 | [
"MIT"
] | null | null | null | setup.py | upsideon/quantum-subset-sum | c965c5ccd0a0554421cbb0d54a9bcd8bd5f88769 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name="quantum-subset-sum",
version="0.1.0",
description=("A quantum algorithm for solving the subset sum problem."),
license="MIT",
url="https://github.com/upsideon/quantum-subset-sum",
packages=["qss"],
requires=["numpy", "qiskit",],
)
| 25.166667 | 76 | 0.655629 |
f7c4395525abf235bfccb2d34c5babe7a2ba9d0b | 3,043 | py | Python | cvxpy/reductions/solvers/conic_solvers/ecos_bb_conif.py | NunoEdgarGFlowHub/cvxpy | 43270fcc8af8fc4742f1b3519800b0074f2e6693 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cvxpy/reductions/solvers/conic_solvers/ecos_bb_conif.py | NunoEdgarGFlowHub/cvxpy | 43270fcc8af8fc4742f1b3519800b0074f2e6693 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cvxpy/reductions/solvers/conic_solvers/ecos_bb_conif.py | NunoEdgarGFlowHub/cvxpy | 43270fcc8af8fc4742f1b3519800b0074f2e6693 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | """
Copyright 2013 Steven Diamond
This file is part of CVXPY.
CVXPY is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CVXPY is distributed i... | 38.0375 | 88 | 0.653631 |
c4db002fc4053051c39e7874f0717688ec05d02a | 1,544 | py | Python | Array/Count_and_Say.py | shua2018ti/Google | 3a9847e0c60d887d15eb4b0d4d8ebf51e464df1b | [
"MIT"
] | 87 | 2015-07-15T20:41:09.000Z | 2022-03-08T13:55:38.000Z | Array/Count_and_Say.py | shua2018ti/Google | 3a9847e0c60d887d15eb4b0d4d8ebf51e464df1b | [
"MIT"
] | 59 | 2015-03-19T22:26:41.000Z | 2015-07-25T17:58:08.000Z | Array/Count_and_Say.py | shua2018ti/Google | 3a9847e0c60d887d15eb4b0d4d8ebf51e464df1b | [
"MIT"
] | 45 | 2015-07-15T20:41:12.000Z | 2022-02-01T20:18:07.000Z | The count-and-say sequence is the sequence of integers beginning as follows:
1, 11, 21, 1211, 111221, ...
1 is read off as "one 1" or 11.
11 is read off as "two 1s" or 21.
21 is read off as "one 2, then one 1" or 1211.
Given an integer n, generate the nth sequence.
Note: The sequence of integers will be represented a... | 27.571429 | 105 | 0.494819 |
09b32b584ff20e6ba146bc23806ad9ba03d20691 | 2,173 | py | Python | share/qt/extract_strings_qt.py | xccdev/cobaltcash | 4045738b1d340b2cccbe96ffcc3a610db06dfc50 | [
"MIT"
] | null | null | null | share/qt/extract_strings_qt.py | xccdev/cobaltcash | 4045738b1d340b2cccbe96ffcc3a610db06dfc50 | [
"MIT"
] | null | null | null | share/qt/extract_strings_qt.py | xccdev/cobaltcash | 4045738b1d340b2cccbe96ffcc3a610db06dfc50 | [
"MIT"
] | 1 | 2018-07-21T05:01:06.000Z | 2018-07-21T05:01:06.000Z | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt stringdefs so that
they can be picked up by Qt linguist.
'''
from __future__ import division,print_function,unicode_literals
from subprocess import Popen, PIPE
import glob
import operator
import os
import sys
OUT_CPP="qt/cobaltcashstrings... | 25.869048 | 105 | 0.621261 |
3a4c07f7418ec852e7c2489e409bd6067d1068f4 | 2,299 | py | Python | qa/rpc-tests/forknotify.py | bitcoinclassicrbf/bitcoinclassicrbf | da85d6a22dd1d9d0e8091d8581dcc7a1fc3a21fa | [
"MIT"
] | null | null | null | qa/rpc-tests/forknotify.py | bitcoinclassicrbf/bitcoinclassicrbf | da85d6a22dd1d9d0e8091d8581dcc7a1fc3a21fa | [
"MIT"
] | null | null | null | qa/rpc-tests/forknotify.py | bitcoinclassicrbf/bitcoinclassicrbf | da85d6a22dd1d9d0e8091d8581dcc7a1fc3a21fa | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# Copyright (c) 2014-2015 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 -alertnotify
#
from test_framework.test_framework import BitcoinTestFramework
from test_framew... | 33.318841 | 108 | 0.634189 |
f0597e20619493b90fe5e49297c36e65db64af75 | 3,232 | py | Python | main.py | IITHeathens/AI_PredictionsServer | 770a0ad4118957c03408792faab820be7717b984 | [
"MIT"
] | null | null | null | main.py | IITHeathens/AI_PredictionsServer | 770a0ad4118957c03408792faab820be7717b984 | [
"MIT"
] | null | null | null | main.py | IITHeathens/AI_PredictionsServer | 770a0ad4118957c03408792faab820be7717b984 | [
"MIT"
] | null | null | null | import pandas as pd
import re
# Ignore sklearn module's unnecessary warnings
def warn(*args, **kwargs):
pass
import warnings
warnings.warn = warn
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
# Section_1: Functions... | 32 | 93 | 0.721844 |
c23352927a9f92d8a640c06aaf50ee7cdd8fd97f | 1,764 | py | Python | Leetcode-cn/1838.最高频元素的频数.py | joey66666/Codeyard | 08fc599baf1d99e39f878386124af854006a3602 | [
"MIT"
] | null | null | null | Leetcode-cn/1838.最高频元素的频数.py | joey66666/Codeyard | 08fc599baf1d99e39f878386124af854006a3602 | [
"MIT"
] | 3 | 2020-08-11T10:18:23.000Z | 2021-05-18T15:25:42.000Z | Leetcode-cn/1838.最高频元素的频数.py | joey66666/Codeyard | 08fc599baf1d99e39f878386124af854006a3602 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode.cn id=1838 lang=python3
#
# [1838] 最高频元素的频数
#
# https://leetcode-cn.com/problems/frequency-of-the-most-frequent-element/description/
#
# algorithms
# Medium (38.05%)
# Likes: 136
# Dislikes: 0
# Total Accepted: 20.8K
# Total Submissions: 49.3K
# Testcase Example: '[1,2,4]\n5'
#
# 元素的 频数 是该元素... | 21.253012 | 122 | 0.558957 |
6158b571155e77cb0b22c972a9b955f13a7c4618 | 560 | py | Python | setup.py | arnabhan/graphletminer | 332c0ed55367a0e906eef51e5faadec37b1b9c58 | [
"BSD-2-Clause"
] | 2 | 2020-04-11T19:13:27.000Z | 2020-09-27T11:55:30.000Z | setup.py | arnabhan/graphletminer | 332c0ed55367a0e906eef51e5faadec37b1b9c58 | [
"BSD-2-Clause"
] | null | null | null | setup.py | arnabhan/graphletminer | 332c0ed55367a0e906eef51e5faadec37b1b9c58 | [
"BSD-2-Clause"
] | null | null | null |
from setuptools import setup, find_packages
with open('README.md') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='GraphletMiner',
version='0.1.0',
description='Graphlet miner: a text pattern analysis library for Python',
long_description=readme,
author... | 24.347826 | 77 | 0.680357 |
374f1b4c06ab2b27a869614e8955f1241353f7e4 | 2,375 | py | Python | llcv/datasets/__init__.py | mtli/llcv | 5d0989fe5ff6c093410c1f67af198419f7f7c019 | [
"MIT"
] | 1 | 2022-02-26T05:39:40.000Z | 2022-02-26T05:39:40.000Z | llcv/datasets/__init__.py | mtli/llcv | 5d0989fe5ff6c093410c1f67af198419f7f7c019 | [
"MIT"
] | null | null | null | llcv/datasets/__init__.py | mtli/llcv | 5d0989fe5ff6c093410c1f67af198419f7f7c019 | [
"MIT"
] | null | null | null | import logging
import torch
from torch.utils.data import DataLoader
from torch.utils.data.distributed import DistributedSampler
import torchvision.datasets as tv_datasets
from .pipelines import build_pipeline
from ..utils import build_ext_class, dist_is_on
from .coco import COCODataset
def build_dataset... | 33.928571 | 131 | 0.640842 |
4e0bd546e9a30704e780a6071f4ccbb681b2c4ec | 694 | py | Python | wdae/wdae/users_api/urls.py | iossifovlab/gpf | e556243d29666179dbcb72859845b4d6c011af2b | [
"MIT"
] | null | null | null | wdae/wdae/users_api/urls.py | iossifovlab/gpf | e556243d29666179dbcb72859845b4d6c011af2b | [
"MIT"
] | 82 | 2019-07-22T11:44:23.000Z | 2022-01-13T15:27:33.000Z | wdae/wdae/users_api/urls.py | iossifovlab/gpf | e556243d29666179dbcb72859845b4d6c011af2b | [
"MIT"
] | null | null | null | """
Created on Aug 10, 2016
@author: lubo
"""
from django.urls import re_path
from rest_framework.routers import SimpleRouter
from . import views
router = SimpleRouter(trailing_slash=False)
router.register(r"users", views.UserViewSet, basename="users")
urlpatterns = [
re_path(r"^users/register/?$", views.registe... | 31.545455 | 67 | 0.720461 |
7568d4982127acd52c218fafcdc26ab4151d5413 | 8,889 | py | Python | frappe/email/email_body.py | badili/frappe | 8177d7e745f511fcc4da50fed9e291a58172a613 | [
"MIT"
] | null | null | null | frappe/email/email_body.py | badili/frappe | 8177d7e745f511fcc4da50fed9e291a58172a613 | [
"MIT"
] | null | null | null | frappe/email/email_body.py | badili/frappe | 8177d7e745f511fcc4da50fed9e291a58172a613 | [
"MIT"
] | 5 | 2016-06-20T08:48:11.000Z | 2018-12-12T09:42:31.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils.pdf import get_pdf
from frappe.email.smtp import get_outgoing_email_account
from frappe.utils import (get_url, scrub_urls, strip, expand_relative_u... | 33.16791 | 115 | 0.729328 |
e6bb85dd670827e054b23ac008205ace7daccab9 | 394 | py | Python | qbosdk/__init__.py | fylein/qbo-sdk-py | 0ae26080b5c568a29f2b1d688c429ba03d393807 | [
"MIT"
] | null | null | null | qbosdk/__init__.py | fylein/qbo-sdk-py | 0ae26080b5c568a29f2b1d688c429ba03d393807 | [
"MIT"
] | 2 | 2021-05-04T14:21:54.000Z | 2021-08-31T11:10:44.000Z | qbosdk/__init__.py | fylein/qbo-sdk-py | 0ae26080b5c568a29f2b1d688c429ba03d393807 | [
"MIT"
] | 3 | 2020-01-08T04:44:16.000Z | 2020-12-16T17:26:23.000Z | """
Quickbooks Online init
"""
from .qbosdk import QuickbooksOnlineSDK
from.exceptions import *
__all__ = [
'QuickbooksOnlineSDK',
'QuickbooksOnlineSDKError',
'NotFoundClientError',
'UnauthorizedClientError',
'ExpiredTokenError',
'InvalidTokenError',
'NoPrivilegeError',
'WrongParamsErro... | 18.761905 | 39 | 0.708122 |
b40f514376e1a4d1040a64715b43b078717fd4b9 | 17,614 | py | Python | scripts/tree_bpe.py | mattr1/seq2struct_forPRs | cdc9e3c94380fb479ed3e3c77f370038d27cf2d6 | [
"MIT"
] | 25 | 2019-07-16T22:32:44.000Z | 2022-01-25T05:23:07.000Z | scripts/tree_bpe.py | mattr1/seq2struct_forPRs | cdc9e3c94380fb479ed3e3c77f370038d27cf2d6 | [
"MIT"
] | 19 | 2018-12-17T20:42:11.000Z | 2020-02-12T21:29:51.000Z | scripts/tree_bpe.py | mattr1/seq2struct_forPRs | cdc9e3c94380fb479ed3e3c77f370038d27cf2d6 | [
"MIT"
] | 22 | 2019-03-16T05:57:27.000Z | 2020-10-25T04:34:54.000Z | # coding: utf-8
import argparse
import collections
import copy
import io
import itertools
import json
import _jsonnet
import asdl
import attr
import networkx
import tqdm
from seq2struct import datasets
from seq2struct import models
from seq2struct.utils import registry
# Initial units: node and its required product-... | 38.54267 | 119 | 0.572386 |
fe1383c08d966bb59e994e964fdd22ecdb958648 | 10,719 | py | Python | monai/apps/pathology/transforms/spatial/array.py | Can-Zhao/MONAI | e29ef022b97a4e809dd22d4d208005f541ee061b | [
"Apache-2.0"
] | 1 | 2022-01-11T05:37:44.000Z | 2022-01-11T05:37:44.000Z | monai/apps/pathology/transforms/spatial/array.py | scf819/MONAI | 2fef7ff5c064a9ff6b6d6b4f2323180afed99934 | [
"Apache-2.0"
] | null | null | null | monai/apps/pathology/transforms/spatial/array.py | scf819/MONAI | 2fef7ff5c064a9ff6b6d6b4f2323180afed99934 | [
"Apache-2.0"
] | 1 | 2020-05-27T12:53:58.000Z | 2020-05-27T12:53:58.000Z | # Copyright (c) MONAI Consortium
# 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, so... | 40.602273 | 120 | 0.593432 |
47510219c51bcf9834b0937145856b3db34a08ab | 248 | py | Python | O365/utils/__init__.py | PhoenixAlx/py-o365 | 82f4397292de96285c997fa715995773ec7d1cb9 | [
"Apache-2.0"
] | null | null | null | O365/utils/__init__.py | PhoenixAlx/py-o365 | 82f4397292de96285c997fa715995773ec7d1cb9 | [
"Apache-2.0"
] | null | null | null | O365/utils/__init__.py | PhoenixAlx/py-o365 | 82f4397292de96285c997fa715995773ec7d1cb9 | [
"Apache-2.0"
] | null | null | null |
from .utils import ApiComponent, WellKnowFolderNames, Pagination, Query, NEXT_LINK_KEYWORD, ME_RESOURCE, ImportanceLevel, TrackerSet
from .attachment import Attachments, Attachment, AttachableMixin
from .windows_tz import IANA_TO_WIN, WIN_TO_IANA
| 49.6 | 132 | 0.854839 |
163e6d4910193aaae52c526d06d6ea28b1ca508b | 2,896 | py | Python | src/forms/__init__.py | nghiattran/python-parse | 3874558d5579d21cfc3a87c6f0ec0c368682f086 | [
"MIT"
] | 6 | 2015-12-05T08:00:55.000Z | 2017-04-04T12:14:51.000Z | src/forms/__init__.py | nghiattran/python-parse | 3874558d5579d21cfc3a87c6f0ec0c368682f086 | [
"MIT"
] | 2 | 2015-11-29T22:39:01.000Z | 2015-11-30T04:27:43.000Z | src/forms/__init__.py | nghiattran/python-parse | 3874558d5579d21cfc3a87c6f0ec0c368682f086 | [
"MIT"
] | null | null | null | # @name <%= app_name %>
# @description
# Utility functions for all Forms.
import json
from wtforms import\
Form,\
HiddenField,\
IntegerField,\
validators,\
BooleanField,\
StringField
from werkzeug.datastructures import\
MultiDict
from werkzeug.exceptions import\
BadRequest
from wtforms.... | 26.814815 | 78 | 0.618094 |
ffd5e5fba703cbdd379f7789d0977deec9164e39 | 9,648 | py | Python | tests/basic_deployment.py | guoqiao/charm-glance-simplestreams-sync | 77fab981420f49cd399ec89c4db4e9a506d395ad | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tests/basic_deployment.py | guoqiao/charm-glance-simplestreams-sync | 77fab981420f49cd399ec89c4db4e9a506d395ad | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tests/basic_deployment.py | guoqiao/charm-glance-simplestreams-sync | 77fab981420f49cd399ec89c4db4e9a506d395ad | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2016 Canonical 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... | 36.545455 | 78 | 0.598673 |
167936326ef67b14a0eb42d4ff2e456f6adba044 | 1,449 | py | Python | Gem/PythonTests/Automated/test_suites/periodic/MaterialEditorExitFromFileMenu_test.py | incisor/o3de-atomtest | 026fef06827bf0dd559510882df5cb426ab00a99 | [
"Apache-2.0",
"MIT"
] | 2 | 2021-07-18T11:20:41.000Z | 2022-02-01T20:17:50.000Z | Gem/PythonTests/Automated/test_suites/periodic/MaterialEditorExitFromFileMenu_test.py | incisor/o3de-atomtest | 026fef06827bf0dd559510882df5cb426ab00a99 | [
"Apache-2.0",
"MIT"
] | 5 | 2021-07-14T02:24:07.000Z | 2021-10-04T21:24:35.000Z | Gem/PythonTests/Automated/test_suites/periodic/MaterialEditorExitFromFileMenu_test.py | incisor/o3de-atomtest | 026fef06827bf0dd559510882df5cb426ab00a99 | [
"Apache-2.0",
"MIT"
] | 7 | 2021-07-06T18:21:14.000Z | 2021-12-06T09:12:40.000Z | """
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import os
import pytest
from Automated.atom_utils import hydra_test_utils as hydra
TEST_DIRECTORY = os.path.d... | 37.153846 | 111 | 0.704624 |
31cb053e2e1006e94fb0e418a68364af3fedf49a | 477 | py | Python | src/losses/boxes.py | jbed94/Faster-R-CNN | ebfc3ff0a84deca9672155085e57d09199023a85 | [
"MIT"
] | 5 | 2019-07-09T09:28:14.000Z | 2020-09-04T13:56:02.000Z | src/losses/boxes.py | jbed94/Faster-R-CNN | ebfc3ff0a84deca9672155085e57d09199023a85 | [
"MIT"
] | null | null | null | src/losses/boxes.py | jbed94/Faster-R-CNN | ebfc3ff0a84deca9672155085e57d09199023a85 | [
"MIT"
] | 1 | 2020-01-04T14:41:28.000Z | 2020-01-04T14:41:28.000Z | import tensorflow as tf
def adjust_bbox(boxes1, boxes2):
y1, x1, h1, w1 = tf.split(boxes1, 4, -1)
y2, x2, h2, w2 = tf.split(boxes2, 4, -1)
return tf.concat([
(y1 - y2) / h2,
(x1 - x2) / w2,
tf.math.log(tf.maximum(h1 / h2, 1e-6)),
tf.math.log(tf.maximum(w1 / w2, 1e-6))
... | 23.85 | 47 | 0.570231 |
f7e1b238edfb6a0c9a8ddac466e1e0c7a4a97ef7 | 677 | py | Python | features/target.py | teomores/Oracle_HPC_contest | f2a358ac71416c032d8bd9fcffeaa7098ddaa7b4 | [
"Apache-2.0"
] | 4 | 2020-01-22T13:42:24.000Z | 2022-03-21T15:43:59.000Z | features/target.py | russointroitoa/Oracle_HPC_contest | 6be9a097abc6d4b45f7c80e7095f536a38b13161 | [
"Apache-2.0"
] | 8 | 2020-09-25T19:19:26.000Z | 2022-02-10T02:37:32.000Z | features/target.py | russointroitoa/Oracle_HPC_contest | 6be9a097abc6d4b45f7c80e7095f536a38b13161 | [
"Apache-2.0"
] | 1 | 2020-01-30T08:27:35.000Z | 2020-01-30T08:27:35.000Z | import pandas as pd
import numpy as np
import os
def target(df_exp_train, path=""):
path_validation = os.path.join(path, "test.csv")
df_val = pd.read_csv(path_validation, escapechar="\\")
df_exp_train = df_exp_train.merge(df_val[['record_id', 'linked_id']], how='left', left_on='queried_record_id', right_on... | 39.823529 | 162 | 0.714919 |
8d613c413e5afcd8f889a9ffd100ccce7ea74362 | 8,172 | py | Python | layoutComponents/homeNavBar.py | ald3rs0n/singularity | 6a4b4dfa4324a1736d516ea57b0a61f0dba1c33b | [
"MIT"
] | null | null | null | layoutComponents/homeNavBar.py | ald3rs0n/singularity | 6a4b4dfa4324a1736d516ea57b0a61f0dba1c33b | [
"MIT"
] | null | null | null | layoutComponents/homeNavBar.py | ald3rs0n/singularity | 6a4b4dfa4324a1736d516ea57b0a61f0dba1c33b | [
"MIT"
] | null | null | null | import pandas as pd
import dash_daq as daq
from dash import html,dcc
from datetime import timedelta
from Backend.stock import Stock
import dash_bootstrap_components as dbc
from dash.exceptions import PreventUpdate
from dash.dependencies import Input,Output,State
from app import app
from Backend.analysis import doAnal... | 31.921875 | 151 | 0.469897 |
8c6b89d2ec15ae6cc4d115283fb11be0498ed8d8 | 3,689 | py | Python | tf_agents/networks/network_test.py | PeterDomanski/agents | 63c1c76f16f2068a637b26282c34a8825583e73e | [
"Apache-2.0"
] | 2 | 2020-10-29T02:21:27.000Z | 2021-07-26T07:38:23.000Z | tf_agents/networks/network_test.py | qxcv/agents | 1c4f2a0dd0abf3795a221dfc8a1771cff0e6ebb9 | [
"Apache-2.0"
] | 13 | 2019-06-18T03:36:39.000Z | 2019-08-28T18:30:29.000Z | tf_agents/networks/network_test.py | qxcv/agents | 1c4f2a0dd0abf3795a221dfc8a1771cff0e6ebb9 | [
"Apache-2.0"
] | 2 | 2019-12-12T02:50:48.000Z | 2019-12-12T15:38:31.000Z | # coding=utf-8
# Copyright 2018 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 32.078261 | 76 | 0.716183 |
e42e26c5c6c38aaec0e36e64142828bb1ddfa175 | 525 | py | Python | setup.py | Ebkarlibya/subk_addons | 69c56af62df4fbca6e391e09bd3a649bd9bb3d2a | [
"MIT"
] | null | null | null | setup.py | Ebkarlibya/subk_addons | 69c56af62df4fbca6e391e09bd3a649bd9bb3d2a | [
"MIT"
] | null | null | null | setup.py | Ebkarlibya/subk_addons | 69c56af62df4fbca6e391e09bd3a649bd9bb3d2a | [
"MIT"
] | 1 | 2021-01-23T20:15:02.000Z | 2021-01-23T20:15:02.000Z | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('requirements.txt') as f:
install_requires = f.read().strip().split('\n')
# get version from __version__ variable in subk_addons/__init__.py
from subk_addons import __version__ as version
setup(
name='subk_addons',
version=version,
des... | 25 | 66 | 0.767619 |
d93c16bff210f1ddcb4a26a472ff509d2103a273 | 4,723 | py | Python | savu/plugins/reconstructions/scikitimage_filter_back_projection.py | malte-storm/Savu | 16291e8a22464c50c511af01fbc648860c1236e6 | [
"Apache-2.0"
] | 1 | 2021-04-18T09:30:54.000Z | 2021-04-18T09:30:54.000Z | savu/plugins/reconstructions/scikitimage_filter_back_projection.py | malte-storm/Savu | 16291e8a22464c50c511af01fbc648860c1236e6 | [
"Apache-2.0"
] | 1 | 2019-07-30T12:31:51.000Z | 2019-07-30T12:31:51.000Z | savu/plugins/reconstructions/scikitimage_filter_back_projection.py | malte-storm/Savu | 16291e8a22464c50c511af01fbc648860c1236e6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Diamond Light Source 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 agreed t... | 40.715517 | 79 | 0.653822 |
736c817ad34b80216b6e6f1781ba1c98b656f0b2 | 970 | py | Python | examples/method_components.py | maniospas/pyfop | ca0b06ed3ed7a8bfcba7daa1d3247b5623655193 | [
"Apache-2.0"
] | null | null | null | examples/method_components.py | maniospas/pyfop | ca0b06ed3ed7a8bfcba7daa1d3247b5623655193 | [
"Apache-2.0"
] | null | null | null | examples/method_components.py | maniospas/pyfop | ca0b06ed3ed7a8bfcba7daa1d3247b5623655193 | [
"Apache-2.0"
] | null | null | null | from pyfop import lazy, Aspect, Priority
import numpy as np
@lazy
def tautology(x):
return x
@lazy
def normalize(x, norm=Aspect(2, Priority.LOW)):
return x / (np.sum(x**norm))**(1./norm)
@lazy
def offset(x):
return x+np.eps()
@lazy
def dot(x, y):
return np.sum(x*y)
@lazy
def KLdivergence(x, y,... | 21.086957 | 85 | 0.636082 |
b45573030b7b5607057ba4cd3d63a3b135774688 | 4,606 | py | Python | overview.py | BassThatHertz/x264-preset-comparer | 10440d113bd5681ff91b682c6c353051b09cb748 | [
"MIT"
] | 24 | 2021-02-12T10:31:31.000Z | 2022-03-22T17:11:02.000Z | overview.py | BassThatHertz/x264-preset-comparer | 10440d113bd5681ff91b682c6c353051b09cb748 | [
"MIT"
] | 8 | 2021-02-07T23:55:45.000Z | 2022-03-25T12:41:30.000Z | overview.py | BassThatHertz/x264-preset-comparer | 10440d113bd5681ff91b682c6c353051b09cb748 | [
"MIT"
] | 3 | 2021-10-08T16:19:38.000Z | 2022-03-29T04:17:33.000Z | import math
import os
from pathlib import Path
import shutil
import subprocess
import time
from utils import VideoInfoProvider, line, exit_program, Logger
log = Logger("overview")
class ClipError(Exception):
pass
class ConcatenateError(Exception):
pass
def step_to_movie_timestamp(ste... | 30.302632 | 104 | 0.589449 |
7071b2e574bbc6470059f76883983c2dc71edbac | 13,209 | py | Python | ansible/library/pn_ztp_vrrp_l2_csv_json.py | gaurav-calsoft/pluribus-ansible | 510f37e2d55d7b65a634440d99b582d3df42bd8a | [
"Apache-2.0"
] | null | null | null | ansible/library/pn_ztp_vrrp_l2_csv_json.py | gaurav-calsoft/pluribus-ansible | 510f37e2d55d7b65a634440d99b582d3df42bd8a | [
"Apache-2.0"
] | null | null | null | ansible/library/pn_ztp_vrrp_l2_csv_json.py | gaurav-calsoft/pluribus-ansible | 510f37e2d55d7b65a634440d99b582d3df42bd8a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
""" PN CLI VRRP L2 """
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | 33.27204 | 103 | 0.628511 |
2440418d528815c555709968e1975b069f0af545 | 4,266 | py | Python | app/src/train.py | dtcrout/yt-title-generator | 62e922b6fdf99f455e8c90c19ee1eba112d55efe | [
"MIT"
] | 6 | 2019-07-25T04:50:24.000Z | 2021-11-15T11:13:47.000Z | app/src/train.py | dtcrout/yt-title-generator | 62e922b6fdf99f455e8c90c19ee1eba112d55efe | [
"MIT"
] | 1 | 2019-05-10T14:03:09.000Z | 2019-05-10T14:03:09.000Z | app/src/train.py | dtcrout/yt-title-generator | 62e922b6fdf99f455e8c90c19ee1eba112d55efe | [
"MIT"
] | 1 | 2019-05-11T08:59:23.000Z | 2019-05-11T08:59:23.000Z | """Train a caption model.
This script trains the captioning model.
Code is adapted from:
https://machinelearningmastery.com/develop-a-deep-learning-caption-generation-model-in-python/
"""
from keras.callbacks import ModelCheckpoint
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence impo... | 27 | 94 | 0.658697 |
dcd3df17b5daac8f9432d857fcac35310c614f9b | 3,599 | py | Python | subcmds/manifest.py | muzili/repo | e7a3bcbbb8083e812ce07a5459f0e6d30edfb9fe | [
"Apache-2.0"
] | 1 | 2016-02-15T07:46:54.000Z | 2016-02-15T07:46:54.000Z | subcmds/manifest.py | muzili/repo | e7a3bcbbb8083e812ce07a5459f0e6d30edfb9fe | [
"Apache-2.0"
] | null | null | null | subcmds/manifest.py | muzili/repo | e7a3bcbbb8083e812ce07a5459f0e6d30edfb9fe | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) 2009 The Android Open Source Project
#
# 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... | 29.743802 | 74 | 0.653793 |
ed46554d8dac42973c8b76c4a4da7631022e72cb | 403 | py | Python | Voltron/unit_tests/test_Algorithms_peak_finding.py | ernestyalumni/HrdwCCppCUDA | 17ed937dea06431a4d5ca103f993ea69a6918734 | [
"MIT"
] | 1 | 2018-02-09T19:44:51.000Z | 2018-02-09T19:44:51.000Z | Voltron/unit_tests/test_Algorithms_peak_finding.py | ernestyalumni/HrdwCCppCUDA | 17ed937dea06431a4d5ca103f993ea69a6918734 | [
"MIT"
] | null | null | null | Voltron/unit_tests/test_Algorithms_peak_finding.py | ernestyalumni/HrdwCCppCUDA | 17ed937dea06431a4d5ca103f993ea69a6918734 | [
"MIT"
] | null | null | null | """
@file test_Algorithms_peak_finding.py
"""
from Voltron.Algorithms import peak_finding
from Voltron.Algorithms.peak_finding import straightforward_search_1d
import pytest
@pytest.fixture
def example_1d_values():
class Example1dValues:
a = [6, 7]
return Example1dValues()
def test_straightforwa... | 19.190476 | 69 | 0.779156 |
c4fde9bc1aa43a3f41f7b69c362f6a7c5b42d3e3 | 4,162 | py | Python | tests/tree_util_tests.py | SiegeLordEx/jax | 36539f1ff10da318d06506efe347f95558f4ac0e | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2021-06-13T20:51:49.000Z | 2021-06-14T02:37:06.000Z | tests/tree_util_tests.py | SiegeLordEx/jax | 36539f1ff10da318d06506efe347f95558f4ac0e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tests/tree_util_tests.py | SiegeLordEx/jax | 36539f1ff10da318d06506efe347f95558f4ac0e | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-03-14T10:07:22.000Z | 2019-03-14T10:07:22.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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 31.293233 | 74 | 0.645843 |
1f81c8f8ef06d72982124531e97e841175fec460 | 243 | py | Python | month05/Spider/test.py | chaofan-zheng/python_learning_code | 5d05848911d55aa49eaee4afd7ffd80536fad7aa | [
"Apache-2.0"
] | null | null | null | month05/Spider/test.py | chaofan-zheng/python_learning_code | 5d05848911d55aa49eaee4afd7ffd80536fad7aa | [
"Apache-2.0"
] | null | null | null | month05/Spider/test.py | chaofan-zheng/python_learning_code | 5d05848911d55aa49eaee4afd7ffd80536fad7aa | [
"Apache-2.0"
] | null | null | null | from urllib.parse import urlencode
base_url = 'https://search.1688.com/service/marketOfferResultViewService'
params2 = {
'keywords': '女装',}
url2 = base_url + urlencode(params2,encoding='gbk')
print(url2)
print('女装'.encode(encoding='gbk'))
| 30.375 | 73 | 0.740741 |
91538492d67e02520ec58f09bdb6ec9d063e738e | 1,342 | py | Python | counterfit/frameworks/art/ZooAttack.py | Mandroide/counterfit | 3252588d45514192edd4444b3bff0bf006f92bf0 | [
"MIT"
] | null | null | null | counterfit/frameworks/art/ZooAttack.py | Mandroide/counterfit | 3252588d45514192edd4444b3bff0bf006f92bf0 | [
"MIT"
] | null | null | null | counterfit/frameworks/art/ZooAttack.py | Mandroide/counterfit | 3252588d45514192edd4444b3bff0bf006f92bf0 | [
"MIT"
] | null | null | null | from art.attacks.evasion import ZooAttack
from hyperopt import hp
from counterfit.core.attacks import Attack
class ZooAttackWrapper(Attack):
attack_cls = ZooAttack
attack_name = "zoo"
attack_type = "evasion"
tags = ["image", "numpy"]
category = "blackbox"
framework = "art"
random = {
... | 31.209302 | 69 | 0.577496 |
095df7dea9b34192e8612410ab152cc2c5381139 | 356 | py | Python | fum/migrations/0007_remove_users_planmill_apikey.py | jsavikko/futurice-ldap-user-manager | a7cbb6037360023ef14ea19cf73715160c71de1d | [
"BSD-3-Clause"
] | 111 | 2015-01-27T22:02:35.000Z | 2021-05-06T07:57:56.000Z | fum/migrations/0007_remove_users_planmill_apikey.py | jsavikko/futurice-ldap-user-manager | a7cbb6037360023ef14ea19cf73715160c71de1d | [
"BSD-3-Clause"
] | 23 | 2015-01-09T12:30:54.000Z | 2022-01-13T00:43:13.000Z | fum/migrations/0007_remove_users_planmill_apikey.py | jsavikko/futurice-ldap-user-manager | a7cbb6037360023ef14ea19cf73715160c71de1d | [
"BSD-3-Clause"
] | 17 | 2015-08-06T20:05:36.000Z | 2020-08-24T18:56:10.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('fum', '0006_auto_20151210_1152'),
]
operations = [
migrations.RemoveField(
model_name='users',
name=... | 18.736842 | 43 | 0.606742 |
412946dc0a0c7ea1a5da1a0cd488f5c78808b7c9 | 5,456 | py | Python | TF/Utils.py | luozm/Deep-Learning-for-HSI-classification | d15760f5409c494dc013f59f204f58a7ccccec44 | [
"MIT"
] | 9 | 2018-04-09T21:06:37.000Z | 2020-05-06T04:02:13.000Z | Utils.py | luozm/Deep-Learning-for-HSI-classification | d15760f5409c494dc013f59f204f58a7ccccec44 | [
"MIT"
] | 1 | 2017-09-18T02:24:40.000Z | 2018-07-03T06:05:03.000Z | Utils.py | luozm/Deep-Learning-for-HSI-classification | d15760f5409c494dc013f59f204f58a7ccccec44 | [
"MIT"
] | 4 | 2018-08-01T03:45:17.000Z | 2019-10-25T23:49:34.000Z | """Definitions and global settings.
Any changes only need to be done here.
-- File settings
-- Pre-processing settings
-- Model settings
Functions for handling the Hyperspectral data.
-- class DataSet
-- def read_data_sets
@Author: lzm
"""
import tensorflow as tf
import numpy as np
import h5py
import os
# File sett... | 26.745098 | 105 | 0.639846 |
519c42cd97afb7ba1d3ddfcd1bca608f551281ef | 3,791 | py | Python | gcloud/tests/analysis_statistics/data_migrate/tasks/test_migrate_component.py | brookylin/bk-sops | 6c0cf78879849921c4ff6ad6bf3bb82dfdf5b973 | [
"Apache-2.0"
] | 881 | 2019-03-25T02:45:42.000Z | 2022-03-30T09:10:49.000Z | gcloud/tests/analysis_statistics/data_migrate/tasks/test_migrate_component.py | m0re-work/bk-sops | d03ba8a4ee0781c6daaf0dd38a7369dc82669f7d | [
"Apache-2.0"
] | 3,303 | 2019-03-25T04:18:03.000Z | 2022-03-31T11:52:03.000Z | gcloud/tests/analysis_statistics/data_migrate/tasks/test_migrate_component.py | m0re-work/bk-sops | d03ba8a4ee0781c6daaf0dd38a7369dc82669f7d | [
"Apache-2.0"
] | 395 | 2019-03-25T02:53:36.000Z | 2022-03-31T08:37:28.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 44.081395 | 115 | 0.731997 |
c33fd8ea4bf45c5e6df59f3b14ec00e0adf37721 | 1,348 | py | Python | scrap/meanValues.py | pihvi/edutime | c8f16e96b1c8b199dd1146c203084898040222b9 | [
"MIT"
] | null | null | null | scrap/meanValues.py | pihvi/edutime | c8f16e96b1c8b199dd1146c203084898040222b9 | [
"MIT"
] | null | null | null | scrap/meanValues.py | pihvi/edutime | c8f16e96b1c8b199dd1146c203084898040222b9 | [
"MIT"
] | null | null | null | import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
from pandas.plotting import scatter_matrix
df = pd.read_csv('./data/sigite2014-difficulty-data.csv', sep=';')
spentViikko01 = df.filter(regex='SECONDS_SPENT_ON_viikko01_*')
spentViikko01.mean()
print(spentViikko01.mean())
spentViikko01.me... | 27.510204 | 67 | 0.759644 |
b94154f6fed6bcd8457e33e001c8448c77225ccb | 11,756 | py | Python | python2/runner/runner_tests/test_sensei.py | Jgoodz/python_koans | 5669fb398f18a7e645938c51c03f03147695da83 | [
"MIT"
] | null | null | null | python2/runner/runner_tests/test_sensei.py | Jgoodz/python_koans | 5669fb398f18a7e645938c51c03f03147695da83 | [
"MIT"
] | null | null | null | python2/runner/runner_tests/test_sensei.py | Jgoodz/python_koans | 5669fb398f18a7e645938c51c03f03147695da83 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import re
from libs.mock import *
from runner.sensei import Sensei
from runner.writeln_decorator import WritelnDecorator
from runner.mockable_test_result import MockableTestResult
class AboutParrots:
pass
class AboutLumberjacks:
pa... | 41.394366 | 100 | 0.687649 |
0435a2f9bcb69df60cdac49b8d7c087ce30d40cf | 187 | py | Python | project-euler/completed/euler4.py | davidxmoody/kata | d88569584c2390da0e8127258d8751f8a47b7d83 | [
"MIT"
] | null | null | null | project-euler/completed/euler4.py | davidxmoody/kata | d88569584c2390da0e8127258d8751f8a47b7d83 | [
"MIT"
] | null | null | null | project-euler/completed/euler4.py | davidxmoody/kata | d88569584c2390da0e8127258d8751f8a47b7d83 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from itertools import combinations_with_replacement
print(max([x*y for x, y in combinations_with_replacement(range(999, 0, -1), 2) if str(x*y)==str(x*y)[::-1]]))
| 31.166667 | 109 | 0.716578 |
7f7aa1079e1ca5e622654ee1c8e40d8e0d13bc88 | 3,749 | py | Python | notifier.py | tack41/programs-python-utilities | 6fd6d9de456f2758d74e8335d1c7a6d792215031 | [
"MIT"
] | null | null | null | notifier.py | tack41/programs-python-utilities | 6fd6d9de456f2758d74e8335d1c7a6d792215031 | [
"MIT"
] | null | null | null | notifier.py | tack41/programs-python-utilities | 6fd6d9de456f2758d74e8335d1c7a6d792215031 | [
"MIT"
] | null | null | null | import pathlib
import json
import urllib
import urllib.request
import smtplib
from email.mime.text import MIMEText
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
class Notifier:
__MAIL_SUBJECT_MAX_LENGTH = 100
__use_slack_webhook = False
__slack_webhook_url = ... | 35.367925 | 163 | 0.722593 |
89f1bb764b4cda9962994f95daaf3bd4c530f34b | 1,609 | py | Python | titanic/ml_random_forest.py | Limarceu/kaggle | 4aab174cbc86b14661f3e3f90c0f350d9c5932af | [
"MIT"
] | null | null | null | titanic/ml_random_forest.py | Limarceu/kaggle | 4aab174cbc86b14661f3e3f90c0f350d9c5932af | [
"MIT"
] | null | null | null | titanic/ml_random_forest.py | Limarceu/kaggle | 4aab174cbc86b14661f3e3f90c0f350d9c5932af | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from sklearn.ensemble import RandomForestClassifier as rfc
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
import seaborn as sns
#reading the dataset
train = pd.read_csv('./dataset/train.csv')
test = pd.read_csv('./dataset/test.csv'... | 27.271186 | 135 | 0.723431 |
b16c1fc84c1eb249286b5b30d51f05b3bc864e50 | 2,642 | py | Python | agendas/urls.py | navotsil/Open-Knesset | d6cc6457f87e67a3dbeaec9c1ccbc8d8b7c60c04 | [
"BSD-3-Clause"
] | 7 | 2015-03-05T11:14:23.000Z | 2017-02-11T18:06:25.000Z | agendas/urls.py | navotsil/Open-Knesset | d6cc6457f87e67a3dbeaec9c1ccbc8d8b7c60c04 | [
"BSD-3-Clause"
] | 7 | 2020-02-12T01:09:15.000Z | 2022-03-11T23:25:12.000Z | agendas/urls.py | navotsil/Open-Knesset | d6cc6457f87e67a3dbeaec9c1ccbc8d8b7c60c04 | [
"BSD-3-Clause"
] | 11 | 2015-02-21T09:45:06.000Z | 2021-05-05T06:01:24.000Z | #encoding: UTF-8
from django.conf.urls import url, patterns, include
from django.utils.translation import ugettext
from django.views.generic.base import TemplateView
from models import Agenda
from views import AgendaListView
from views import AgendaDetailView
from views import AgendaMkDetailView
from views import Agen... | 55.041667 | 136 | 0.689251 |
3602f48bffa2a9e5bb9c521f825ea596f78ad81a | 10,077 | py | Python | mstools/simulator/dff/dff.py | Xiangyan93/mstools | 7143dbfc2eb4e82e6631652a0c1b38a793dcc678 | [
"MIT"
] | 3 | 2021-05-14T04:27:53.000Z | 2022-01-11T17:47:20.000Z | aims/aimstools/simulator/dff/dff.py | Xiangyan93/AIMS | 1d0d6de03ef79d3cbfe2cd244f12c41d18acb61d | [
"MIT"
] | null | null | null | aims/aimstools/simulator/dff/dff.py | Xiangyan93/AIMS | 1d0d6de03ef79d3cbfe2cd244f12c41d18acb61d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
CWD = os.path.dirname(os.path.abspath(__file__))
import subprocess
import sys
from subprocess import PIPE, Popen
from ...utils import random_string
class DffError(Exception):
pass
class DFF:
TEMPLATE_DIR = os.path.join(CWD, 'template')
'''
wra... | 44.986607 | 114 | 0.578049 |
30546d68e843521201c89cce464cc9c8df8e1149 | 8,475 | py | Python | tao_detection_release/mmdet/models/backbones/resnext_rs.py | michael-camilleri/AQA | d0896569c748bc74e01f4ad0bc21cebe58b76cac | [
"Apache-2.0"
] | 73 | 2021-02-01T11:33:51.000Z | 2021-11-15T11:46:55.000Z | tao_detection_release/mmdet/models/backbones/resnext_rs.py | michael-camilleri/AQA | d0896569c748bc74e01f4ad0bc21cebe58b76cac | [
"Apache-2.0"
] | 3 | 2021-03-16T11:35:35.000Z | 2021-07-09T06:07:25.000Z | tao_detection_release/mmdet/models/backbones/resnext_rs.py | michael-camilleri/AQA | d0896569c748bc74e01f4ad0bc21cebe58b76cac | [
"Apache-2.0"
] | 4 | 2021-02-01T16:16:37.000Z | 2021-07-28T05:38:50.000Z | import math
import torch
import torch.nn as nn
from mmdet.ops import build_conv_layer, build_norm_layer
from ..registry import BACKBONES
from .resnet import Bottleneck as _Bottleneck
from .resnet import ResNet
from mmdet.ops import DeformConv, ModulatedDeformConv
from ..registry import BACKBONES
from ..utils import ... | 33.76494 | 79 | 0.535811 |
7dc7886fa79568e5990c20e42e0b994b1c1cd39b | 1,102 | py | Python | dataspace/charts/base.py | Sam-prog-sudo/dataspace | 2bab85c4dfa713deb835a46e9214c43a3a674082 | [
"MIT"
] | 3 | 2021-06-28T09:45:51.000Z | 2022-01-10T15:38:07.000Z | dataspace/charts/base.py | Sam-prog-sudo/dataspace | 2bab85c4dfa713deb835a46e9214c43a3a674082 | [
"MIT"
] | null | null | null | dataspace/charts/base.py | Sam-prog-sudo/dataspace | 2bab85c4dfa713deb835a46e9214c43a3a674082 | [
"MIT"
] | 1 | 2021-07-01T08:50:32.000Z | 2021-07-01T08:50:32.000Z | import pandas as pd
from altair import Chart
from .altair import AltairChart
from .bokeh import BokehChart
class DsChart:
engine = "bokeh"
default_width = 950
altair: AltairChart = None
bokeh: BokehChart = None
def set_axis(self, x_axis_col: str, y_axis_col: str):
self._check_engine()
... | 32.411765 | 63 | 0.624319 |
68c601dbd586ffda4c8e0a364e8bf22cf0a8b678 | 17,888 | py | Python | cripts/objects/views.py | lakiw/cripts | 43f62891a3724e1ec60629887d97c421fb302163 | [
"MIT"
] | 2 | 2017-04-06T12:26:11.000Z | 2018-11-05T19:17:15.000Z | cripts/objects/views.py | lakiw/cripts | 43f62891a3724e1ec60629887d97c421fb302163 | [
"MIT"
] | 9 | 2016-09-28T10:19:10.000Z | 2017-02-24T17:58:43.000Z | cripts/objects/views.py | lakiw/cripts | 43f62891a3724e1ec60629887d97c421fb302163 | [
"MIT"
] | null | null | null | import json
from django.contrib.auth.decorators import user_passes_test
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template.loader import render_to_string
from django.template import RequestContext
from cripts.core.form_consts import get_source_field_for_class
fro... | 41.892272 | 118 | 0.517554 |
92118aac9f83bbfabb3c81d4f36459df2ecf328c | 6,000 | py | Python | auditing/db/__init__.py | fumamatar/laf | e81b89aa6697234c7a905230bbfd8eb5f02d5d45 | [
"BSD-3-Clause"
] | null | null | null | auditing/db/__init__.py | fumamatar/laf | e81b89aa6697234c7a905230bbfd8eb5f02d5d45 | [
"BSD-3-Clause"
] | null | null | null | auditing/db/__init__.py | fumamatar/laf | e81b89aa6697234c7a905230bbfd8eb5f02d5d45 | [
"BSD-3-Clause"
] | null | null | null | from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
import os
# ---> Comment these lines
if "ENVIRONMENT" not in os.environ:
DB_HOST = "localhost"
DB_NAME = "loraguard_db"
DB_USERNAME = "postgres"
DB_PASSWORD = "postgres" ... | 93.75 | 1,028 | 0.748 |
dc076f27ca8476d13da524f54a5dc4cf8bb2bc87 | 346 | py | Python | tests/integration/test_ping.py | abdulfahad66/result-service-gui | 214342dd6d00f1173bfe90f8429c7d6c9947783b | [
"Apache-2.0"
] | 2 | 2022-01-19T10:32:50.000Z | 2022-02-25T16:04:10.000Z | tests/integration/test_ping.py | abdulfahad66/result-service-gui | 214342dd6d00f1173bfe90f8429c7d6c9947783b | [
"Apache-2.0"
] | 76 | 2021-07-28T22:36:16.000Z | 2022-03-23T22:52:54.000Z | tests/integration/test_ping.py | langrenn-sprint/sprint-webserver | 065a96d102a6658e5422ea6a0be5abde4b6558e1 | [
"Apache-2.0"
] | null | null | null | """Integration test cases for the ping route."""
from aiohttp.test_utils import TestClient as _TestClient
import pytest
@pytest.mark.integration
async def test_ready(client: _TestClient) -> None:
"""Should return OK."""
resp = await client.get("/ping")
assert resp.status == 200
text = await resp.text(... | 26.615385 | 56 | 0.702312 |
d4a47163777c2524fac6a1641b3409f9a3da688e | 1,355 | py | Python | pypy/module/_file/__init__.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | 1 | 2019-05-27T00:58:46.000Z | 2019-05-27T00:58:46.000Z | pypy/module/_file/__init__.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null | pypy/module/_file/__init__.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null |
# Package initialisation
from pypy.interpreter.mixedmodule import MixedModule
import sys
class Module(MixedModule):
appleveldefs = {
}
interpleveldefs = {
"file": "interp_file.W_File",
}
def __init__(self, space, *args):
"NOT_RPYTHON"
# on windows with oo backends, remov... | 31.511628 | 68 | 0.624354 |
3bb0bb91ba61e280d6de4620bee99d184e719283 | 8,085 | py | Python | tensorflow/api_template.__init__.py | huzq85/tensorflow-fork | 92f1dd09bef516a6eb0ad6be6833f28785ef2be8 | [
"Apache-2.0"
] | null | null | null | tensorflow/api_template.__init__.py | huzq85/tensorflow-fork | 92f1dd09bef516a6eb0ad6be6833f28785ef2be8 | [
"Apache-2.0"
] | null | null | null | tensorflow/api_template.__init__.py | huzq85/tensorflow-fork | 92f1dd09bef516a6eb0ad6be6833f28785ef2be8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 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 applica... | 38.136792 | 159 | 0.768707 |
ddc2d652c1f83c013ebd7f385707fbc8dd29eb85 | 1,819 | py | Python | grr/server/grr_response_server/gui/api_plugins/report_plugins/rdf_report_plugins.py | khanhgithead/grr | 8ad8a4d2c5a93c92729206b7771af19d92d4f915 | [
"Apache-2.0"
] | 4,238 | 2015-01-01T15:34:50.000Z | 2022-03-31T08:18:05.000Z | grr/server/grr_response_server/gui/api_plugins/report_plugins/rdf_report_plugins.py | khanhgithead/grr | 8ad8a4d2c5a93c92729206b7771af19d92d4f915 | [
"Apache-2.0"
] | 787 | 2015-01-02T21:34:24.000Z | 2022-03-02T13:26:38.000Z | grr/server/grr_response_server/gui/api_plugins/report_plugins/rdf_report_plugins.py | khanhgithead/grr | 8ad8a4d2c5a93c92729206b7771af19d92d4f915 | [
"Apache-2.0"
] | 856 | 2015-01-02T02:50:11.000Z | 2022-03-31T11:11:53.000Z | #!/usr/bin/env python
"""UI reports related rdfvalues."""
from grr_response_core.lib.rdfvalues import events as rdf_events
from grr_response_core.lib.rdfvalues import structs as rdf_structs
from grr_response_proto.api import stats_pb2
class ApiReportDescriptor(rdf_structs.RDFProtoStruct):
protobuf = stats_pb2.ApiR... | 23.623377 | 66 | 0.791644 |
e0a5aee688a6ace0c6fbbeb9da7365b9d6525c44 | 3,990 | py | Python | organization.py | joeyw526/Personal | 52849526810f9b11947aeabafe56ecabbc68f04f | [
"MIT"
] | null | null | null | organization.py | joeyw526/Personal | 52849526810f9b11947aeabafe56ecabbc68f04f | [
"MIT"
] | null | null | null | organization.py | joeyw526/Personal | 52849526810f9b11947aeabafe56ecabbc68f04f | [
"MIT"
] | null | null | null | from sqlalchemy import *
from sqlalchemy import exc
from db import Base, Session
from datetime import datetime, date
from flask import json
from event import Event
from user import User
from orgmember import OrgMember
import organization
from werkzeug.security import generate_password_hash, check_password_hash
class O... | 31.417323 | 89 | 0.592982 |
ace595e0863f1732318c175a80e0fb6ef8c52800 | 15,769 | py | Python | Section4/Designer_code/Video7_9_SQL_object_names_Design.py | Tom-Niesytto/Hands-On-Python-3.x-GUI-Programming | e84de864f6b5d02012e2a50b88ea041a1977a87d | [
"MIT"
] | 10 | 2019-03-24T12:09:49.000Z | 2021-10-01T22:06:02.000Z | Section4/Designer_code/Video7_9_SQL_object_names_Design.py | Tom-Niesytto/Hands-On-Python-3.x-GUI-Programming | e84de864f6b5d02012e2a50b88ea041a1977a87d | [
"MIT"
] | null | null | null | Section4/Designer_code/Video7_9_SQL_object_names_Design.py | Tom-Niesytto/Hands-On-Python-3.x-GUI-Programming | e84de864f6b5d02012e2a50b88ea041a1977a87d | [
"MIT"
] | 4 | 2019-03-24T12:09:52.000Z | 2020-05-26T10:37:55.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Video6_9_SQL_final_object_names_Design.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self... | 60.65 | 241 | 0.728328 |
1f3a9566412e5bd38305a51b0f5da2113294b5ff | 2,696 | py | Python | src/relation_extraction_json.py | Stochastic-Adventure/ClinicalTransformerRelationExtraction | eef956bbfbd64b008014ef7cac5f818087816725 | [
"MIT"
] | 78 | 2021-04-14T17:13:20.000Z | 2022-03-26T11:05:54.000Z | src/relation_extraction_json.py | douxiaotian/ClinicalTransformerRelationExtraction | cd7d6f605c4c16a5c5da22046b0a472fe49c4162 | [
"MIT"
] | 11 | 2020-12-04T02:34:58.000Z | 2022-01-17T02:59:00.000Z | src/relation_extraction_json.py | douxiaotian/ClinicalTransformerRelationExtraction | cd7d6f605c4c16a5c5da22046b0a472fe49c4162 | [
"MIT"
] | 17 | 2021-07-22T16:59:20.000Z | 2022-03-27T10:49:21.000Z | import argparse
import json
import torch
from utils import TransformerLogger
from relation_extraction import app as main_app
class Args:
"""
used to hold all parameters
actual parameters for experiments will be loaded from the user defined json config file
"""
def __init__(self, **kwargs):... | 30.636364 | 103 | 0.643546 |
a00db984c1fb208b16211eb71e0f7fb4f6b73e0f | 1,350 | py | Python | gpkit/docs/source/examples/boundschecking.py | UCLA-StarAI/LearnFairNB | f922d885399955737bd9f16a104f700004cd3846 | [
"Fair"
] | 3 | 2019-07-07T17:29:49.000Z | 2021-03-20T18:52:28.000Z | docs/source/examples/boundschecking.py | sichu366/gpkit | a8999737980ba45682e6e00770cf4546ca5337af | [
"MIT"
] | 1 | 2019-11-23T22:26:05.000Z | 2019-11-23T22:26:05.000Z | gpkit/docs/source/examples/boundschecking.py | UCLA-StarAI/LearnFairNB | f922d885399955737bd9f16a104f700004cd3846 | [
"Fair"
] | null | null | null | "verifies that bounds are caught through monomials"
from gpkit import Model, parse_variables
class BoundsChecking(Model):
"""Implements a crazy set of unbounded variables.
Variables
---------
Ap [-] d
D [-] e
F [-] s
mi [-] c
mf [-] ... | 22.881356 | 76 | 0.420741 |
33ee7eb52cf69510e6d4910aefff124bd500187f | 2,040 | py | Python | test/command_line.py | egemenzeytinci/readmrz | 4c99a874e14f90f1ae8ba57a6f4f52a4560b125c | [
"MIT"
] | null | null | null | test/command_line.py | egemenzeytinci/readmrz | 4c99a874e14f90f1ae8ba57a6f4f52a4560b125c | [
"MIT"
] | null | null | null | test/command_line.py | egemenzeytinci/readmrz | 4c99a874e14f90f1ae8ba57a6f4f52a4560b125c | [
"MIT"
] | null | null | null | import json
import subprocess
from pathlib import Path
from unittest import TestCase
class CommandLineTest(TestCase):
BASE = 'https://raw.githubusercontent.com/egemenzeytinci'
VALID_URL = f'{BASE}/readmrz/master/images/example.jpg'
def test_valid_file(self):
cd = Path('.')
# get base pro... | 29.142857 | 79 | 0.529412 |
9e55c2dcaf7a0a644973122a9e0381a4e2f1b9d3 | 2,322 | py | Python | acs/acs/Device/DeviceProperties.py | wangji1/test-framework-and-suites-for-android | 59564f826f205fe7fab64f45b88b1a6dde6900af | [
"Apache-2.0"
] | null | null | null | acs/acs/Device/DeviceProperties.py | wangji1/test-framework-and-suites-for-android | 59564f826f205fe7fab64f45b88b1a6dde6900af | [
"Apache-2.0"
] | null | null | null | acs/acs/Device/DeviceProperties.py | wangji1/test-framework-and-suites-for-android | 59564f826f205fe7fab64f45b88b1a6dde6900af | [
"Apache-2.0"
] | null | null | null | """
:copyright: (c)Copyright 2014, Intel Corporation All Rights Reserved.
The source code contained or described here in and all documents related
to the source code ("Material") are owned by Intel Corporation or its
suppliers or licensors. Title to the Material remains with Intel Corporation
or its suppliers and licen... | 42.218182 | 99 | 0.761843 |
14e2ce4be63c9004ae740a437ad511f8635162fd | 157 | py | Python | Python/Check Subset/soln.py | TechnoCubes/HackerRank-solutions-1 | a58d5c909a2ad29c9d5a638a3f0571b50fe7322a | [
"MIT"
] | 23 | 2019-02-14T09:11:51.000Z | 2022-01-10T19:32:12.000Z | Python/Check Subset/soln.py | TechnoCubes/HackerRank-solutions-1 | a58d5c909a2ad29c9d5a638a3f0571b50fe7322a | [
"MIT"
] | null | null | null | Python/Check Subset/soln.py | TechnoCubes/HackerRank-solutions-1 | a58d5c909a2ad29c9d5a638a3f0571b50fe7322a | [
"MIT"
] | 23 | 2018-11-05T11:15:39.000Z | 2022-01-09T20:49:10.000Z | for i in range(int(input())):
_, a = input(), set(map(int, input().split()))
_, b = input(), set(map(int, input().split()))
print(a.issubset(b))
| 31.4 | 50 | 0.547771 |
90652d848ab9f50b10259f63b808dd79d1a13365 | 368 | py | Python | chapter06/chapter6/bugzot/bugzot/__init__.py | PacktPublishing/Hands-On-Enterprise-Application-Development-with-Python | 4802509ff92982a53006b8f327e010cda791f911 | [
"MIT"
] | 27 | 2018-12-07T14:31:10.000Z | 2021-11-08T13:12:46.000Z | chapter06/chapter6/bugzot/bugzot/__init__.py | MindaugasVaitkus2/Hands-On-Enterprise-Application-Development-with-Python | dc51e134ba2fd1d2ad91f8253f40995f161ecbd8 | [
"MIT"
] | 1 | 2020-07-16T14:28:49.000Z | 2020-07-21T12:43:43.000Z | chapter06/chapter6/bugzot/bugzot/__init__.py | MindaugasVaitkus2/Hands-On-Enterprise-Application-Development-with-Python | dc51e134ba2fd1d2ad91f8253f40995f161ecbd8 | [
"MIT"
] | 23 | 2018-08-22T18:34:47.000Z | 2021-09-02T09:57:27.000Z | '''
File: __init__.py
Description: Bugzot application entrypoint file.
'''
from .application import app, bcrypt, db
from bugzot.models import ActivationKey, Category, Component, Product, Role, User, Version
from bugzot.views import IndexView
# Define the routes
app.add_url_rule('/', view_func=IndexView.as_view('index_... | 26.285714 | 90 | 0.779891 |
4bc1c6ee42587f4df0e6640bfe0773cb550719d1 | 4,275 | py | Python | src/sample.py | paopaoputao/gpt-2 | a82fa075053b173be9c31372f680941a5796e6d2 | [
"MIT"
] | null | null | null | src/sample.py | paopaoputao/gpt-2 | a82fa075053b173be9c31372f680941a5796e6d2 | [
"MIT"
] | null | null | null | src/sample.py | paopaoputao/gpt-2 | a82fa075053b173be9c31372f680941a5796e6d2 | [
"MIT"
] | null | null | null | import tensorflow as tf
import model
def top_k_logits(logits, k):
if k == 0:
# no truncation
return logits
def _top_k():
values, _ = tf.nn.top_k(logits, k=k)
min_values = values[:, -1, tf.newaxis]
return tf.where(
logits < min_values,
tf.ones_li... | 35.040984 | 122 | 0.597661 |
a8c9234a0cc2b97ddac308d4ad3f77b38a9a35c4 | 39,254 | py | Python | bilibili/app/archive/v1/archive_pb2.py | Privoce/all-in-danmaku-server | b13bd3dae26d65540b7cf5c3d8ef3569111d1676 | [
"MIT"
] | null | null | null | bilibili/app/archive/v1/archive_pb2.py | Privoce/all-in-danmaku-server | b13bd3dae26d65540b7cf5c3d8ef3569111d1676 | [
"MIT"
] | null | null | null | bilibili/app/archive/v1/archive_pb2.py | Privoce/all-in-danmaku-server | b13bd3dae26d65540b7cf5c3d8ef3569111d1676 | [
"MIT"
] | 2 | 2021-07-14T06:34:39.000Z | 2021-07-14T07:30:12.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: bilibili/app/archive/v1/archive.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflec... | 51.312418 | 3,191 | 0.741453 |
07eade5a03b36fc2cdd517ca97dadbf9c9a5c495 | 144 | py | Python | locations/admin.py | yogoh31/Repath-App-Backend | c2cc85b05457ae7338de6f299ce369358402ce12 | [
"MIT"
] | null | null | null | locations/admin.py | yogoh31/Repath-App-Backend | c2cc85b05457ae7338de6f299ce369358402ce12 | [
"MIT"
] | null | null | null | locations/admin.py | yogoh31/Repath-App-Backend | c2cc85b05457ae7338de6f299ce369358402ce12 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Location, FavoritePlace
admin.site.register(Location)
admin.site.register(FavoritePlace)
| 20.571429 | 43 | 0.833333 |
668955308028d8219dfec168db9349e479607224 | 2,124 | py | Python | Naive Bayes/tf_idf.py | rushill2/CS440SP21 | 62fb36db6639a93f9d31866b0e77559abd6f53ff | [
"AFL-1.1"
] | null | null | null | Naive Bayes/tf_idf.py | rushill2/CS440SP21 | 62fb36db6639a93f9d31866b0e77559abd6f53ff | [
"AFL-1.1"
] | null | null | null | Naive Bayes/tf_idf.py | rushill2/CS440SP21 | 62fb36db6639a93f9d31866b0e77559abd6f53ff | [
"AFL-1.1"
] | null | null | null | # tf_idf_bayes.py
# ---------------
# Licensing Information: You are free to use or extend this 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 the University of Illinois at Urbana-Champaign
#
# C... | 30.782609 | 98 | 0.589454 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.