hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1ceb9c0f1f6125efea5e5ae3047c75e839868d29 | 643 | py | Python | owtf/plugins/web/grep/Reflected_Cross_Site_Scripting@OWTF-DV-001.py | alienus/owtf | b6d81fac83c324c2b8c6fe2a974c036881c1fcd0 | [
"BSD-3-Clause"
] | null | null | null | owtf/plugins/web/grep/Reflected_Cross_Site_Scripting@OWTF-DV-001.py | alienus/owtf | b6d81fac83c324c2b8c6fe2a974c036881c1fcd0 | [
"BSD-3-Clause"
] | null | null | null | owtf/plugins/web/grep/Reflected_Cross_Site_Scripting@OWTF-DV-001.py | alienus/owtf | b6d81fac83c324c2b8c6fe2a974c036881c1fcd0 | [
"BSD-3-Clause"
] | null | null | null | """
GREP Plugin for XSS
NOTE: GREP plugins do NOT send traffic to the target and only grep the HTTP Transaction Log
"""
from owtf.plugin.plugin_helper import plugin_helper
DESCRIPTION = "Searches transaction DB for XSS protections"
def run(PluginInfo):
# Background: http://jeremiahgrossman.blogspot.com/2010/01/... | 37.823529 | 120 | 0.777605 |
1ceba6efae2c2354d99e9eff9d493d6c56967b01 | 695 | py | Python | satella/coding/algos.py | piotrmaslanka/satella | bf4ba7a21ad2ac93a366442a2b4574dc5568b87e | [
"MIT"
] | 12 | 2019-12-13T10:17:38.000Z | 2022-01-05T09:01:36.000Z | satella/coding/algos.py | piotrmaslanka/satella | bf4ba7a21ad2ac93a366442a2b4574dc5568b87e | [
"MIT"
] | 26 | 2016-04-01T11:55:26.000Z | 2021-12-30T17:03:59.000Z | satella/coding/algos.py | piotrmaslanka/satella | bf4ba7a21ad2ac93a366442a2b4574dc5568b87e | [
"MIT"
] | 1 | 2021-05-31T08:45:22.000Z | 2021-05-31T08:45:22.000Z | import typing as tp
__all__ = ['merge_dicts']
def merge_dicts(v1: tp.Any, v2: tp.Any) -> tp.Any:
"""
Try to merge two dicts/list together. If key collision is found, value from v2 will be taken.
If the objects aren't dicts or lists, v2 will be returned.
Lists will be concatenated, and dicts updated... | 25.740741 | 97 | 0.58705 |
1ceba9e9ac416cdfd1a927b370fb5d58419f69f9 | 1,817 | py | Python | sprint-challenge/acme_report.py | crsanderford/DS-Unit-3-Sprint-1-Software-Engineering | 908909e74b3773f4a8568617711519108bf977b8 | [
"MIT"
] | null | null | null | sprint-challenge/acme_report.py | crsanderford/DS-Unit-3-Sprint-1-Software-Engineering | 908909e74b3773f4a8568617711519108bf977b8 | [
"MIT"
] | null | null | null | sprint-challenge/acme_report.py | crsanderford/DS-Unit-3-Sprint-1-Software-Engineering | 908909e74b3773f4a8568617711519108bf977b8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Acme inventory management; as random and flammable as our products."""
from random import randint, uniform
from acme import Product
adj = ['Awesome', 'Shiny', 'Impressive', 'Portable', 'Improved']
noun = ['Anvil', 'Catapult' 'Disguise' 'Mousetrap', '???']
# why is 'Rocket' not in this list? ... | 37.081633 | 85 | 0.670886 |
1cebd20083fb42017ca32952d1778ef967ddb8c1 | 5,779 | py | Python | src/olympia/abuse/tests/test_serializers.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 3 | 2020-03-05T18:17:14.000Z | 2020-03-09T01:24:38.000Z | src/olympia/abuse/tests/test_serializers.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 1,398 | 2020-10-08T06:32:26.000Z | 2022-03-31T12:06:24.000Z | src/olympia/abuse/tests/test_serializers.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 1 | 2020-06-04T10:18:59.000Z | 2020-06-04T10:18:59.000Z | # -*- coding: utf-8 -*-
from datetime import datetime
from unittest.mock import Mock
from django.contrib.auth.models import AnonymousUser
from django.test.client import RequestFactory
from olympia import amo
from olympia.abuse.models import AbuseReport
from olympia.abuse.serializers import (
AddonAbuseReportSeri... | 36.11875 | 77 | 0.564631 |
1cebd4d2353527d2904f62031e5072a5fa5bf908 | 1,956 | py | Python | alipay/aop/api/response/ZhimaCustomerLiferecordSignResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/response/ZhimaCustomerLiferecordSignResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/response/ZhimaCustomerLiferecordSignResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class ZhimaCustomerLiferecordSignResponse(AlipayResponse):
def __init__(self):
super(ZhimaCustomerLiferecordSignResponse, self).__init__()
self._process_success = None
... | 29.636364 | 108 | 0.676892 |
1cebf5d25f66837f8420e70f1bdfef91fa39c538 | 1,412 | py | Python | webhook_telegram_bot/database/backends/base.py | toolen/webhook-telegram-bot | c2ef4e7a6cf0f78c0341d3d645e516440596569f | [
"MIT"
] | null | null | null | webhook_telegram_bot/database/backends/base.py | toolen/webhook-telegram-bot | c2ef4e7a6cf0f78c0341d3d645e516440596569f | [
"MIT"
] | 1 | 2022-02-01T18:18:28.000Z | 2022-02-01T18:18:28.000Z | webhook_telegram_bot/database/backends/base.py | toolen/webhook-telegram-bot | c2ef4e7a6cf0f78c0341d3d645e516440596569f | [
"MIT"
] | null | null | null | """This file contains base classes for database layer."""
from abc import ABC, abstractmethod
from webhook_telegram_bot.database.models import Chat
class BaseDatabaseWrapper(ABC):
"""Represent abstract database layer."""
connection = None
closed = False
@abstractmethod
def __init__(self, url: s... | 20.463768 | 68 | 0.575071 |
1cebfe661a00f8acaed3881627f6cdd692363ed0 | 3,502 | py | Python | resources/session.py | Zechee/flask-commodity | 14f586f918a4a84ee9f8a79dc4bea1bb323b2d05 | [
"MIT"
] | null | null | null | resources/session.py | Zechee/flask-commodity | 14f586f918a4a84ee9f8a79dc4bea1bb323b2d05 | [
"MIT"
] | null | null | null | resources/session.py | Zechee/flask-commodity | 14f586f918a4a84ee9f8a79dc4bea1bb323b2d05 | [
"MIT"
] | null | null | null | from flask_restful import Resource
from flask import request
from flask_jwt_extended import (
create_access_token,
create_refresh_token,
jwt_refresh_token_required,
get_jwt_identity,
jwt_required,
get_raw_jwt,
)
from models.user import UserModel
from schemas.user import UserSchema
from blacklis... | 30.189655 | 80 | 0.671902 |
1cec0a2a4935fdaafd1b5aba18e88e7697017687 | 13,850 | py | Python | src/_repobee/cli/parsing.py | ShreyaDhananjay/repobee | da501606c351bdbeda3428b245072f1a2d6372b9 | [
"MIT"
] | null | null | null | src/_repobee/cli/parsing.py | ShreyaDhananjay/repobee | da501606c351bdbeda3428b245072f1a2d6372b9 | [
"MIT"
] | null | null | null | src/_repobee/cli/parsing.py | ShreyaDhananjay/repobee | da501606c351bdbeda3428b245072f1a2d6372b9 | [
"MIT"
] | null | null | null | """Parsing logic for RepoBee's primary parser.
This is separated into its own module as it is a relatively complex affair.
Any non-trivial parsing logic should go in here, whereas definitions of
the primary parser should go int :py:mod:`_repobee.cli.mainparser`.
.. module:: parsing
:synopsis: Parsing logic for Re... | 33.863081 | 79 | 0.66787 |
1cec1cb2b1c96f6bbb7340fabb481da94e5d5639 | 2,437 | py | Python | motor/motor_tornado.py | hellysmile/motor | 16ac8a51467192883a2de2806c4580d4e039c86a | [
"Apache-2.0"
] | null | null | null | motor/motor_tornado.py | hellysmile/motor | 16ac8a51467192883a2de2806c4580d4e039c86a | [
"Apache-2.0"
] | null | null | null | motor/motor_tornado.py | hellysmile/motor | 16ac8a51467192883a2de2806c4580d4e039c86a | [
"Apache-2.0"
] | null | null | null | # Copyright 2011-2015 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 29.361446 | 81 | 0.787033 |
1cec1e75fe9d09c2486ddd2c9cabaa01ef10c855 | 35,379 | py | Python | homeassistant/config_entries.py | mengwangk/home-assistant | 8f7e2ac41ffc969a825329e866c1e27d0e823bb0 | [
"Apache-2.0"
] | 4 | 2016-12-23T10:36:36.000Z | 2021-04-22T12:38:16.000Z | homeassistant/config_entries.py | mengwangk/home-assistant | 8f7e2ac41ffc969a825329e866c1e27d0e823bb0 | [
"Apache-2.0"
] | 9 | 2022-01-27T06:32:10.000Z | 2022-03-31T07:07:51.000Z | homeassistant/config_entries.py | mengwangk/home-assistant | 8f7e2ac41ffc969a825329e866c1e27d0e823bb0 | [
"Apache-2.0"
] | 1 | 2020-03-07T10:43:50.000Z | 2020-03-07T10:43:50.000Z | """Manage config entries in Home Assistant."""
import asyncio
import functools
import logging
from typing import Any, Callable, Dict, List, Optional, Set, Union, cast
import uuid
import weakref
import attr
from homeassistant import data_entry_flow, loader
from homeassistant.core import HomeAssistant, callback
from ho... | 33.952975 | 116 | 0.615422 |
1cec6c61084f5aac962a46bdf3642d5e4a23899a | 2,041 | py | Python | graviti/dataframe/column/indexing.py | wangyuqing0424/graviti-python-sdk | 66300cc1edda6a848cac094899afb3d0421c595d | [
"MIT"
] | null | null | null | graviti/dataframe/column/indexing.py | wangyuqing0424/graviti-python-sdk | 66300cc1edda6a848cac094899afb3d0421c595d | [
"MIT"
] | null | null | null | graviti/dataframe/column/indexing.py | wangyuqing0424/graviti-python-sdk | 66300cc1edda6a848cac094899afb3d0421c595d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright 2022 Graviti. Licensed under MIT License.
#
"""The implementation of the Graviti indexing related class."""
from typing import TYPE_CHECKING, Any, Iterable, Union, overload
if TYPE_CHECKING:
from graviti.dataframe.column.series import Series as ColumnSeries
class ColumnSeri... | 23.732558 | 81 | 0.599706 |
1cec76c740e943b5bfb5a46ce9b49eedf0ae92f3 | 37,715 | py | Python | mindspore/nn/optim/adam.py | LaiYongqiang/mindspore | 1b7a38ccd86b55af50a0ea55c7f2f43813ed3e0e | [
"Apache-2.0"
] | 1 | 2021-11-19T14:21:45.000Z | 2021-11-19T14:21:45.000Z | mindspore/nn/optim/adam.py | LaiYongqiang/mindspore | 1b7a38ccd86b55af50a0ea55c7f2f43813ed3e0e | [
"Apache-2.0"
] | null | null | null | mindspore/nn/optim/adam.py | LaiYongqiang/mindspore | 1b7a38ccd86b55af50a0ea55c7f2f43813ed3e0e | [
"Apache-2.0"
] | null | null | null | # Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 55.219619 | 120 | 0.636776 |
1cecc027461318f83fcd12f8d1acbe2df73d311e | 4,644 | py | Python | tools/bcfg2-profile-templates.py | amplify-education/bcfg2 | 02d7f574babfeb2da99e2aad3a92b4e8d6494f07 | [
"mpich2"
] | null | null | null | tools/bcfg2-profile-templates.py | amplify-education/bcfg2 | 02d7f574babfeb2da99e2aad3a92b4e8d6494f07 | [
"mpich2"
] | null | null | null | tools/bcfg2-profile-templates.py | amplify-education/bcfg2 | 02d7f574babfeb2da99e2aad3a92b4e8d6494f07 | [
"mpich2"
] | null | null | null | #!/usr/bin/python -Ott
""" Benchmark template rendering times """
import sys
import time
import logging
import logging.handlers
import operator
import lxml.etree
import Bcfg2.Server.Core
LOGGER = None
def get_logger(setup=None):
""" set up logging according to the verbose level given on the
command line """
... | 34.917293 | 93 | 0.545435 |
1cecc090375d5340837844ff5eef7ef3d32091b2 | 7,290 | py | Python | sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_recovery_points_recommended_for_move_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-01-24T08:54:57.000Z | 2022-01-24T08:54:57.000Z | sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_recovery_points_recommended_for_move_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_recovery_points_recommended_for_move_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # pylint: disable=too-many-lines
# 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) AutoRe... | 46.730769 | 301 | 0.660768 |
1cecf1139b04e88b3391cec1b9331cf294682d43 | 21,482 | py | Python | visualbert/dataloaders/coco_dataset.py | WadeYin9712/GD-VCR | aa8138b55f5a9136dae10ceb99455d9f2beb6d75 | [
"MIT"
] | 19 | 2021-09-04T16:49:57.000Z | 2022-01-07T08:49:20.000Z | dataloaders/coco_dataset.py | jiyali/visualbert | 001652810294a7de25ae96bcbbde515873871159 | [
"MIT"
] | null | null | null | dataloaders/coco_dataset.py | jiyali/visualbert | 001652810294a7de25ae96bcbbde515873871159 | [
"MIT"
] | 1 | 2020-09-14T11:31:37.000Z | 2020-09-14T11:31:37.000Z | import os
import random
import json
from collections import defaultdict
from tqdm import tqdm
import numpy as np
import numpy
import torch
from torch.utils.data import Dataset
from allennlp.data.dataset import Batch
from allennlp.data.fields import TextField, ListField, LabelField, SequenceLabelField, ArrayField, Meta... | 46.598698 | 205 | 0.606182 |
1cecfb7bc6dfef49322595bae5deff011c9c1757 | 251 | py | Python | setup.py | Kaari/ipmi_acpi | c2c7df1d826069ed75d6aa9c63e8b8aa0825d86c | [
"MIT"
] | 1 | 2018-12-10T18:12:59.000Z | 2018-12-10T18:12:59.000Z | setup.py | Kaari/ipmi_acpi | c2c7df1d826069ed75d6aa9c63e8b8aa0825d86c | [
"MIT"
] | null | null | null | setup.py | Kaari/ipmi_acpi | c2c7df1d826069ed75d6aa9c63e8b8aa0825d86c | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='ipmi_acpi',
version='1.1',
py_modules=['ipmi_acpi'],
install_requires=[
'Click',
],
entry_points='''
[console_scripts]
ipmi_acpi=sample.ipmi_acpi:cli
'''
)
| 16.733333 | 38 | 0.581673 |
1ced1206f6511305a11ade128a8dd978b40735e0 | 15,799 | py | Python | tests/test_setup.py | Natrinicle/home-assistant | 7bb53449428b0787cca1d0c986c93a458401e6fb | [
"Apache-2.0"
] | null | null | null | tests/test_setup.py | Natrinicle/home-assistant | 7bb53449428b0787cca1d0c986c93a458401e6fb | [
"Apache-2.0"
] | null | null | null | tests/test_setup.py | Natrinicle/home-assistant | 7bb53449428b0787cca1d0c986c93a458401e6fb | [
"Apache-2.0"
] | null | null | null | """Test component/platform setup."""
# pylint: disable=protected-access
import asyncio
import os
from unittest import mock
import threading
import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.const import EVENT_HOMEASSISTANT_START
import homeassistant.config as config_ut... | 34.19697 | 79 | 0.598456 |
1ced19525357ca9fff79f2b5ee603622193e773a | 5,569 | py | Python | experiment/Hyper_Parameters.py | DiGyt/NBP_Hyperscanning | 2981e0475b48702ba7bfc14d93aa57298d603928 | [
"BSD-3-Clause"
] | null | null | null | experiment/Hyper_Parameters.py | DiGyt/NBP_Hyperscanning | 2981e0475b48702ba7bfc14d93aa57298d603928 | [
"BSD-3-Clause"
] | 1 | 2020-03-31T11:35:25.000Z | 2020-03-31T11:35:25.000Z | experiment/Hyper_Parameters.py | DiGyt/NBP_Hyperscanning | 2981e0475b48702ba7bfc14d93aa57298d603928 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
########################################
# Hyperscanning Fingertapping Experiment
########################################
import os, sys
import psychopy
from psychopy import event, visual, core, sound, data, logging
import numpy as np
import pandas as pd
import pygame
#########################... | 48.426087 | 168 | 0.679655 |
1ced1f5f1c0decd400c03e11593395c59467633f | 6,162 | py | Python | grouper/fe/handlers/group_request_update.py | lfaraone/grouper | 7df5eda8003a0b4a9ba7f0dcb044ae1e4710b171 | [
"Apache-2.0"
] | null | null | null | grouper/fe/handlers/group_request_update.py | lfaraone/grouper | 7df5eda8003a0b4a9ba7f0dcb044ae1e4710b171 | [
"Apache-2.0"
] | 1 | 2016-02-18T18:55:29.000Z | 2016-02-18T18:55:29.000Z | grouper/fe/handlers/group_request_update.py | lfaraone/grouper | 7df5eda8003a0b4a9ba7f0dcb044ae1e4710b171 | [
"Apache-2.0"
] | null | null | null | from grouper.audit import assert_can_join, UserNotAuditor
from grouper.email_util import send_email
from grouper.fe.forms import GroupRequestModifyForm
from grouper.fe.settings import settings
from grouper.fe.util import Alert, GrouperHandler
from grouper.model_soup import Group, GroupEdge, Request
from grouper.models.... | 38.037037 | 97 | 0.564103 |
1ced2562b8ada78ff8f8cab37c4c6476be75baa4 | 26,499 | py | Python | mindmeld/models/nn_utils/classification.py | Zozman/mindmeld | d86cc823c9b36dbafc8fc8f8ea04085ca1ffdeb5 | [
"Apache-2.0"
] | 1 | 2022-02-09T13:39:41.000Z | 2022-02-09T13:39:41.000Z | mindmeld/models/nn_utils/classification.py | Zozman/mindmeld | d86cc823c9b36dbafc8fc8f8ea04085ca1ffdeb5 | [
"Apache-2.0"
] | null | null | null | mindmeld/models/nn_utils/classification.py | Zozman/mindmeld | d86cc823c9b36dbafc8fc8f8ea04085ca1ffdeb5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Cisco Systems, Inc. and others. 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... | 45.220137 | 100 | 0.622627 |
1ced2798c20eeff9e643fcda76ddcfa09a926f43 | 4,558 | py | Python | chopper_ds/run_walker.py | villarrealas/deltasigma | b1c2e9f307d37064ed4163a2682be825b3a44bf2 | [
"BSD-3-Clause"
] | null | null | null | chopper_ds/run_walker.py | villarrealas/deltasigma | b1c2e9f307d37064ed4163a2682be825b3a44bf2 | [
"BSD-3-Clause"
] | null | null | null | chopper_ds/run_walker.py | villarrealas/deltasigma | b1c2e9f307d37064ed4163a2682be825b3a44bf2 | [
"BSD-3-Clause"
] | null | null | null | import pair_counter as pc
import data_handler as dh
import numpy as np
from thechopper import get_buffered_subvolumes
import yaml
import sys
import json
from collections import OrderedDict
from mpi4py import MPI
import psutil
import os
import gc
from datetime import datetime
# This script runs
if __name__ == '__main__... | 45.128713 | 121 | 0.61957 |
1ced29eaadb015f3a6940b34c8ef4846a6d3462e | 12,732 | py | Python | models/official/mnasnet/imagenet_input.py | tensorflow/tpu-demos | 8aac591077e5781785aa6c22bc400472ba14dada | [
"Apache-2.0"
] | 65 | 2017-07-28T03:47:42.000Z | 2018-02-04T20:54:18.000Z | models/official/mnasnet/imagenet_input.py | tensorflow/tpu-demos | 8aac591077e5781785aa6c22bc400472ba14dada | [
"Apache-2.0"
] | 10 | 2017-08-11T22:55:40.000Z | 2018-02-07T01:11:28.000Z | models/official/mnasnet/imagenet_input.py | tensorflow/tpu-demos | 8aac591077e5781785aa6c22bc400472ba14dada | [
"Apache-2.0"
] | 28 | 2017-07-28T08:20:06.000Z | 2018-01-28T16:28:12.000Z | # 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
#
# Unless required by applica... | 35.764045 | 96 | 0.687166 |
1ced351a26b8a8cec9d021f65a16da326c4f9614 | 213 | py | Python | pni_customization/utility/customer_utility.py | DaizyModi/pni_customization | 577946e91c8fe956ca64c089327ce18174002ec4 | [
"MIT"
] | null | null | null | pni_customization/utility/customer_utility.py | DaizyModi/pni_customization | 577946e91c8fe956ca64c089327ce18174002ec4 | [
"MIT"
] | null | null | null | pni_customization/utility/customer_utility.py | DaizyModi/pni_customization | 577946e91c8fe956ca64c089327ce18174002ec4 | [
"MIT"
] | null | null | null |
def validate_customer(doc, method):
return
for user in doc.daily_payment_report:
doc.last_commitment_date = user.commitment_date
doc.last_commitment_amt = user.commitment_amt
doc.last_remark = user.remark | 30.428571 | 49 | 0.812207 |
1ced4883a7684b35e06a2470f58ddd0f9e43801a | 3,590 | py | Python | src/widgetastic_patternfly4/button.py | rsnyman/widgetastic.patternfly4 | 3d7c3c5921e278bf103965c7016b836844bd45ef | [
"Apache-2.0"
] | 1 | 2019-05-07T14:48:46.000Z | 2019-05-07T14:48:46.000Z | src/widgetastic_patternfly4/button.py | rsnyman/widgetastic.patternfly4 | 3d7c3c5921e278bf103965c7016b836844bd45ef | [
"Apache-2.0"
] | 24 | 2019-02-01T11:42:20.000Z | 2019-05-27T17:37:55.000Z | src/widgetastic_patternfly4/button.py | rsnyman/widgetastic.patternfly4 | 3d7c3c5921e278bf103965c7016b836844bd45ef | [
"Apache-2.0"
] | 7 | 2018-12-11T10:55:47.000Z | 2019-06-12T08:35:48.000Z | from widgetastic.log import call_sig
from widgetastic.utils import ParametrizedLocator
from widgetastic.widget import ClickableMixin
from widgetastic.widget import Widget
from widgetastic.xpath import quote
class BaseButton:
CHECK_VISIBILITY = True
# Classes usable in the constructor
# Button types
P... | 34.854369 | 97 | 0.6039 |
1ced48fee0f3098dacaa0b28d1b3a5add5a531b3 | 3,069 | py | Python | test/test_structured_errors.py | cseelye/python-fastapi-container | 541700581562a5a1cbbcecd3a97a77f99b11de9c | [
"MIT"
] | null | null | null | test/test_structured_errors.py | cseelye/python-fastapi-container | 541700581562a5a1cbbcecd3a97a77f99b11de9c | [
"MIT"
] | null | null | null | test/test_structured_errors.py | cseelye/python-fastapi-container | 541700581562a5a1cbbcecd3a97a77f99b11de9c | [
"MIT"
] | null | null | null | # pylint: skip-file
"""
Test that all errors from the API match out structured error specification
"""
from fastapi import APIRouter
from fastapi.testclient import TestClient
from pydantic import BaseModel
from app.main import app
from app.exceptions import AppException
client = TestClient(app)
# Create a new endpo... | 35.686047 | 101 | 0.693385 |
1ced53c4dcadf4b74ed62e956fdc3c4c5b6c741f | 8,471 | py | Python | stockscore/scores.py | jackmoody11/stockscore | 629d1685418d72b6ad9e7a3c0399d53774ab7aed | [
"MIT"
] | 54 | 2018-10-10T01:47:32.000Z | 2022-03-18T16:41:26.000Z | stockscore/scores.py | jackmoody11/stockscore | 629d1685418d72b6ad9e7a3c0399d53774ab7aed | [
"MIT"
] | 53 | 2018-08-14T23:29:48.000Z | 2021-03-31T19:55:46.000Z | stockscore/scores.py | jackmoody11/stockScores | 629d1685418d72b6ad9e7a3c0399d53774ab7aed | [
"MIT"
] | 16 | 2018-10-12T21:05:23.000Z | 2022-01-21T09:08:44.000Z | from stockscore.data import Stocks
class Scores(Stocks):
"""Scores for stocks. """
def __init__(self, stocks=None):
super().__init__(stocks)
if self.scores is None:
self.init_scores()
def moving_avg_screen(self):
"""Test percent diff in 50 day SMA and 200 day SMA. """... | 40.5311 | 91 | 0.520836 |
1ced62776c4a936277cd4e112d6565060e290799 | 1,590 | py | Python | orgparse/tests/data/01_attributes.py | j3soon-pr/orgparse | 8943bdcfb2c1028b17588b390e24a1e1594a97c9 | [
"BSD-2-Clause"
] | 233 | 2019-07-26T20:18:27.000Z | 2022-03-29T19:19:30.000Z | orgparse/tests/data/01_attributes.py | j3soon-pr/orgparse | 8943bdcfb2c1028b17588b390e24a1e1594a97c9 | [
"BSD-2-Clause"
] | 37 | 2019-06-29T20:27:20.000Z | 2022-03-25T13:16:55.000Z | orgparse/tests/data/01_attributes.py | j3soon-pr/orgparse | 8943bdcfb2c1028b17588b390e24a1e1594a97c9 | [
"BSD-2-Clause"
] | 28 | 2019-09-24T04:29:20.000Z | 2022-03-06T16:04:54.000Z | from typing import Dict, Any
from orgparse.date import (
OrgDate, OrgDateScheduled, OrgDateDeadline, OrgDateClosed,
OrgDateClock,
)
Raw = Dict[str, Any]
node1: Raw = dict(
heading="A node with a lot of attributes",
priority='A',
scheduled=OrgDateScheduled((2010, 8, 6)),
deadline=OrgDateDeadli... | 26.065574 | 72 | 0.575472 |
1ced81c7ca3fba662766a6b7d9976d102677ea4c | 1,810 | py | Python | sis-api/swagger_server/controllers/user_profile_controller.py | maxbilbow/7054CEM-sis | 1c5067c9afc38e340fcce046048f8ae21d267365 | [
"MIT"
] | null | null | null | sis-api/swagger_server/controllers/user_profile_controller.py | maxbilbow/7054CEM-sis | 1c5067c9afc38e340fcce046048f8ae21d267365 | [
"MIT"
] | null | null | null | sis-api/swagger_server/controllers/user_profile_controller.py | maxbilbow/7054CEM-sis | 1c5067c9afc38e340fcce046048f8ae21d267365 | [
"MIT"
] | null | null | null | import connexion
from flask_api import status
from core import model
from core.model.profile import Profile
from core.repository.user_profile import UserProfileRepository
from core.service.profile_service import ProfileService
def create_profile(body, user_id): # noqa: E501
"""Create a user profile
# noqa... | 22.911392 | 62 | 0.666851 |
1ced86b5003c3cf075bb8262e45b477fbec8a888 | 599 | py | Python | cleverhans/initializers.py | iamgroot42/cleverhans | 53da9cd6daf9d7457800831c3eaa75f729a39145 | [
"MIT"
] | 21 | 2019-06-07T17:05:30.000Z | 2022-02-07T03:25:15.000Z | cleverhans/initializers.py | iamgroot42/cleverhans | 53da9cd6daf9d7457800831c3eaa75f729a39145 | [
"MIT"
] | 7 | 2019-12-16T22:20:01.000Z | 2022-02-10T00:45:21.000Z | cleverhans/initializers.py | iamgroot42/cleverhans | 53da9cd6daf9d7457800831c3eaa75f729a39145 | [
"MIT"
] | 8 | 2019-06-11T03:06:29.000Z | 2022-01-18T04:18:27.000Z | """
Initializers.
"""
import tensorflow as tf
class HeReLuNormalInitializer(tf.initializers.random_normal):
"""
The initializer from He et al 2015
"""
def __init__(self, dtype=tf.float32):
super(HeReLuNormalInitializer, self).__init__(dtype=dtype)
def get_config(self):
return dict(dtype=self.dtype... | 26.043478 | 74 | 0.719533 |
1ced9d3be4c41f8d5666959de989f6892a478da2 | 998 | py | Python | test/log/test_DataDogLogger.py | pip-services3-python/pip-services3-datadog-python | 5d4549685b8486f1fc663b0e50ea52d019095909 | [
"MIT"
] | null | null | null | test/log/test_DataDogLogger.py | pip-services3-python/pip-services3-datadog-python | 5d4549685b8486f1fc663b0e50ea52d019095909 | [
"MIT"
] | null | null | null | test/log/test_DataDogLogger.py | pip-services3-python/pip-services3-datadog-python | 5d4549685b8486f1fc663b0e50ea52d019095909 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
from pip_services3_commons.config import ConfigParams
from pip_services3_datadog.log.DataDogLogger import DataDogLogger
from test.fixtures.LoggerFixture import LoggerFixture
class TestDataDogLogger:
_logger: DataDogLogger
_fixture: LoggerFixture
def setup_method(self):... | 24.95 | 89 | 0.698397 |
1ceda3fe43e4b82d41b660e5220c199fc7200aba | 230 | py | Python | lane-line/smoothening image.py | zbs881314/Self-Driving-Car- | 4e18a410b1ad6c542c72c7ee68f0a4042f45f9d3 | [
"MIT"
] | 1 | 2019-01-27T23:00:44.000Z | 2019-01-27T23:00:44.000Z | lane-line/smoothening image.py | zbs881314/Self-Driving-Car- | 4e18a410b1ad6c542c72c7ee68f0a4042f45f9d3 | [
"MIT"
] | null | null | null | lane-line/smoothening image.py | zbs881314/Self-Driving-Car- | 4e18a410b1ad6c542c72c7ee68f0a4042f45f9d3 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
image = cv2.imread('test_image.jpg')
lane_image = np.copy(image)
gray = cv2.cvtColor(lane_image, cv2.COLOR_RGB2GRAY)
blur = cv2.GaussianBlur(gray, (5, 5), 0)
cv2.imshow('result', blur)
cv2.waitKey(0) | 25.555556 | 51 | 0.73913 |
1cedcaadf59dd662da39fa20c6f14712bcd5df5d | 2,195 | py | Python | Tools/Scripts/webkitpy/benchmark_runner/browser_driver/linux_minibrowsergtk_driver.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 6 | 2021-07-05T16:09:39.000Z | 2022-03-06T22:44:42.000Z | Tools/Scripts/webkitpy/benchmark_runner/browser_driver/linux_minibrowsergtk_driver.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 7 | 2022-03-15T13:25:39.000Z | 2022-03-15T13:25:44.000Z | Tools/Scripts/webkitpy/benchmark_runner/browser_driver/linux_minibrowsergtk_driver.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | null | null | null | # Copyright (C) 2016 Igalia S.L. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | 49.886364 | 111 | 0.769932 |
1cedf2781e067e71cb821c01a73a52968ca4b7da | 164 | py | Python | nanpack/tests/test_curvgrid.py | vxsharma-14/DIFFUS | d70633890b8fb2e7b3dde918eb13b263f7a035ef | [
"MIT"
] | 14 | 2021-01-28T06:52:15.000Z | 2021-03-05T01:34:30.000Z | nanpack/tests/test_curvgrid.py | vxsharma-14/project-NAnPack | fad644ec9a614605f84562745a317e5512db1d58 | [
"MIT"
] | 2 | 2021-01-22T22:55:08.000Z | 2021-01-22T22:56:13.000Z | nanpack/tests/test_curvgrid.py | vxsharma-14/DIFFUS | d70633890b8fb2e7b3dde918eb13b263f7a035ef | [
"MIT"
] | 2 | 2021-01-28T06:52:17.000Z | 2021-01-30T12:35:52.000Z |
def test_curvgrid:
'''Test curvilinear grid generation routine.'''
import nanpack.grid as grid
x, y = grid.CurvilinearGrid(0.1, 21, 0.05, 41)
| 20.5 | 52 | 0.640244 |
1cee0c9a76678ff2f7acce90503de20cf1165187 | 3,415 | py | Python | tensorflow/compiler/mlir/runlit.cfg.py | ROCmSoftwarePlatform/tensorflow-upstream | 8bd1e3fcaee378945b11c96ed1474d8b890232fc | [
"Apache-2.0"
] | 615 | 2018-04-14T22:04:13.000Z | 2022-03-31T12:46:50.000Z | tensorflow/compiler/mlir/runlit.cfg.py | ROCmSoftwarePlatform/tensorflow-upstream | 8bd1e3fcaee378945b11c96ed1474d8b890232fc | [
"Apache-2.0"
] | 1,167 | 2018-05-15T15:26:33.000Z | 2022-03-31T18:58:41.000Z | tensorflow/compiler/mlir/runlit.cfg.py | ROCmSoftwarePlatform/tensorflow-upstream | 8bd1e3fcaee378945b11c96ed1474d8b890232fc | [
"Apache-2.0"
] | 93 | 2018-04-11T02:46:16.000Z | 2022-03-31T12:46:16.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 applica... | 39.252874 | 80 | 0.733821 |
1cee16e7bb00df2b1ecaaf7af8afe51059313f7b | 11,810 | py | Python | qupulse/pulses/sequence_pulse_template.py | lankes-fzj/qupulse | 46f00f70bc998b98ac1ae4721d1a9a1c10b675aa | [
"MIT"
] | 2 | 2021-05-22T00:04:20.000Z | 2021-11-17T11:21:46.000Z | qupulse/pulses/sequence_pulse_template.py | bpapajewski/qupulse | c3969a4fa9eabe69c1143ad16e6e3ca5fb9c068e | [
"MIT"
] | null | null | null | qupulse/pulses/sequence_pulse_template.py | bpapajewski/qupulse | c3969a4fa9eabe69c1143ad16e6e3ca5fb9c068e | [
"MIT"
] | null | null | null | """This module defines SequencePulseTemplate, a higher-order hierarchical pulse template that
combines several other PulseTemplate objects for sequential execution."""
import numpy as np
from typing import Dict, List, Tuple, Set, Optional, Any, Iterable, Union
from numbers import Real
import functools
import warnings
... | 49.208333 | 130 | 0.661135 |
1cee17086f8ed53ca6cfc0640d25c80ed6bb1820 | 7,529 | py | Python | repath.py | synacor/python-repath | ab66ef2f846194bac0eb6b78f9d2b163ce680e8d | [
"MIT"
] | 3 | 2016-05-27T02:07:13.000Z | 2022-01-12T19:45:28.000Z | repath.py | synacorinc/python-repath | ab66ef2f846194bac0eb6b78f9d2b163ce680e8d | [
"MIT"
] | 1 | 2019-04-19T17:33:36.000Z | 2019-04-19T17:33:36.000Z | repath.py | synacorinc/python-repath | ab66ef2f846194bac0eb6b78f9d2b163ce680e8d | [
"MIT"
] | 1 | 2015-06-01T19:01:30.000Z | 2015-06-01T19:01:30.000Z | import re
import urllib
REGEXP_TYPE = type(re.compile(''))
PATH_REGEXP = re.compile('|'.join([
# Match escaped characters that would otherwise appear in future matches.
# This allows the user to escape special characters that won't transform.
'(\\\\.)',
# Match Express-style parameters and un-named par... | 26.60424 | 100 | 0.513216 |
1cee47079b8c3fbf4cf3c7f9c52b614900d5ec62 | 869 | py | Python | packages/fetchai/connections/gym/__init__.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 28 | 2021-10-31T18:54:14.000Z | 2022-03-17T13:10:43.000Z | packages/fetchai/connections/gym/__init__.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 66 | 2021-10-31T11:55:48.000Z | 2022-03-31T06:26:23.000Z | packages/fetchai/connections/gym/__init__.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 Valory AG
# Copyright 2018-2020 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | 39.5 | 80 | 0.586881 |
1cee4cec5d0654f1185f8973db1f770453c4792f | 32,665 | py | Python | test/functional/test_runner.py | luisriverag/namecoin-core | f2c234926bdb151338732df7ace37a105c14e776 | [
"MIT"
] | null | null | null | test/functional/test_runner.py | luisriverag/namecoin-core | f2c234926bdb151338732df7ace37a105c14e776 | [
"MIT"
] | null | null | null | test/functional/test_runner.py | luisriverag/namecoin-core | f2c234926bdb151338732df7ace37a105c14e776 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Run regression test suite.
This module calls down into individual test cases via subprocess. It will
f... | 38.748517 | 205 | 0.644329 |
1cee5bfd7c7c31b8fb982f17cc9cf735e64c7376 | 28,177 | py | Python | scapy/scapy/contrib/ospf.py | jreynders/BLESuite-1 | 1c3c15fc2d4e30c3f9c1a15e0268cae84685784b | [
"MIT"
] | null | null | null | scapy/scapy/contrib/ospf.py | jreynders/BLESuite-1 | 1c3c15fc2d4e30c3f9c1a15e0268cae84685784b | [
"MIT"
] | null | null | null | scapy/scapy/contrib/ospf.py | jreynders/BLESuite-1 | 1c3c15fc2d4e30c3f9c1a15e0268cae84685784b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# scapy.contrib.description = OSPF
# scapy.contrib.status = loads
# This file is part of Scapy
# Scapy 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 2 of the License, o... | 37.720214 | 154 | 0.53352 |
1cee6a514ce0e4ed6a5a683b3e557c53a36a3a4c | 2,851 | py | Python | venv/Lib/site-packages/pyrogram/raw/types/messages/affected_messages.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/raw/types/messages/affected_messages.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/types/messages/affected_messages.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 33.151163 | 105 | 0.622589 |
1cee8103631d647f1f9cfe17619ba8aee77b1135 | 2,829 | py | Python | trainval.py | marcotet/haven-ai | 452a17601db3f120d59d6db7fe2a9a600a2dd2ab | [
"Apache-2.0"
] | null | null | null | trainval.py | marcotet/haven-ai | 452a17601db3f120d59d6db7fe2a9a600a2dd2ab | [
"Apache-2.0"
] | null | null | null | trainval.py | marcotet/haven-ai | 452a17601db3f120d59d6db7fe2a9a600a2dd2ab | [
"Apache-2.0"
] | null | null | null | import tqdm
import argparse
import os
from haven import haven_examples as he
from haven import haven_wizard as hw
from haven import haven_results as hr
def trainval(exp_dict, savedir, args):
"""
exp_dict: dictionary defining the hyperparameters of the experiment
savedir: the directory where the experimen... | 32.895349 | 117 | 0.65889 |
1cee8f207ac481aba39c0e1f3e4d748bd20f8dcb | 1,270 | py | Python | utils.py | Aclau99/api-offres-emploi | abeaf74b22431613fc5fa4b280ad4de4a331b447 | [
"MIT"
] | null | null | null | utils.py | Aclau99/api-offres-emploi | abeaf74b22431613fc5fa4b280ad4de4a331b447 | [
"MIT"
] | null | null | null | utils.py | Aclau99/api-offres-emploi | abeaf74b22431613fc5fa4b280ad4de4a331b447 | [
"MIT"
] | null | null | null | import datetime
import pandas as pd
def dt_to_str_iso(dt):
"""
Convert a datetime.datetime object to a string respecting the ISO-8601 format
Will raise ValueError if type not appropriate
:param dt: The datetime object to convert
:type dt: datetime.datetime
:returns: ISO 8601 formatted st... | 28.863636 | 86 | 0.595276 |
1ceed31328bcab0d19d6a2bbbc91df2e42609be9 | 3,362 | py | Python | python/smlmlib/util.py | qnano/simflux | 4f149d4e6c997954ac862cc5a7a404855b2a0be9 | [
"MIT"
] | 2 | 2019-12-13T16:24:12.000Z | 2021-03-13T04:02:51.000Z | python/smlmlib/util.py | qnano/simflux | 4f149d4e6c997954ac862cc5a7a404855b2a0be9 | [
"MIT"
] | 1 | 2021-01-25T13:32:43.000Z | 2021-01-26T06:03:19.000Z | python/smlmlib/util.py | qnano/simflux | 4f149d4e6c997954ac862cc5a7a404855b2a0be9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 26 13:06:46 2018
@author: jcnossen1
"""
import numpy as np
import math
import matplotlib.pyplot as plt
import sys
# smp = [numspots, width, height]
def compute_com(smp):
w = smp.shape[1]
h = smp.shape[2]
X, Y = np.meshgrid(np.arange(w), np.arange(h))
X = ... | 24.540146 | 120 | 0.580012 |
1ceedeb54596eeefa4e1eeed2f652079d01f8b36 | 162 | py | Python | web/crawler_api/urls.py | lilerjee/ecproduct | 98f3768d8b63626966ffeae0701d9e5725da1c1e | [
"MIT"
] | null | null | null | web/crawler_api/urls.py | lilerjee/ecproduct | 98f3768d8b63626966ffeae0701d9e5725da1c1e | [
"MIT"
] | 1 | 2020-07-30T04:12:13.000Z | 2020-07-30T04:12:13.000Z | web/crawler_api/urls.py | lilerjee/ecproduct | 98f3768d8b63626966ffeae0701d9e5725da1c1e | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^vvic/', views.vvic, name='vvic'),
]
| 16.2 | 44 | 0.623457 |
1ceeefb0bab1549c6525692059957704f661d603 | 3,975 | py | Python | VocalEmotionsAgent.py | TheVinhLuong102/BlocksBot | ad8bb17f43ca72ab4511189d0f2abd02dec5478c | [
"Apache-2.0"
] | 2 | 2020-09-05T00:08:27.000Z | 2021-11-03T08:17:52.000Z | VocalEmotionsAgent.py | TheVinhLuong102/BlocksBot | ad8bb17f43ca72ab4511189d0f2abd02dec5478c | [
"Apache-2.0"
] | null | null | null | VocalEmotionsAgent.py | TheVinhLuong102/BlocksBot | ad8bb17f43ca72ab4511189d0f2abd02dec5478c | [
"Apache-2.0"
] | 2 | 2020-05-19T16:48:17.000Z | 2020-09-05T00:08:29.000Z | # coding : utf-8
'''
Copyright 2020-2021 Agnese Salutari.
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 ... | 40.561224 | 116 | 0.67044 |
1cef201bc3dc46550b8917eb6bfe07e58729481f | 2,672 | py | Python | sdk/network/azure-mgmt-frontdoor/setup.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/network/azure-mgmt-frontdoor/setup.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/network/azure-mgmt-frontdoor/setup.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------... | 35.626667 | 103 | 0.609281 |
1cef26cf182897414c89db69941b54fd9a2fdf23 | 921 | py | Python | smarttools/smarttools/assemble_transcripts_stringtie/smarttool_runner.py | jic-dtool/smarttools | 57d3bfd6e5528da3cbf352c1d87d79b257cfcd7c | [
"MIT"
] | null | null | null | smarttools/smarttools/assemble_transcripts_stringtie/smarttool_runner.py | jic-dtool/smarttools | 57d3bfd6e5528da3cbf352c1d87d79b257cfcd7c | [
"MIT"
] | null | null | null | smarttools/smarttools/assemble_transcripts_stringtie/smarttool_runner.py | jic-dtool/smarttools | 57d3bfd6e5528da3cbf352c1d87d79b257cfcd7c | [
"MIT"
] | null | null | null | """Assemble transcript using stringtie."""
import os
from smarttoolbase import SmartTool, Command, parse_args
BASE_COMMANDS = [
Command(
"stringtie -G {gene_annotation_path} {input_fpath} -o stringtie.gtf"
),
]
OUTPUTS = ["stringtie.gtf"]
class StringtieAssembleTranscripts(SmartTool):
def pre... | 21.928571 | 100 | 0.682953 |
1cef29619c8d63e03731af734f7e43e80d35db95 | 527 | py | Python | dags/oss_know/libs/util/airflow.py | ynang/airflow-jobs-1 | 857e9dfbc2444dc1d23dd2b0463fe89108f01b89 | [
"Apache-2.0"
] | 4 | 2022-01-24T11:27:39.000Z | 2022-02-25T11:44:10.000Z | dags/oss_know/libs/util/airflow.py | linruoma/airflow-jobs-1 | 25d3996c6d11ee2d8f93ff2b73abcf83da986804 | [
"Apache-2.0"
] | 13 | 2021-12-17T12:14:11.000Z | 2022-02-24T07:01:08.000Z | dags/oss_know/libs/util/airflow.py | linruoma/airflow-jobs-1 | 25d3996c6d11ee2d8f93ff2b73abcf83da986804 | [
"Apache-2.0"
] | 13 | 2022-01-19T09:30:03.000Z | 2022-03-02T10:45:07.000Z | import airflow.providers.postgres.hooks.postgres as postgres_hooks
def get_postgres_conn():
# 演示从airflow 获取 postgres_hooks 再获取 conn 链接
# postgres_conn = postgres_hooks.PostgresHook.get_hook("airflow-jobs").get_conn()
# pg_cursor = postgres_conn.cursor()
# pg_cursor.execute("select version();")
# r... | 37.642857 | 86 | 0.734345 |
1cef3b9bec398e0a5b1b7bf3f370665af6e08a21 | 1,225 | py | Python | gaphor/diagram/classes/classeseditors.py | MarianelaSena/gaphor | f1ccc2e2ae98d7fad54f6dd9271e8e10fbb2e324 | [
"Apache-2.0"
] | null | null | null | gaphor/diagram/classes/classeseditors.py | MarianelaSena/gaphor | f1ccc2e2ae98d7fad54f6dd9271e8e10fbb2e324 | [
"Apache-2.0"
] | null | null | null | gaphor/diagram/classes/classeseditors.py | MarianelaSena/gaphor | f1ccc2e2ae98d7fad54f6dd9271e8e10fbb2e324 | [
"Apache-2.0"
] | null | null | null | from gaphor import UML
from gaphor.diagram.editors import Editor, AbstractEditor
from gaphor.diagram.classes.association import AssociationItem
@Editor.register(AssociationItem)
class AssociationItemEditor(AbstractEditor):
def __init__(self, item):
self._item = item
self._edit = None
def is_e... | 27.840909 | 64 | 0.588571 |
1cef4a3e5db5136af9e72ee7a061635bc2856d87 | 344 | py | Python | day_template.py | furgerf/advent-of-code-2019 | f2c6ad9d401c91a7b04bb699d233a7d6ec9da2ac | [
"Apache-2.0"
] | null | null | null | day_template.py | furgerf/advent-of-code-2019 | f2c6ad9d401c91a7b04bb699d233a7d6ec9da2ac | [
"Apache-2.0"
] | null | null | null | day_template.py | furgerf/advent-of-code-2019 | f2c6ad9d401c91a7b04bb699d233a7d6ec9da2ac | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from day import Day
class DayXXX(Day):
def __init__(self):
super(DayXXX, self).__init__(XXX)
def parse_data(self):
pass
def part_1(self):
pass
@property
def part_1_solution(self):
pass
def part_2(self):
pass
@property
def part_2_s... | 12.740741 | 37 | 0.636628 |
1cef60fe43f48a0315947993ab8dd5edf8a2d7d0 | 8,793 | py | Python | nlptools/text/embedding.py | zhupengjia/nlptools | a0afc4873ee1b3adb383d38075ad5ae5e0293055 | [
"MIT"
] | 1 | 2020-10-26T02:32:25.000Z | 2020-10-26T02:32:25.000Z | nlptools/text/embedding.py | zhupengjia/nlptools | a0afc4873ee1b3adb383d38075ad5ae5e0293055 | [
"MIT"
] | null | null | null | nlptools/text/embedding.py | zhupengjia/nlptools | a0afc4873ee1b3adb383d38075ad5ae5e0293055 | [
"MIT"
] | 1 | 2020-10-26T02:34:05.000Z | 2020-10-26T02:34:05.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Author: Pengjia Zhu (zhupengjia@gmail.com)
Word2vec wrapper
'''
import time, base64, os, h5py
import numpy as np
from scipy.spatial.distance import cosine
from ..utils import zload, zdump, restpost
class Embedding_Base(object):
'''
Parent class fo... | 31.743682 | 123 | 0.593085 |
1cefb358e48eb247bc4b22ebbfb29d95af6c4db6 | 271 | py | Python | resources/verify/verify.py | Yogev911/sms-service | 18e5c6ba55d354ea59bc0eceed31a0e01ecb5ebb | [
"MIT"
] | null | null | null | resources/verify/verify.py | Yogev911/sms-service | 18e5c6ba55d354ea59bc0eceed31a0e01ecb5ebb | [
"MIT"
] | null | null | null | resources/verify/verify.py | Yogev911/sms-service | 18e5c6ba55d354ea59bc0eceed31a0e01ecb5ebb | [
"MIT"
] | null | null | null | from flask_restful_swagger_2 import Resource, swagger
from resources.verify import service
from resources.verify.swagger_doc import verify_post
class Verify(Resource):
@swagger.doc(verify_post)
def put(self, user, pin):
return service.verify(user, pin)
| 27.1 | 53 | 0.774908 |
1cefd557d0292d79e87bd409df2d8793ef7d4bba | 7,870 | py | Python | python/rogue_gym/envs/rogue_env.py | kngwyu/rogue-gym | 00de77e6c9f3d2b9ed602f93abb5526c13791ca9 | [
"Apache-2.0",
"MIT"
] | 67 | 2018-11-29T03:05:59.000Z | 2022-02-23T20:05:21.000Z | python/rogue_gym/envs/rogue_env.py | kngwyu/rogue-gym | 00de77e6c9f3d2b9ed602f93abb5526c13791ca9 | [
"Apache-2.0",
"MIT"
] | 2 | 2019-02-27T10:44:05.000Z | 2022-03-05T22:25:49.000Z | python/rogue_gym/envs/rogue_env.py | kngwyu/rogue-gym | 00de77e6c9f3d2b9ed602f93abb5526c13791ca9 | [
"Apache-2.0",
"MIT"
] | 6 | 2020-05-11T01:37:53.000Z | 2022-03-05T20:56:19.000Z | """Provides RogueEnv, a gym environment which wraps rogue_gym_core::Runtime"""
from enum import Enum, Flag
import gym
from gym import spaces
import json
import numpy as np
from numpy import ndarray
from typing import Dict, List, NamedTuple, Optional, Tuple, Union
from rogue_gym_python import _rogue_gym as rogue_gym_inn... | 30.503876 | 87 | 0.567598 |
1cf009783f1eb934834015cd86ee0d0ea3af64b6 | 8,319 | py | Python | loopring/errors.py | blainecostello/LoopringAPI | 619289f2b0643bdf68b74f53a0104cbb3dcb545d | [
"Apache-2.0"
] | 2 | 2022-01-28T13:25:06.000Z | 2022-03-28T01:46:47.000Z | loopring/errors.py | blainecostello/LoopringAPI | 619289f2b0643bdf68b74f53a0104cbb3dcb545d | [
"Apache-2.0"
] | 2 | 2022-01-19T19:18:13.000Z | 2022-01-20T14:18:27.000Z | loopring/errors.py | blainecostello/LoopringAPI | 619289f2b0643bdf68b74f53a0104cbb3dcb545d | [
"Apache-2.0"
] | 1 | 2022-01-19T18:58:29.000Z | 2022-01-19T18:58:29.000Z | # TODO: This file might get a bit cramped and spaghetti-ish...
# Perhaps start subclassing more errors and using the returned
# exception messages to your advantage.
class LoopringError(Exception):
"""The default base class for all Loopring exceptions."""
pass
class AddressNotFound(LoopringError)... | 24.907186 | 83 | 0.64539 |
1cf00abc16c3ed513888fc12c49533ebd1ede582 | 278 | py | Python | click_rich_help/__init__.py | daylinmorgan/click-rich-help | dedbd570e60583af1562de7250805861d0571094 | [
"MIT"
] | 4 | 2022-02-19T18:24:11.000Z | 2022-03-22T14:42:45.000Z | click_rich_help/__init__.py | daylinmorgan/click-rich-help | dedbd570e60583af1562de7250805861d0571094 | [
"MIT"
] | 4 | 2022-03-22T04:48:05.000Z | 2022-03-29T23:05:32.000Z | click_rich_help/__init__.py | daylinmorgan/click-rich-help | dedbd570e60583af1562de7250805861d0571094 | [
"MIT"
] | 1 | 2022-03-22T03:30:33.000Z | 2022-03-22T03:30:33.000Z | from .core import HelpStylesFormatter, StyledCommand, StyledGroup, StyledMultiCommand
from .decorators import version_option
__all__ = [
"HelpStylesFormatter",
"StyledGroup",
"StyledCommand",
"StyledMultiCommand",
"version_option",
]
__version__ = "22.1.1"
| 23.166667 | 85 | 0.741007 |
1cf016aee93e72b8e72e08d31b21f3b949b9309b | 1,097 | py | Python | MFAEngine/apps/self_service/service_forms.py | justicevR/mfa_authentication_factor_v0.1 | b7302904c3eaa00801ca4d78fb47797b16427ad4 | [
"MIT"
] | null | null | null | MFAEngine/apps/self_service/service_forms.py | justicevR/mfa_authentication_factor_v0.1 | b7302904c3eaa00801ca4d78fb47797b16427ad4 | [
"MIT"
] | null | null | null | MFAEngine/apps/self_service/service_forms.py | justicevR/mfa_authentication_factor_v0.1 | b7302904c3eaa00801ca4d78fb47797b16427ad4 | [
"MIT"
] | null | null | null | from apps.self_service.models import ApplicationRequest
from django import forms
from django.db.models import fields
from ..api import models
#from api.models import App
#from users.models import User
class RegisterAppForm(forms.ModelForm):
name_of_app = forms.CharField(max_length=255, help_text='Required.Please ... | 39.178571 | 130 | 0.753874 |
1cf022619bfc69b9c8d53346fa0002300a653868 | 3,574 | py | Python | toontown/coghq/BossbotHQExterior.py | LittleNed/toontown-stride | 1252a8f9a8816c1810106006d09c8bdfe6ad1e57 | [
"Apache-2.0"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | toontown/coghq/BossbotHQExterior.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | null | null | null | toontown/coghq/BossbotHQExterior.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | 4 | 2019-06-20T23:45:23.000Z | 2020-10-14T20:30:15.000Z | from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM, State
from direct.fsm import State
from pandac.PandaModules import *
from toontown.battle import BattlePlace
from toontown.building import Elevator
from toontown.coghq import CogHQExterior
from toontown.dna.DNAParser import loadDNAFil... | 42.047059 | 116 | 0.68075 |
1cf0244113be2f05b049aebcee53ed2e09f0fbc9 | 2,256 | py | Python | readthedocs/builds/views.py | gamearming/readthedocs | 53d0094f657f549326a86b8bd0ccf924c2126941 | [
"MIT"
] | null | null | null | readthedocs/builds/views.py | gamearming/readthedocs | 53d0094f657f549326a86b8bd0ccf924c2126941 | [
"MIT"
] | null | null | null | readthedocs/builds/views.py | gamearming/readthedocs | 53d0094f657f549326a86b8bd0ccf924c2126941 | [
"MIT"
] | null | null | null | import logging
from django.shortcuts import get_object_or_404
from django.views.generic import ListView, DetailView
from django.http import HttpResponsePermanentRedirect
from django.conf import settings
from django.core.urlresolvers import reverse
from readthedocs.builds.models import Build, Version
from readthedocs.... | 30.90411 | 98 | 0.717642 |
1cf064ffc152b27b4dfa54542cd7caa2653bbf90 | 7,148 | py | Python | py/setup.py | triffid/kiki | b64b8524063c149a5cc9118f48d80afec1d8a942 | [
"Unlicense"
] | 2 | 2020-01-04T23:44:10.000Z | 2020-07-12T17:10:09.000Z | py/setup.py | triffid/kiki | b64b8524063c149a5cc9118f48d80afec1d8a942 | [
"Unlicense"
] | null | null | null | py/setup.py | triffid/kiki | b64b8524063c149a5cc9118f48d80afec1d8a942 | [
"Unlicense"
] | 1 | 2022-03-16T05:43:33.000Z | 2022-03-16T05:43:33.000Z |
if Controller.isDebugVersion(): print("[setup.py]")
# .................................................................................................................
# KEY SETUP MENU
# ........................................................................................ | 48.62585 | 218 | 0.533156 |
1cf06740a76e8c016632155676b071ba86514574 | 7,002 | py | Python | tilemani/compute/features.py | cocoaaa/TileMani | ca006f201be530af32d7c5dcae03df5daa08359a | [
"MIT"
] | null | null | null | tilemani/compute/features.py | cocoaaa/TileMani | ca006f201be530af32d7c5dcae03df5daa08359a | [
"MIT"
] | null | null | null | tilemani/compute/features.py | cocoaaa/TileMani | ca006f201be530af32d7c5dcae03df5daa08359a | [
"MIT"
] | null | null | null | import osmnx as ox
from typing import Tuple, Dict
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
def get_total_area(G) -> float:
"""Computes the total area (in square meters) of the square maptile of the graph (when it's rasterized)
G: unprojected (ie.e in lat,lng degree crs)
""... | 37.244681 | 107 | 0.630249 |
1cf103ec54aa3d5e8f646249a69c07890922b153 | 6,649 | py | Python | ucscsdk/ucscmethod.py | CiscoUcs/ucscsdk | b582df77e3cf8bc4c48347e3d67f8cffa62f78c4 | [
"Apache-2.0"
] | 9 | 2016-12-22T08:39:25.000Z | 2019-09-10T15:36:19.000Z | ucscsdk/ucscmethod.py | CiscoUcs/ucscsdk | b582df77e3cf8bc4c48347e3d67f8cffa62f78c4 | [
"Apache-2.0"
] | 10 | 2017-01-31T06:59:56.000Z | 2021-11-09T09:14:37.000Z | ucscsdk/ucscmethod.py | CiscoUcs/ucscsdk | b582df77e3cf8bc4c48347e3d67f8cffa62f78c4 | [
"Apache-2.0"
] | 13 | 2016-11-14T07:42:58.000Z | 2022-02-10T17:32:05.000Z | # Copyright 2015 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License prop
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 37.778409 | 74 | 0.583095 |
1cf12e3ce300cff203581d4e3e280a9fdcfcff23 | 4,299 | py | Python | google-machine-learning-crash-course/py/1_tensorflow_example.py | vmarchesin/ml-playground | d9ee805f0fc32bcff244e65aadfd344e24fae8d7 | [
"MIT"
] | null | null | null | google-machine-learning-crash-course/py/1_tensorflow_example.py | vmarchesin/ml-playground | d9ee805f0fc32bcff244e65aadfd344e24fae8d7 | [
"MIT"
] | null | null | null | google-machine-learning-crash-course/py/1_tensorflow_example.py | vmarchesin/ml-playground | d9ee805f0fc32bcff244e65aadfd344e24fae8d7 | [
"MIT"
] | null | null | null | # https://colab.research.google.com/notebooks/mlcc/first_steps_with_tensor_flow.ipynb
from __future__ import print_function
import math
import os
from IPython import display
from matplotlib import cm
from matplotlib import gridspec
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
from sklea... | 35.237705 | 91 | 0.793906 |
1cf14c35724d4c24efd32d86a6f3fe536f35d344 | 2,730 | py | Python | test/integration/ggrc/models/test_assessment_template.py | farcry4998/ggrc-core | c469039dabb55033c1b379850feb19e8dda2e2a1 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-01-04T10:55:14.000Z | 2019-01-04T10:55:14.000Z | test/integration/ggrc/models/test_assessment_template.py | farcry4998/ggrc-core | c469039dabb55033c1b379850feb19e8dda2e2a1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/integration/ggrc/models/test_assessment_template.py | farcry4998/ggrc-core | c469039dabb55033c1b379850feb19e8dda2e2a1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (C) 2018 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Tests for AssessmentTemplate model."""
from ggrc.integrations import constants
from ggrc.models import all_models
from integration.ggrc import TestCase, Api
from integration.ggrc.models import factories
... | 35 | 78 | 0.609158 |
1cf159831d7aebad21b3a1db977bfcd374a50ad2 | 3,097 | py | Python | pml/utils/distance_utils.py | ashadhaz/pml | 8d9261c8885a82d795c89de23f53ff7d05ef9495 | [
"MIT"
] | 2 | 2018-03-21T16:26:16.000Z | 2020-10-27T02:45:11.000Z | pml/utils/distance_utils.py | ashadhaz/pml | 8d9261c8885a82d795c89de23f53ff7d05ef9495 | [
"MIT"
] | null | null | null | pml/utils/distance_utils.py | ashadhaz/pml | 8d9261c8885a82d795c89de23f53ff7d05ef9495 | [
"MIT"
] | 4 | 2015-02-25T16:19:05.000Z | 2021-02-06T06:36:46.000Z | # Copyright (C) 2012, 2013 David Rusk
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish,... | 33.663043 | 80 | 0.714885 |
1cf165b53feb531dceaaeee9e0ed617551cd8b5b | 9,265 | py | Python | ForgeWiki/forgewiki/model/wiki.py | shalithasuranga/allura | 4f7fba13415954d07f602a051ec697329dd3706b | [
"Apache-2.0"
] | null | null | null | ForgeWiki/forgewiki/model/wiki.py | shalithasuranga/allura | 4f7fba13415954d07f602a051ec697329dd3706b | [
"Apache-2.0"
] | null | null | null | ForgeWiki/forgewiki/model/wiki.py | shalithasuranga/allura | 4f7fba13415954d07f602a051ec697329dd3706b | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (t... | 31.948276 | 108 | 0.596438 |
1cf18bd93a2ded94afa828f5cbb8797c58484b50 | 2,710 | py | Python | wifiteng/datastructures.py | MartijnBraam/wifite-ng | fac0c70f7e262ca64f9fcc875ff68c2c8de9459b | [
"BSD-3-Clause"
] | 1 | 2019-04-08T03:18:34.000Z | 2019-04-08T03:18:34.000Z | wifiteng/datastructures.py | MartijnBraam/wifite-ng | fac0c70f7e262ca64f9fcc875ff68c2c8de9459b | [
"BSD-3-Clause"
] | null | null | null | wifiteng/datastructures.py | MartijnBraam/wifite-ng | fac0c70f7e262ca64f9fcc875ff68c2c8de9459b | [
"BSD-3-Clause"
] | null | null | null | from datetime import datetime
class Interface:
def __init__(self, interface, chipset, driver, device):
self.interface = interface
self.chipset = chipset
self.driver = driver
self.device = device
@staticmethod
def from_tuple(input_tuple):
interface = input_tuple[0]... | 30.795455 | 135 | 0.597048 |
1cf1a206372734a4f2c7785ca19d188cebabd395 | 643 | py | Python | advbench/scripts/check_progress.py | constrainedlearning/advbench | 68f9f6d77268aad45517ca84d383b996724cc976 | [
"MIT"
] | 5 | 2021-11-09T13:21:45.000Z | 2022-03-14T21:15:31.000Z | advbench/scripts/check_progress.py | constrainedlearning/advbench | 68f9f6d77268aad45517ca84d383b996724cc976 | [
"MIT"
] | 1 | 2022-03-03T18:56:13.000Z | 2022-03-03T18:58:38.000Z | advbench/scripts/check_progress.py | constrainedlearning/advbench | 68f9f6d77268aad45517ca84d383b996724cc976 | [
"MIT"
] | 3 | 2021-11-02T21:01:44.000Z | 2022-03-23T18:50:49.000Z | import os
import argparse
def main(args):
n_dirs, n_done = 0, 0
for d in os.listdir(args.input_dir):
pth = os.path.join(args.input_dir, d)
if os.path.isdir(pth) is True:
done_pth = os.path.join(pth, 'done')
if os.path.exists(done_pth):
n_done += 1
... | 27.956522 | 84 | 0.606532 |
1cf1b8d36edf0f01594cffafeaa513e0130717df | 12,029 | py | Python | py/resolution/sequence_graph/path_graph_multik_tests.py | AntonBankevich/LJA | 979d7929bf0b39fd142ec6465dc0c17814465ef9 | [
"BSD-3-Clause"
] | 53 | 2021-10-10T22:16:27.000Z | 2022-03-23T06:21:06.000Z | py/resolution/sequence_graph/path_graph_multik_tests.py | AntonBankevich/LJA | 979d7929bf0b39fd142ec6465dc0c17814465ef9 | [
"BSD-3-Clause"
] | 20 | 2021-05-10T07:44:24.000Z | 2022-03-24T13:23:58.000Z | py/resolution/sequence_graph/path_graph_multik_tests.py | AntonBankevich/DR | 73450ad3b25f90a3c7747aaf17fe60d13d9692d3 | [
"BSD-3-Clause"
] | 6 | 2022-01-27T01:45:56.000Z | 2022-03-18T04:23:33.000Z | # (c) 2020 by Authors
# This file is a part of centroFlye program.
# Released under the BSD license (see LICENSE file)
import networkx as nx
from sequence_graph.path_graph_multik import PathMultiKGraph
class DB1:
k = 3
nx_graph = nx.MultiDiGraph()
nx_graph.add_edge(0, 2, string='CCT')
nx_graph.add_ed... | 30.764706 | 76 | 0.454984 |
1cf1c303f3da2a1bf4cb8ac87e4508a969578a04 | 684 | py | Python | model/generator.py | avinashkaitha93/Image-Tag-Assignment | 65f56501a326432dd02f21fce705a0818292dff9 | [
"MIT"
] | null | null | null | model/generator.py | avinashkaitha93/Image-Tag-Assignment | 65f56501a326432dd02f21fce705a0818292dff9 | [
"MIT"
] | null | null | null | model/generator.py | avinashkaitha93/Image-Tag-Assignment | 65f56501a326432dd02f21fce705a0818292dff9 | [
"MIT"
] | null | null | null |
class Generator:
def __init__(self, X1, X2, Y):
self.X1 = X1
self.X2 = X2
self.Y = Y
self.start = 0
self.num_samples = X1.shape[0]
def next_batch(self, batch_size):
end = self.start+batch_size
if end>=self.num_samples:
end = self.nu... | 21.375 | 38 | 0.482456 |
1cf1d8ab34d9c57af600b84632a1daa69bf2e5ac | 2,995 | py | Python | syft/generic/frameworks/attributes.py | Ankit-Dhankhar/PySyft | 750bd2c3987a570ef1dc8554b933696d416724c7 | [
"Apache-2.0"
] | null | null | null | syft/generic/frameworks/attributes.py | Ankit-Dhankhar/PySyft | 750bd2c3987a570ef1dc8554b933696d416724c7 | [
"Apache-2.0"
] | null | null | null | syft/generic/frameworks/attributes.py | Ankit-Dhankhar/PySyft | 750bd2c3987a570ef1dc8554b933696d416724c7 | [
"Apache-2.0"
] | 1 | 2021-04-18T15:27:15.000Z | 2021-04-18T15:27:15.000Z | from abc import ABC
from abc import abstractmethod
from types import ModuleType
from typing import Union
from typing import Callable
from typing import Any
from syft.generic.frameworks.hook import FrameworkHook
class FrameworkAttributes(ABC):
@abstractmethod
def __init__(self, framework: ModuleType, hook: Fr... | 30.252525 | 97 | 0.624374 |
1cf20397357d5bb43bd810fc51fa68807a0f1ee2 | 847 | py | Python | ideaman_rec/Sort/GBDT/GBDT.py | LibRec-Practical/ideaman-offline | f8341fc9ca77adcc1191c01037dda18c02d77b29 | [
"MIT"
] | 1 | 2021-06-21T06:41:12.000Z | 2021-06-21T06:41:12.000Z | ideaman_rec/Sort/GBDT/GBDT.py | LibRec-Practical/ideaman-offline | f8341fc9ca77adcc1191c01037dda18c02d77b29 | [
"MIT"
] | null | null | null | ideaman_rec/Sort/GBDT/GBDT.py | LibRec-Practical/ideaman-offline | f8341fc9ca77adcc1191c01037dda18c02d77b29 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from sklearn.ensemble import GradientBoostingClassifier
from sklearn import metrics
import matplotlib.pylab as plt
from sklearn.model_selection import train_test_split
import sys, os
sys.path.append("../../")
sys.path.extend([os.path.join(root, name) for root, dirs, _ in os.walk... | 19.697674 | 99 | 0.663518 |
1cf207baaf4ac771eb1aaeca200f2ca009fc736e | 6,792 | py | Python | datawinners/main/couchdb/view_updater.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | 1 | 2015-11-02T09:11:12.000Z | 2015-11-02T09:11:12.000Z | datawinners/main/couchdb/view_updater.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | null | null | null | datawinners/main/couchdb/view_updater.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | null | null | null | from collections import defaultdict
from functools import partial
import cPickle
import socket
import os
from time import sleep
import sys
import logging
import jsonpickle
import requests
from django.conf import settings
from datawinners.main.couchdb.utils import all_db_names
DOC_COUNT_THRESHOLD = 2000
COMMITTED_SE... | 35.560209 | 106 | 0.580389 |
1cf21284a3b007a6f087f63d5621286fbbf3d99c | 2,063 | py | Python | edb/pgsql/datasources/deltalog.py | aeros/edgedb | db8c240d1607765799caf124a4b418250e0c0a96 | [
"Apache-2.0"
] | null | null | null | edb/pgsql/datasources/deltalog.py | aeros/edgedb | db8c240d1607765799caf124a4b418250e0c0a96 | [
"Apache-2.0"
] | null | null | null | edb/pgsql/datasources/deltalog.py | aeros/edgedb | db8c240d1607765799caf124a4b418250e0c0a96 | [
"Apache-2.0"
] | null | null | null | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-2010 MagicStack Inc. and the EdgeDB 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://... | 35.568966 | 74 | 0.472613 |
1cf22aec74bd4cda509308d930712a2d2883695f | 3,186 | py | Python | tempest/api/baremetal/admin/test_chassis.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/api/baremetal/admin/test_chassis.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/api/baremetal/admin/test_chassis.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# 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 ... | 37.482353 | 78 | 0.662586 |
1cf26a9b8d92e0b8cf1cfb28c5682516138af977 | 5,798 | py | Python | python/openlattice/models/sms_entity_set_information.py | openlattice/api-clients | 1d5be9861785b295089b732f37464e31bf80c8ca | [
"Apache-2.0"
] | null | null | null | python/openlattice/models/sms_entity_set_information.py | openlattice/api-clients | 1d5be9861785b295089b732f37464e31bf80c8ca | [
"Apache-2.0"
] | 1 | 2021-01-20T00:20:01.000Z | 2021-01-20T00:20:01.000Z | python/openlattice/models/sms_entity_set_information.py | openlattice/api-clients | 1d5be9861785b295089b732f37464e31bf80c8ca | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
OpenLattice API
OpenLattice API # noqa: E501
The version of the OpenAPI document: 0.0.1
Contact: support@openlattice.com
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from openlattice.configuration import Configuration
... | 28.99 | 140 | 0.610038 |
1cf27df0c7c27348d33fe017fe10587cb0cdf270 | 105 | py | Python | setup.py | vluzko/dependency-hell | 1ddf366cee78647d6f4335500ee971282b16c4e3 | [
"MIT"
] | null | null | null | setup.py | vluzko/dependency-hell | 1ddf366cee78647d6f4335500ee971282b16c4e3 | [
"MIT"
] | 10 | 2017-02-19T01:03:10.000Z | 2017-02-23T02:12:51.000Z | setup.py | vluzko/dependency-hell | 1ddf366cee78647d6f4335500ee971282b16c4e3 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name="depydent",
version="1.0",
packages=["depydent"]
)
| 13.125 | 28 | 0.638095 |
1cf2a3c06565bf396299137835299c8520f0bead | 387 | py | Python | src/Python3/A126996/exsample.py | umyuu/Sample | 66e8cd725b682db4c9bf93fb80786eea8cbad19d | [
"MIT"
] | null | null | null | src/Python3/A126996/exsample.py | umyuu/Sample | 66e8cd725b682db4c9bf93fb80786eea8cbad19d | [
"MIT"
] | null | null | null | src/Python3/A126996/exsample.py | umyuu/Sample | 66e8cd725b682db4c9bf93fb80786eea8cbad19d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from janome.tokenizer import Tokenizer
from janome.analyzer import Analyzer
from janome.tokenfilter import *
text = u'すもももももももものうち'
tokenizer = Tokenizer(mmap=True)
token_filters = [POSKeepFilter('名詞'), TokenCountFilter(att='base_form')]
a = Analyzer(tokenizer=tokenizer, token_filters = token_fi... | 29.769231 | 72 | 0.731266 |
1cf2ada853466fcc2dcfd660dcdfbfa50ab28d66 | 4,325 | py | Python | harvest/server.py | webclinic017/harvest | 70c8de717b816fedb32c4d0c88b5544d874083e2 | [
"MIT"
] | null | null | null | harvest/server.py | webclinic017/harvest | 70c8de717b816fedb32c4d0c88b5544d874083e2 | [
"MIT"
] | null | null | null | harvest/server.py | webclinic017/harvest | 70c8de717b816fedb32c4d0c88b5544d874083e2 | [
"MIT"
] | null | null | null | import logging
from flask import Flask, render_template, request, redirect
from werkzeug.security import generate_password_hash, check_password_hash
from flask_cors import CORS
import threading
import json
from flask_login import (
LoginManager,
login_user,
login_required,
logout_user,
current_user... | 23.895028 | 86 | 0.664046 |
1cf2b8d9aebfcb3ed636839d4dd108e5eb398a8e | 377 | py | Python | src/9/defining_decorators_as_part_of_a_class/example2.py | tuanavu/python-gitbook | 948a05e065b0f40afbfd22f697dff16238163cde | [
"MIT"
] | 14 | 2017-05-20T04:06:46.000Z | 2022-01-23T06:48:45.000Z | src/9/defining_decorators_as_part_of_a_class/example2.py | tuanavu/python-gitbook | 948a05e065b0f40afbfd22f697dff16238163cde | [
"MIT"
] | 1 | 2021-06-10T20:17:55.000Z | 2021-06-10T20:17:55.000Z | src/9/defining_decorators_as_part_of_a_class/example2.py | tuanavu/python-gitbook | 948a05e065b0f40afbfd22f697dff16238163cde | [
"MIT"
] | 15 | 2017-03-29T17:57:33.000Z | 2021-08-24T02:20:08.000Z | # Property example
class Person:
first_name = property()
@first_name.getter
def first_name(self):
return self._first_name
@first_name.setter
def first_name(self, value):
if not isinstance(value, str):
raise TypeError('Expected a string')
self._first_name = value... | 20.944444 | 48 | 0.65252 |
1cf2dc62bad067ab1809d7abba55e37fc79c1e1a | 11,783 | py | Python | appengine/findit/services/flake_failure/flake_try_job.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 2 | 2021-04-13T21:22:18.000Z | 2021-09-07T02:11:57.000Z | appengine/findit/services/flake_failure/flake_try_job.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 21 | 2020-09-06T02:41:05.000Z | 2022-03-02T04:40:01.000Z | appengine/findit/services/flake_failure/flake_try_job.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2017 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 google.appengine.ext import ndb
from common import exceptions
from common.findit_http_client import FinditHttpClient
from common.waterfall import failu... | 33.762178 | 80 | 0.687346 |
1cf2f68052893bd934c63d4599f7e0d3e0074560 | 490 | py | Python | test_pyramids/test_cython_categorization.py | leomauro/pyramids | 4f7a8e97e13a5ee0b037dc528e5ba72f31ac36e5 | [
"MIT"
] | 9 | 2015-09-04T22:33:40.000Z | 2019-04-11T14:05:11.000Z | test_pyramids/test_cython_categorization.py | leomauro/pyramids | 4f7a8e97e13a5ee0b037dc528e5ba72f31ac36e5 | [
"MIT"
] | 2 | 2015-09-04T22:31:44.000Z | 2017-07-29T04:11:53.000Z | test_pyramids/test_cython_categorization.py | hosford42/pyramids | 4f7a8e97e13a5ee0b037dc528e5ba72f31ac36e5 | [
"MIT"
] | 3 | 2015-10-14T12:41:26.000Z | 2022-01-08T19:43:47.000Z | """Test suite for Cython categorization code (_categorization.pyx)."""
from pyramids.categorization import Category
def test_repr_eval():
"""Ensure that alternately calling repr() and eval() on a category gets back the original
category unchanged."""
cat = Category("abc", ["def"], ["ghi"])
serialized... | 28.823529 | 93 | 0.691837 |
1cf2fb4e5ea334a07311cb3a7316e89b49d90617 | 1,135 | py | Python | experiment_interface/utils.py | dnnspark/trainer | cdf28eaf22e4b97e11b08d4d04274e2e178f20e3 | [
"MIT"
] | null | null | null | experiment_interface/utils.py | dnnspark/trainer | cdf28eaf22e4b97e11b08d4d04274e2e178f20e3 | [
"MIT"
] | 1 | 2018-11-21T08:01:31.000Z | 2018-11-21T08:01:31.000Z | experiment_interface/utils.py | dnnspark/trainer | cdf28eaf22e4b97e11b08d4d04274e2e178f20e3 | [
"MIT"
] | null | null | null | import numpy as np
def np_encode(x):
'''
Input
=====
x : np.ndarray
Return
======
encoded_array: bytes
encoded_shape: bytes
encoded_dtype: bytes
'''
encoded_array = x.tostring()
encoded_shape = str(x.shape)[1:-1]
encoded_dtype = str(x.dtype)
return encoded_array, encoded_shape, encoded_dtype
de... | 21.018519 | 93 | 0.702203 |
1cf307c12f81e4f084dac1927130bf119a6d2f13 | 1,946 | py | Python | docs/analysis/conf.py | ska-telescope/skampi | cd2f95bd56594888c8d0c3476824b438dfcfcf71 | [
"BSD-3-Clause"
] | null | null | null | docs/analysis/conf.py | ska-telescope/skampi | cd2f95bd56594888c8d0c3476824b438dfcfcf71 | [
"BSD-3-Clause"
] | 3 | 2019-10-25T13:38:56.000Z | 2022-03-30T09:13:33.000Z | docs/analysis/conf.py | ska-telescope/skampi | cd2f95bd56594888c8d0c3476824b438dfcfcf71 | [
"BSD-3-Clause"
] | 2 | 2019-11-04T09:59:06.000Z | 2020-05-07T11:05:42.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 34.140351 | 79 | 0.660843 |
1cf31fe925841cb3bb2b870d9e0786780f5861b0 | 8,831 | py | Python | mitri_van/day_12.py | techartorg/Advent_of_Code_2020 | ae21164bc126352e7a2e9c9c6a0017ccb9d946cc | [
"MIT"
] | 3 | 2020-11-16T15:20:11.000Z | 2020-12-11T17:01:42.000Z | mitri_van/day_12.py | techartorg/Advent_of_Code_2020 | ae21164bc126352e7a2e9c9c6a0017ccb9d946cc | [
"MIT"
] | null | null | null | mitri_van/day_12.py | techartorg/Advent_of_Code_2020 | ae21164bc126352e7a2e9c9c6a0017ccb9d946cc | [
"MIT"
] | 1 | 2020-12-13T04:42:44.000Z | 2020-12-13T04:42:44.000Z | '''
--- Day 12: Rain Risk ---
Your ferry made decent progress toward the island, but the storm came in faster than anyone expected. The ferry needs to take evasive actions!
Unfortunately, the ship's navigation computer seems to be malfunctioning; rather than giving a route directly to safety, it produced extreme... | 33.324528 | 263 | 0.661986 |
1cf330e70247260cd9e50b18903bdfecad6260e4 | 6,818 | py | Python | tensorflow/tools/api/lib/python_object_to_proto_visitor.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 71 | 2017-05-25T16:02:15.000Z | 2021-06-09T16:08:08.000Z | tensorflow/tools/api/lib/python_object_to_proto_visitor.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/tools/api/lib/python_object_to_proto_visitor.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 31 | 2018-09-11T02:17:17.000Z | 2021-12-15T10:33:35.000Z | # 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... | 36.459893 | 80 | 0.684218 |
1cf346c8f866ca2be418e75dd264784b39637d5f | 11,333 | py | Python | btrdb/transformers.py | jacobmas/btrdb-python | a5a897c3822668c84a456677479a81838e729e15 | [
"BSD-3-Clause"
] | null | null | null | btrdb/transformers.py | jacobmas/btrdb-python | a5a897c3822668c84a456677479a81838e729e15 | [
"BSD-3-Clause"
] | 7 | 2021-05-24T17:49:16.000Z | 2022-01-21T13:50:46.000Z | btrdb/transformers.py | jacobmas/btrdb-python | a5a897c3822668c84a456677479a81838e729e15 | [
"BSD-3-Clause"
] | 1 | 2021-06-16T14:56:38.000Z | 2021-06-16T14:56:38.000Z | # btrdb.transformers
# Value transformation utilities
#
# Author: PingThings
# Created: Fri Dec 21 14:57:30 2018 -0500
#
# For license information, see LICENSE.txt
# ID: transformers.py [] allen@pingthings.io $
"""
Value transformation utilities
"""
#################################################################... | 33.332353 | 124 | 0.606018 |
1cf34aaf0f9750b0a25e439b4d9552c72f8a2451 | 5,269 | py | Python | pbc/dft/test/test_ks_noimport.py | gmwang18/pyscf | fcd6877751661c8a9743c1c872a4a2b65f6dd7ac | [
"BSD-2-Clause"
] | null | null | null | pbc/dft/test/test_ks_noimport.py | gmwang18/pyscf | fcd6877751661c8a9743c1c872a4a2b65f6dd7ac | [
"BSD-2-Clause"
] | null | null | null | pbc/dft/test/test_ks_noimport.py | gmwang18/pyscf | fcd6877751661c8a9743c1c872a4a2b65f6dd7ac | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Author: Artem Pulkin <gpulkin@gmail.com>
#
import unittest
import numpy
from pyscf.pbc import gto as pbcgto
from pyscf.pbc import dft as pbcdft
class BN(unittest.TestCase):
"""
Monolayer hexagonal boron nitride simple LDA model compared against
`OpenMX <http://www.openmx-square.... | 40.221374 | 170 | 0.619662 |
1cf3526fd007cba0ade0e35a21e2b67ef4f09493 | 4,247 | py | Python | src/idpproxy/utils.py | rohe/IdPproxy | da0d52222f54d4c1dee8bcf98d1a5407a3349711 | [
"BSD-2-Clause"
] | 9 | 2015-06-25T05:17:03.000Z | 2018-01-10T14:31:09.000Z | src/idpproxy/utils.py | NORDUnet/IdPproxy | 1b2221d8704645ec4b76c27e4ea84b9ce4243e27 | [
"BSD-2-Clause"
] | null | null | null | src/idpproxy/utils.py | NORDUnet/IdPproxy | 1b2221d8704645ec4b76c27e4ea84b9ce4243e27 | [
"BSD-2-Clause"
] | null | null | null | __author__ = 'rohe0002'
import os
import json
from jwkest.jwe import JWE
import logging
logger = logging.getLogger(__name__)
class Info(object):
def __init__(self):
self.ava = {}
def update(self):
return
def get_consumer_key_and_secret(self, social_service, entity_id):
# Consu... | 30.775362 | 80 | 0.528608 |
1cf3549e6b618e89ae46721cfcd31e11f2fc1f09 | 60,977 | py | Python | numba/cuda/cudadrv/driver.py | sighingnow/numba | ae88a6ff4a41f76e50672a1af9d9aa66c205b51b | [
"BSD-2-Clause"
] | null | null | null | numba/cuda/cudadrv/driver.py | sighingnow/numba | ae88a6ff4a41f76e50672a1af9d9aa66c205b51b | [
"BSD-2-Clause"
] | 1 | 2019-05-01T20:39:46.000Z | 2019-05-07T03:43:29.000Z | numba/cuda/cudadrv/driver.py | jdburnet/numba | e8ac4951affacd25c63ba2c18d62a3f12ed7e0ba | [
"BSD-2-Clause"
] | null | null | null | """
CUDA driver bridge implementation
NOTE:
The new driver implementation uses a *_PendingDeallocs* that help prevents a
crashing the system (particularly OSX) when the CUDA context is corrupted at
resource deallocation. The old approach ties resource management directly
into the object destructor; thus, at corruptio... | 31.791971 | 127 | 0.621907 |
1cf36a0f7891a4f0a2190e02090758a81aec26c7 | 1,108 | py | Python | baseline_model/test.py | rtoengi/transfer-learning-for-sign-language-recognition | e0627115e6b68d6b85244d484011bb3895ccf4ee | [
"MIT"
] | 1 | 2021-09-25T14:11:22.000Z | 2021-09-25T14:11:22.000Z | baseline_model/test.py | rtoengi/transfer-learning-for-sign-language-recognition | e0627115e6b68d6b85244d484011bb3895ccf4ee | [
"MIT"
] | null | null | null | baseline_model/test.py | rtoengi/transfer-learning-for-sign-language-recognition | e0627115e6b68d6b85244d484011bb3895ccf4ee | [
"MIT"
] | 4 | 2021-04-10T01:33:03.000Z | 2021-11-11T06:58:59.000Z | from pathlib import Path
from baseline_model.constants import TRAINING_RUNS
from datasets.constants import DatasetName, DatasetType
from datasets.tf_record_utils import tf_record_dataset, transform_for_signum_model
from testing.utils import save_scores, scores_file_exists, display_scores
from training.utils import mod... | 32.588235 | 82 | 0.747292 |
1cf3930eb115273438bce109a3af105ebfd155e7 | 38,100 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_dedicated_hosts_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_dedicated_hosts_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_dedicated_hosts_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.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 may ... | 42.953777 | 206 | 0.668504 |
1cf39348a662557cf4b3dbbac2a5de695a33a53c | 9,976 | py | Python | poold/utils/visualize.py | geflaspohler/poold | 4ddd085597b85e8c737b2f904f504437f728513b | [
"MIT"
] | 7 | 2021-08-02T15:31:01.000Z | 2022-02-11T14:36:46.000Z | poold/utils/visualize.py | geflaspohler/poold | 4ddd085597b85e8c737b2f904f504437f728513b | [
"MIT"
] | null | null | null | poold/utils/visualize.py | geflaspohler/poold | 4ddd085597b85e8c737b2f904f504437f728513b | [
"MIT"
] | 1 | 2021-07-15T23:05:02.000Z | 2021-07-15T23:05:02.000Z | """ Visualizations for online learning.
For example:
import poold
poold.visualize(learner.history)
plt.show()
"""
# System imports
import numpy as np
import pandas as pd
import copy
import os
# Plotting imports
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import mat... | 38.817121 | 147 | 0.658581 |
1cf3bcdb86fe67eaf52511d85bcae58346bd214a | 90 | py | Python | stories/apps.py | mateusz800/blog | a4083a85fb045124cd78ac59895c3bd9afb559dd | [
"MIT"
] | null | null | null | stories/apps.py | mateusz800/blog | a4083a85fb045124cd78ac59895c3bd9afb559dd | [
"MIT"
] | 6 | 2021-03-19T11:06:32.000Z | 2021-04-12T13:11:26.000Z | stories/apps.py | mateusz800/stories | a4083a85fb045124cd78ac59895c3bd9afb559dd | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class ArticlesConfig(AppConfig):
name = 'stories'
| 15 | 33 | 0.755556 |
1cf3bf3108556486c9c5ee5d8f78f36d1ca648e3 | 21 | py | Python | apps/CardinalBanditsPureExploration/algs/LilUCB/__init__.py | sumeetsk/NEXT-1 | c42badbcaeb0ab79ab1f74b6303ecc3864b1c7ee | [
"Apache-2.0"
] | null | null | null | apps/CardinalBanditsPureExploration/algs/LilUCB/__init__.py | sumeetsk/NEXT-1 | c42badbcaeb0ab79ab1f74b6303ecc3864b1c7ee | [
"Apache-2.0"
] | null | null | null | apps/CardinalBanditsPureExploration/algs/LilUCB/__init__.py | sumeetsk/NEXT-1 | c42badbcaeb0ab79ab1f74b6303ecc3864b1c7ee | [
"Apache-2.0"
] | null | null | null | from .LilUCB import * | 21 | 21 | 0.761905 |
1cf3c59d969e437adb777db12eb4be80b40a7e15 | 1,009 | py | Python | app/main/forms.py | Waithera-m/You-Got-This | efc83bd712ffbb5d57acf3c9925389905adf8673 | [
"Unlicense"
] | null | null | null | app/main/forms.py | Waithera-m/You-Got-This | efc83bd712ffbb5d57acf3c9925389905adf8673 | [
"Unlicense"
] | null | null | null | app/main/forms.py | Waithera-m/You-Got-This | efc83bd712ffbb5d57acf3c9925389905adf8673 | [
"Unlicense"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import StringField,TextAreaField,SubmitField,ValidationError
from wtforms.validators import Required
from ..models import User
class EditProfile(FlaskForm):
'''
class facilitates the creation of profile objects
'''
bio = TextAreaField('Let the world know mo... | 33.633333 | 139 | 0.727453 |
1cf3d8959ce9899a145cda06cf8ea8d9f639e2df | 8,266 | py | Python | tests/serializer_base/test_serializer.py | blfoster/python-dataclasses-serialization | 1a2d1fc15ca1800c2b4953fe5cb2557f37d1475d | [
"MIT"
] | 19 | 2019-04-15T15:57:20.000Z | 2021-07-09T07:01:12.000Z | tests/serializer_base/test_serializer.py | blfoster/python-dataclasses-serialization | 1a2d1fc15ca1800c2b4953fe5cb2557f37d1475d | [
"MIT"
] | 14 | 2019-08-01T13:03:53.000Z | 2021-04-20T13:26:54.000Z | tests/serializer_base/test_serializer.py | blfoster/python-dataclasses-serialization | 1a2d1fc15ca1800c2b4953fe5cb2557f37d1475d | [
"MIT"
] | 11 | 2019-06-13T21:38:55.000Z | 2022-02-28T08:53:20.000Z | from dataclasses import asdict, dataclass
from typing import Optional, Union
from unittest import TestCase
from dataclasses_serialization.serializer_base import (
DeserializationError,
SerializationError,
Serializer,
dict_serialization,
noop_deserialization,
noop_serialization,
)
class TestSe... | 34.877637 | 87 | 0.617711 |
1cf401bd3a47b1763fe9ef8f4e6fb39d0880713b | 1,379 | py | Python | firetower/collectors/maildir_client.py | gmcquillan/firetower | 7eafcaea3d428807e1b5578bd325466e47211092 | [
"MIT"
] | 3 | 2015-11-08T11:30:56.000Z | 2019-11-20T07:31:47.000Z | firetower/collectors/maildir_client.py | gmcquillan/firetower | 7eafcaea3d428807e1b5578bd325466e47211092 | [
"MIT"
] | null | null | null | firetower/collectors/maildir_client.py | gmcquillan/firetower | 7eafcaea3d428807e1b5578bd325466e47211092 | [
"MIT"
] | null | null | null | import json
import mailbox
import os
from optparse import OptionParser
from firetower import config
from firetower.redis_util import Redis
"""maildir_client
This is a module designed at allowing you to bootstrap your
firetower data by importing error emails from a maildir format.
"""
def main():
parser = Optio... | 30.644444 | 75 | 0.666425 |
1cf410431361a8b24ade10973b5240f57374d64c | 5,970 | py | Python | test/lmp/util/dset/test_signature.py | ProFatXuanAll/char-RNN | 531f101b3d1ba20bafd28ca060aafe6f583d1efb | [
"Beerware"
] | null | null | null | test/lmp/util/dset/test_signature.py | ProFatXuanAll/char-RNN | 531f101b3d1ba20bafd28ca060aafe6f583d1efb | [
"Beerware"
] | null | null | null | test/lmp/util/dset/test_signature.py | ProFatXuanAll/char-RNN | 531f101b3d1ba20bafd28ca060aafe6f583d1efb | [
"Beerware"
] | null | null | null | """Test :py:mod:`lmp.util.dset` signatures."""
import inspect
from inspect import Parameter, Signature
from typing import Any, Iterator, get_type_hints
import torch
import torch.utils.data
import lmp.util.dset
from lmp.dset import BaseDset
from lmp.tknzr import BaseTknzr
def test_module_attribute() -> None:
"""E... | 29.554455 | 97 | 0.673199 |
1cf41989563e58927b6677e6e061f561f821d6ad | 6,040 | py | Python | apscheduler/triggers/cron/expressions.py | cychenyin/windmill | cc90126f8ba57531b28b1bc722927e8b66dc31b1 | [
"MIT"
] | null | null | null | apscheduler/triggers/cron/expressions.py | cychenyin/windmill | cc90126f8ba57531b28b1bc722927e8b66dc31b1 | [
"MIT"
] | null | null | null | apscheduler/triggers/cron/expressions.py | cychenyin/windmill | cc90126f8ba57531b28b1bc722927e8b66dc31b1 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
This module contains the expressions applicable for CronTrigger's fields.
"""
from calendar import monthrange
import re
from apscheduler.util import asint
__all__ = ('AllExpression', 'RangeExpression', 'WeekdayRangeExpression', 'WeekdayPositionExpression',
'LastDayOfMonthExpression')
... | 31.789474 | 115 | 0.588742 |
1cf468489aa63847b5e5d4caa0c6f4c33a9bf1b0 | 8,588 | py | Python | tests/test_content.py | acutesoftware/rawdata | 9218077a7086fe8a78a4dc508c80a9fae772de13 | [
"MIT"
] | 10 | 2015-06-04T13:05:56.000Z | 2020-01-22T23:58:10.000Z | tests/test_content.py | acutesoftware/rawdata | 9218077a7086fe8a78a4dc508c80a9fae772de13 | [
"MIT"
] | 5 | 2015-06-17T03:57:12.000Z | 2016-06-09T13:37:35.000Z | tests/test_content.py | acutesoftware/rawdata | 9218077a7086fe8a78a4dc508c80a9fae772de13 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# test_content.py
import unittest
import os
import sys
root_fldr = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) + os.sep + 'rawdata'
test_fldr = os.path.dirname(__file__) + os.sep + 'test_results'
sys.path.insert(1, root_fldr)
root_path = root_fldr + os.sep... | 40.319249 | 125 | 0.632161 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.