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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
083ef978939c5f26798c9e5e8bb7b64373e001b2 | 12,507 | py | Python | pydm/tests/widgets/test_baseplot.py | scalverson/pydm | 77f2ad84b072b62e695333dc399339bb32295cb7 | [
"BSD-3-Clause-LBNL"
] | 1 | 2017-07-23T07:11:48.000Z | 2017-07-23T07:11:48.000Z | pydm/tests/widgets/test_baseplot.py | scalverson/pydm | 77f2ad84b072b62e695333dc399339bb32295cb7 | [
"BSD-3-Clause-LBNL"
] | null | null | null | pydm/tests/widgets/test_baseplot.py | scalverson/pydm | 77f2ad84b072b62e695333dc399339bb32295cb7 | [
"BSD-3-Clause-LBNL"
] | null | null | null | import pytest
import logging
from pydm.widgets.timeplot import PyDMTimePlot
from pydm.widgets.waveformplot import WaveformCurveItem
from qtpy.QtGui import QColor
from qtpy.QtCore import QTimer, Qt
from collections import OrderedDict
from ...widgets.baseplot import BasePlotCurveItem, BasePlot
logger = logging.getLogg... | 47.375 | 119 | 0.705285 |
083f48eb70616746bc521d6ebd063f714d12d211 | 57,691 | py | Python | cinder/volume/drivers/coprhd/common.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | cinder/volume/drivers/coprhd/common.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | cinder/volume/drivers/coprhd/common.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2016 EMC Corporation
# 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 requir... | 40.202787 | 79 | 0.541194 |
083f74a1e8e95093e58345a0465362a6fbd2a8e0 | 1,984 | py | Python | src/fetchers/lvNodesInfoFetcher.py | rohit98077/wrldc_mis_weekly_report_generator | 13969db6bf6359e1bd9663d289f903c22d8b7e61 | [
"MIT"
] | null | null | null | src/fetchers/lvNodesInfoFetcher.py | rohit98077/wrldc_mis_weekly_report_generator | 13969db6bf6359e1bd9663d289f903c22d8b7e61 | [
"MIT"
] | null | null | null | src/fetchers/lvNodesInfoFetcher.py | rohit98077/wrldc_mis_weekly_report_generator | 13969db6bf6359e1bd9663d289f903c22d8b7e61 | [
"MIT"
] | null | null | null | import cx_Oracle
import pandas as pd
import datetime as dt
from typing import List, Tuple
from src.typeDefs.lvNodesInfo import ILvNodesInfo
class LvNodesInfoFetcher():
"""This class fetches LV Nodes info for weekly report
"""
def __init__(self, con_string: str):
"""constructor method
Args... | 34.206897 | 99 | 0.578125 |
083fb00524f3c719ad7af7959bdaa6e2e37b22fc | 66,646 | py | Python | stone/ir/data_types.py | mghatak/stone | bade48e44c88481a2386a6b00e7b49f6908d06e2 | [
"MIT"
] | 1 | 2021-12-13T02:17:05.000Z | 2021-12-13T02:17:05.000Z | stone/ir/data_types.py | mghatak/stone | bade48e44c88481a2386a6b00e7b49f6908d06e2 | [
"MIT"
] | 2 | 2021-04-16T20:39:33.000Z | 2021-08-04T03:11:54.000Z | stone/ir/data_types.py | mghatak/stone | bade48e44c88481a2386a6b00e7b49f6908d06e2 | [
"MIT"
] | 1 | 2020-11-04T06:01:11.000Z | 2020-11-04T06:01:11.000Z | """
Defines the Intermediate Representation that is generated by the frontend and
fed to the backends.
The goal of this module is to define all data types that are common to the
languages and serialization formats we want to support.
"""
from __future__ import absolute_import, division, print_function, unicode_litera... | 36.339149 | 98 | 0.598956 |
083fc498ee1a7974a501ca55082fb982927d36eb | 2,327 | py | Python | end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_floats.py | JamesHinshelwood/openapi-python-client | 08bc2acf91d50d4fcdd7f0e50a8b0d3f00a187d9 | [
"MIT"
] | 1 | 2022-02-17T11:45:13.000Z | 2022-02-17T11:45:13.000Z | end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_floats.py | guioliveirabh/openapi-python-client | d8d9cecffe41c5dc1c43bc667598b90f0d9253ca | [
"MIT"
] | null | null | null | end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_floats.py | guioliveirabh/openapi-python-client | d8d9cecffe41c5dc1c43bc667598b90f0d9253ca | [
"MIT"
] | null | null | null | from typing import Any, Dict, List, Optional, cast
import httpx
from ...client import Client
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/tests/basic_lists/floats".format(client.base_url)
headers: Dict[str, str] = client.get_headers()
cookies:... | 18.766129 | 74 | 0.60679 |
084004ac54b464888a5abe33105a3bfc99d742ba | 2,744 | py | Python | google-cloud-sdk/.install/.backup/lib/googlecloudsdk/api_lib/app/wrapper_util.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/.install/.backup/lib/googlecloudsdk/api_lib/app/wrapper_util.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/.install/.backup/lib/googlecloudsdk/api_lib/app/wrapper_util.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:09:01.000Z | 2020-07-25T12:09:01.000Z | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 30.831461 | 78 | 0.676385 |
08400b4fc1623555d8db57dfbc48923016f6e107 | 3,800 | py | Python | wimp/xsec/InteractionModel.py | lopez86/WimpSim | 096cf9f3e3e3d8e4552418a9f4f690593d099160 | [
"MIT"
] | 2 | 2020-09-25T10:48:24.000Z | 2020-12-29T19:56:04.000Z | wimp/xsec/InteractionModel.py | lopez86/WimpSim | 096cf9f3e3e3d8e4552418a9f4f690593d099160 | [
"MIT"
] | 1 | 2017-06-12T01:12:15.000Z | 2017-06-17T06:33:16.000Z | wimp/xsec/InteractionModel.py | lopez86/PyWIMPs | 096cf9f3e3e3d8e4552418a9f4f690593d099160 | [
"MIT"
] | null | null | null | """ InteractionModel.py
Container for interaction properties.
"""
__author__ = "Jeremy P. Lopez"
__date__ = "June 2017"
__copyright__ = "(c) 2017, Jeremy P. Lopez"
from .. import units
from .CrossSection import CrossSection
from .FormFactor import FormFactor
import numpy as np
class InteractionModel:
... | 22.891566 | 63 | 0.526842 |
084032bdd13c62fa8ad6e4cd675b74f4b9edf2d6 | 352 | py | Python | solutions/461/main.py | mattykay/leetcode | 5439e4c0b0f1596462906a40e5b52de4195157e3 | [
"MIT"
] | null | null | null | solutions/461/main.py | mattykay/leetcode | 5439e4c0b0f1596462906a40e5b52de4195157e3 | [
"MIT"
] | null | null | null | solutions/461/main.py | mattykay/leetcode | 5439e4c0b0f1596462906a40e5b52de4195157e3 | [
"MIT"
] | null | null | null | class Solution(object):
def hammingDistance(self, x, y):
"""
:type x: int
:type y: int
:rtype: int
"""
XOR = x ^ y
return str(bin(XOR)[2:]).count('1') # bin() prefixed with 0b to indicate binary, so strip
if __name__ == "__main__":
s = Solution()
ass... | 25.142857 | 97 | 0.528409 |
0840544e88b5b182afadda009762d49897d89d2c | 2,311 | py | Python | nova/compute/hv_type.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 5 | 2016-04-28T16:20:38.000Z | 2021-04-25T11:19:03.000Z | nova/compute/hv_type.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 1 | 2016-04-04T18:41:59.000Z | 2016-04-04T18:41:59.000Z | nova/compute/hv_type.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 5 | 2020-04-08T20:24:45.000Z | 2020-10-05T19:02:13.000Z | # Copyright 2014 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 21.598131 | 78 | 0.675898 |
0840617d26af16acafed412e239f0f2c6dc2e0d9 | 1,043 | py | Python | python/cuXfilter/charts/panel_widgets/panel_widgets.py | AjayThorve/cuxfilter | 537ff67de80439a43e0bad7373558f5e25dcb112 | [
"Apache-2.0"
] | 2 | 2019-03-06T02:10:05.000Z | 2020-05-06T06:33:02.000Z | python/cuXfilter/charts/panel_widgets/panel_widgets.py | AjayThorve/cuxfilter | 537ff67de80439a43e0bad7373558f5e25dcb112 | [
"Apache-2.0"
] | null | null | null | python/cuXfilter/charts/panel_widgets/panel_widgets.py | AjayThorve/cuxfilter | 537ff67de80439a43e0bad7373558f5e25dcb112 | [
"Apache-2.0"
] | null | null | null | from .plots import RangeSlider, IntSlider, FloatSlider, DropDown, MultiSelect, DataSizeIndicator
def range_slider(x, width=400, height=10, data_points=100, step_size=None, step_size_type=int, **params):
return RangeSlider(x, width, height, data_points,step_size, step_size_type, **params)
def int_slider(x, width... | 52.15 | 106 | 0.75743 |
0840a463747ee9ea75d177d5de5b948b19346e8f | 2,104 | py | Python | api_app/models/schemas/user_resource.py | oliver7598/AzureTRE | 38290b91fb694f6dc50a2af9f9376962de8026bd | [
"MIT"
] | 1 | 2022-03-02T19:46:46.000Z | 2022-03-02T19:46:46.000Z | api_app/models/schemas/user_resource.py | frankfanslc/AzureTRE | c6ab21cfdb252b37ca23fde13cf397d519da31a7 | [
"MIT"
] | 1 | 2022-02-21T09:43:20.000Z | 2022-02-21T09:43:20.000Z | api_app/models/schemas/user_resource.py | frankfanslc/AzureTRE | c6ab21cfdb252b37ca23fde13cf397d519da31a7 | [
"MIT"
] | null | null | null | from typing import List
from pydantic import BaseModel, Field
from models.domain.resource import ResourceType
from models.domain.user_resource import UserResource
def get_sample_user_resource(user_resource_id: str) -> dict:
return {
"id": user_resource_id,
"isActive": True,
"ownerId": "a... | 30.941176 | 151 | 0.596483 |
0840bfa4c71d4a0ead60413432d719de4b04f500 | 16,723 | py | Python | test/vanilla/low-level/Expected/AcceptanceTests/BodyIntegerLowLevel/bodyintegerlowlevel/rest/int/_request_builders_py3.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | test/vanilla/low-level/Expected/AcceptanceTests/BodyIntegerLowLevel/bodyintegerlowlevel/rest/int/_request_builders_py3.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | test/vanilla/low-level/Expected/AcceptanceTests/BodyIntegerLowLevel/bodyintegerlowlevel/rest/int/_request_builders_py3.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 1 | 2022-03-28T08:58:03.000Z | 2022-03-28T08:58:03.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 ... | 39.72209 | 114 | 0.693237 |
0840e61123e5ef6703a96f6496cc522ce1ecd427 | 120 | py | Python | Chapter 8/08/PaxHeader/recipe59_test.py | robert0714/Python-Testing-Cookbook-Second-Edition | c7c5d59e42e9ca2874faf12a6dd201736a45ca83 | [
"MIT"
] | null | null | null | Chapter 8/08/PaxHeader/recipe59_test.py | robert0714/Python-Testing-Cookbook-Second-Edition | c7c5d59e42e9ca2874faf12a6dd201736a45ca83 | [
"MIT"
] | null | null | null | Chapter 8/08/PaxHeader/recipe59_test.py | robert0714/Python-Testing-Cookbook-Second-Edition | c7c5d59e42e9ca2874faf12a6dd201736a45ca83 | [
"MIT"
] | null | null | null | 15 uid=2057284
20 ctime=1295323587
20 atime=1295578340
24 SCHILY.dev=234881026
23 SCHILY.ino=29219715
18 SCHILY.nlink=1
| 17.142857 | 23 | 0.825 |
08410e7025bcaac6cf89f78fd901c9424c4e730e | 2,422 | py | Python | luafun/utils/options.py | Delaunay/LuaFun | bd0efd8fc2b064d6bf58993e59a6ad4ac6713b39 | [
"BSD-3-Clause"
] | 1 | 2021-02-06T06:42:29.000Z | 2021-02-06T06:42:29.000Z | luafun/utils/options.py | Delaunay/LuaFun | bd0efd8fc2b064d6bf58993e59a6ad4ac6713b39 | [
"BSD-3-Clause"
] | 6 | 2021-04-08T21:46:06.000Z | 2021-05-09T01:40:04.000Z | luafun/utils/options.py | Delaunay/LuaFun | bd0efd8fc2b064d6bf58993e59a6ad4ac6713b39 | [
"BSD-3-Clause"
] | null | null | null | import copy
import os
import json
def select(a, b):
if a is not None:
return a
return b
def flatten(dictionary):
"""Turn all nested dict keys into a {key}.{subkey} format"""
def _flatten(dictionary):
if dictionary == {}:
return dictionary
key, value = dictionary.... | 24.22 | 81 | 0.668869 |
08411eb79567ef944f245627878c6d2fa85abf3a | 601,710 | py | Python | ibm_watson/discovery_v1.py | jsstylos/waston-developer-cloud-python-sdk | 97de097b8c86622ab2f30f5386bb74321d28addf | [
"Apache-2.0"
] | null | null | null | ibm_watson/discovery_v1.py | jsstylos/waston-developer-cloud-python-sdk | 97de097b8c86622ab2f30f5386bb74321d28addf | [
"Apache-2.0"
] | null | null | null | ibm_watson/discovery_v1.py | jsstylos/waston-developer-cloud-python-sdk | 97de097b8c86622ab2f30f5386bb74321d28addf | [
"Apache-2.0"
] | 1 | 2015-10-07T16:12:10.000Z | 2015-10-07T16:12:10.000Z | # coding: utf-8
# (C) Copyright IBM Corp. 2019, 2022.
#
# 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... | 43.466734 | 155 | 0.609895 |
084123db754a9f030b0fc4b6e83e7c51db407862 | 4,237 | py | Python | tests/atomistics/job/test_atomistic.py | pyiron/pyiron_atomistic | 0cd4c910806f44dfc829ddd642e323efcf7e36d5 | [
"BSD-3-Clause"
] | 14 | 2021-01-18T10:03:56.000Z | 2022-03-01T20:59:35.000Z | tests/atomistics/job/test_atomistic.py | pyiron/pyiron_atomistics | 0cd4c910806f44dfc829ddd642e323efcf7e36d5 | [
"BSD-3-Clause"
] | 569 | 2018-04-12T06:37:14.000Z | 2022-03-31T18:06:27.000Z | tests/atomistics/job/test_atomistic.py | pyiron/pyiron_atomistic | 0cd4c910806f44dfc829ddd642e323efcf7e36d5 | [
"BSD-3-Clause"
] | 6 | 2018-10-23T09:48:48.000Z | 2022-02-13T12:13:00.000Z | # coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
import unittest
import numpy as np
import os
import shutil
from pyiron_atomistics.project import Project
from pyiron_bas... | 44.135417 | 112 | 0.666037 |
08413fedee68daf2c8891b13a1bcc99fe737d487 | 4,420 | py | Python | metalibm_functions/unit_tests/fixed_point.py | nibrunie/metalibm | 776b044f5f323ef907a8724d9ce9a27a482f6cc5 | [
"MIT"
] | 2 | 2019-02-18T13:42:04.000Z | 2021-03-12T18:54:53.000Z | metalibm_functions/unit_tests/fixed_point.py | nibrunie/metalibm | 776b044f5f323ef907a8724d9ce9a27a482f6cc5 | [
"MIT"
] | null | null | null | metalibm_functions/unit_tests/fixed_point.py | nibrunie/metalibm | 776b044f5f323ef907a8724d9ce9a27a482f6cc5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
###############################################################################
# This file is part of metalibm (https://github.com/kalray/metalibm)
###############################################################################
# MIT License
#
# Copyright (c) 2018 Kalray
#
# Permission is here... | 36.528926 | 92 | 0.697964 |
084172a48eac4d34e82ec2377bd803624ba6cd6b | 3,597 | py | Python | py/4. Median of Two Sorted Arrays.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | 3 | 2021-08-07T07:01:34.000Z | 2021-08-07T07:03:02.000Z | py/4. Median of Two Sorted Arrays.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | null | null | null | py/4. Median of Two Sorted Arrays.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | null | null | null | # https://leetcode.com/problems/median-of-two-sorted-arrays/
# Given two sorted arrays nums1 and nums2 of size m and n respectively, return the
# median of the two sorted arrays.
# The overall run time complexity should be O(log (m+n)).
################################################################################... | 39.966667 | 98 | 0.470392 |
08417342d942aa76b482bc97d002c4df2a556895 | 1,403 | py | Python | jumpy/jumpy/spark/dataset.py | zhangy10/deeplearning4j | 9d31156ce600dee6ce4a7fac28286ebbaa211164 | [
"Apache-2.0"
] | 1 | 2018-12-14T02:56:28.000Z | 2018-12-14T02:56:28.000Z | jumpy/jumpy/spark/dataset.py | heronggen/deeplearning4j | 4670eee4f25cef84afca2ba2e2ebf46577968308 | [
"Apache-2.0"
] | null | null | null | jumpy/jumpy/spark/dataset.py | heronggen/deeplearning4j | 4670eee4f25cef84afca2ba2e2ebf46577968308 | [
"Apache-2.0"
] | null | null | null | ################################################################################
# Copyright (c) 2015-2018 Skymind, Inc.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless... | 38.972222 | 101 | 0.632929 |
08418655d7b03cb82ea3cc2dc03c23f29759812f | 18,021 | py | Python | ufora/FORA/Reasoner/SimpleForwardReasoner_test.py | ufora/ufora | 04db96ab049b8499d6d6526445f4f9857f1b6c7e | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | 571 | 2015-11-05T20:07:07.000Z | 2022-01-24T22:31:09.000Z | ufora/FORA/Reasoner/SimpleForwardReasoner_test.py | timgates42/ufora | 04db96ab049b8499d6d6526445f4f9857f1b6c7e | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | 218 | 2015-11-05T20:37:55.000Z | 2021-05-30T03:53:50.000Z | ufora/FORA/Reasoner/SimpleForwardReasoner_test.py | timgates42/ufora | 04db96ab049b8499d6d6526445f4f9857f1b6c7e | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | 40 | 2015-11-07T21:42:19.000Z | 2021-05-23T03:48:19.000Z | # Copyright 2015 Ufora 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 i... | 29.494272 | 187 | 0.4765 |
0841867e19c8db37ae9c8968c832346178389261 | 822 | py | Python | apps/deals/forms.py | ilyukevich/tasks | ba0c8202cfe61d26975c35f388155d36e1c2b856 | [
"MIT"
] | null | null | null | apps/deals/forms.py | ilyukevich/tasks | ba0c8202cfe61d26975c35f388155d36e1c2b856 | [
"MIT"
] | null | null | null | apps/deals/forms.py | ilyukevich/tasks | ba0c8202cfe61d26975c35f388155d36e1c2b856 | [
"MIT"
] | null | null | null | from django import forms
from django.core.exceptions import ValidationError
from pytils.translit import slugify
from .models import Task
class TaskCreateForm(forms.ModelForm):
"""Form for creating an assignment"""
class Meta:
model = Task
fields = '__all__'
# Validation of... | 29.357143 | 75 | 0.592457 |
084192f491db879e32e4e7e1672a3af7a800fc07 | 388,740 | py | Python | positive/physics.py | llondon6/koalas | bc778ba492027b3d40f9c92ef44da5949d0e43c7 | [
"MIT"
] | null | null | null | positive/physics.py | llondon6/koalas | bc778ba492027b3d40f9c92ef44da5949d0e43c7 | [
"MIT"
] | null | null | null | positive/physics.py | llondon6/koalas | bc778ba492027b3d40f9c92ef44da5949d0e43c7 | [
"MIT"
] | null | null | null |
#
from __future__ import print_function
from . import *
from positive.api import *
from positive.plotting import *
from positive.learning import *
# >>>>>>>>>>>> #
# misc.py
# >>>>>>>>>>>> #
# High level function for calculating remant mass and spin
def remnant(m1,m2,chi1,chi2,arxiv=None,verbose=False,L_vec=None):
... | 37.985148 | 1,202 | 0.556272 |
08419ad0805f259256abd1c209705045cf295f8c | 1,529 | py | Python | component/io/frag_io.py | ingdanielguerrero/gwb | 162f7e1a885945814c584a188e78d571a32a9d80 | [
"MIT"
] | null | null | null | component/io/frag_io.py | ingdanielguerrero/gwb | 162f7e1a885945814c584a188e78d571a32a9d80 | [
"MIT"
] | null | null | null | component/io/frag_io.py | ingdanielguerrero/gwb | 162f7e1a885945814c584a188e78d571a32a9d80 | [
"MIT"
] | null | null | null | import json
from .gwb_io import GWBIo
from component import parameter as cp
class FragIo(GWBIo):
def __init__(self):
# the init file
self.file = None
# all the bytes values
self.background = []
self.foreground = []
self.spe_background_1 = []... | 26.824561 | 71 | 0.543492 |
0841b0778a0a5c6ebcdd9d313757d51eff2cce37 | 2,337 | py | Python | nets/superpixels_graph_classification/gat_net.py | SauravMaheshkar/benchmarking-gnns | 4665316322527634c23307556b63291c69dac4b0 | [
"MIT"
] | null | null | null | nets/superpixels_graph_classification/gat_net.py | SauravMaheshkar/benchmarking-gnns | 4665316322527634c23307556b63291c69dac4b0 | [
"MIT"
] | 6 | 2022-01-06T21:27:06.000Z | 2022-01-19T06:28:56.000Z | nets/superpixels_graph_classification/gat_net.py | SauravMaheshkar/benchmarking-gnns | 4665316322527634c23307556b63291c69dac4b0 | [
"MIT"
] | null | null | null | import dgl
import torch.nn as nn
"""
GAT: Graph Attention Network
Graph Attention Networks (Veličković et al., ICLR 2018)
https://arxiv.org/abs/1710.10903
"""
from layers.gat_layer import GATLayer
from layers.mlp_readout_layer import MLPReadout
class GATNet(nn.Module):
def __init__(self, net_params):... | 29.2125 | 72 | 0.53359 |
0841c6c9da0911ec6c5e035a18ef70a633389593 | 449 | py | Python | tests/unit_tests/strategies/test_applicationhostname.py | ivanklee86/unleash-client | daa476537d38085516699a56830ef1f431ced5cf | [
"MIT"
] | 1 | 2018-10-13T19:59:46.000Z | 2018-10-13T19:59:46.000Z | tests/unit_tests/strategies/test_applicationhostname.py | ivanklee86/unleash-client | daa476537d38085516699a56830ef1f431ced5cf | [
"MIT"
] | 27 | 2018-10-03T09:53:48.000Z | 2018-10-27T09:47:14.000Z | tests/unit_tests/strategies/test_applicationhostname.py | ivanklee86/unleash-client | daa476537d38085516699a56830ef1f431ced5cf | [
"MIT"
] | 1 | 2018-10-12T16:09:07.000Z | 2018-10-12T16:09:07.000Z | import pytest
import platform
from UnleashClient.strategies import ApplicationHostname
@pytest.fixture()
def strategy():
yield ApplicationHostname(parameters={"hostNames": "%s,garbage,garbage2" % platform.node()})
def test_applicationhostname(strategy):
assert strategy()
def test_applicationhostname_nomat... | 24.944444 | 96 | 0.781737 |
08420604292c342459632a98c0fbec3d3d8b4fe3 | 85,459 | py | Python | joulescope/decimators.py | tadodotcom/pyjoulescope | ab9645a2774cf5d5355dee4c1e60a566419b0e00 | [
"Apache-2.0"
] | 29 | 2018-12-19T22:42:09.000Z | 2022-01-31T12:26:52.000Z | joulescope/decimators.py | tadodotcom/pyjoulescope | ab9645a2774cf5d5355dee4c1e60a566419b0e00 | [
"Apache-2.0"
] | 23 | 2019-07-21T23:44:46.000Z | 2022-03-11T13:29:11.000Z | joulescope/decimators.py | tadodotcom/pyjoulescope | ab9645a2774cf5d5355dee4c1e60a566419b0e00 | [
"Apache-2.0"
] | 9 | 2019-07-22T00:07:53.000Z | 2021-11-26T11:46:19.000Z | # Copyright 2020 Jetperch LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 724.228814 | 5,027 | 0.764472 |
08423806977d8130b7f63a9fb40a459d467ac23b | 1,281 | py | Python | test_projects/unbind_wheel_event_from_document/main.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | 16 | 2021-04-16T02:01:29.000Z | 2022-01-01T08:53:49.000Z | test_projects/unbind_wheel_event_from_document/main.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | 613 | 2021-03-24T03:37:38.000Z | 2022-03-26T10:58:37.000Z | test_projects/unbind_wheel_event_from_document/main.py | simon-ritchie/apyscript | c319f8ab2f1f5f7fad8d2a8b4fc06e7195476279 | [
"MIT"
] | 2 | 2021-06-20T07:32:58.000Z | 2021-12-26T08:22:11.000Z | """Test project for unbind_wheel_event_from_document interface.
Command examples:
$ python test_projects/unbind_wheel_event_from_document/main.py
"""
import sys
sys.path.append('./')
import os
from types import ModuleType
import apysc as ap
from apysc._file import file_util
this_module: ModuleType... | 22.875 | 67 | 0.671351 |
08424c706297aaafbe19f1fd84b3302c8d6ea91d | 2,198 | py | Python | tests/common/test_run/ascend/greater_run.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | tests/common/test_run/ascend/greater_run.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | tests/common/test_run/ascend/greater_run.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 30 | 2020-07-17T01:04:14.000Z | 2021-12-27T14:05:19.000Z | # Copyright 2019-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... | 38.561404 | 122 | 0.684258 |
08429d9ebcc49193664b9e745ccc15e55b46afe1 | 2,555 | py | Python | example/dataset_load.py | rebeccadavidsson/covid19-sir | ca7a408c5fcf87e4857edd14a9276cae0b6737cf | [
"Apache-2.0"
] | null | null | null | example/dataset_load.py | rebeccadavidsson/covid19-sir | ca7a408c5fcf87e4857edd14a9276cae0b6737cf | [
"Apache-2.0"
] | 100 | 2021-02-06T17:50:15.000Z | 2022-03-31T20:30:49.000Z | example/dataset_load.py | ardhani31/Covid19-SIRV | 813bc66f668a3d2945dc97474ea1149bbc6e40c2 | [
"Apache-2.0"
] | 1 | 2021-09-18T12:36:11.000Z | 2021-09-18T12:36:11.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pathlib import Path
import warnings
import covsirphy as cs
def main():
warnings.simplefilter("error")
# Create output directory in example directory
code_path = Path(__file__)
input_dir = code_path.parent.with_name("input")
output_dir = code_path... | 34.066667 | 79 | 0.70411 |
08429ea530669e9ec58ebd2999d94303970001fc | 1,251 | py | Python | assemblyline/common/path.py | malvidin/assemblyline-base | 6e7de0c15fbca2cf586e33f04df7d3717bd0c0b5 | [
"MIT"
] | null | null | null | assemblyline/common/path.py | malvidin/assemblyline-base | 6e7de0c15fbca2cf586e33f04df7d3717bd0c0b5 | [
"MIT"
] | null | null | null | assemblyline/common/path.py | malvidin/assemblyline-base | 6e7de0c15fbca2cf586e33f04df7d3717bd0c0b5 | [
"MIT"
] | null | null | null | import os
import sys
from typing import Optional, List, AnyStr
def modulepath(modulename: str) -> AnyStr:
m = sys.modules[modulename]
f = getattr(m, '__file__', None)
if not f:
return os.path.abspath(os.getcwd())
return os.path.dirname(os.path.abspath(f))
def splitpath(path: str, sep: Option... | 31.275 | 88 | 0.677858 |
084327ddd05601993dc481ed1067d43764b0bb41 | 19,539 | py | Python | wobble/results.py | lilyling27/wobble | 56cabbfc5574509bcaff484509177b4f3f6d10cc | [
"MIT"
] | null | null | null | wobble/results.py | lilyling27/wobble | 56cabbfc5574509bcaff484509177b4f3f6d10cc | [
"MIT"
] | null | null | null | wobble/results.py | lilyling27/wobble | 56cabbfc5574509bcaff484509177b4f3f6d10cc | [
"MIT"
] | null | null | null | import numpy as np
from scipy.optimize import minimize
import h5py
import tensorflow.compat.v1 as tf
import matplotlib.pyplot as plt
from astropy.table import Table, Column
T = tf.float64
tf.disable_v2_behavior()
from .utils import get_session
COMMON_ATTRS = ['R', 'N', 'orders', 'component_names', 'bervs', 'pipeline_... | 49.591371 | 139 | 0.583551 |
08432eabfcd82539f23d0d8edcf2c603783a49d3 | 6,348 | py | Python | venv/Lib/site-packages/pyrogram/types/messages_and_media/webpage.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/types/messages_and_media/webpage.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/types/messages_and_media/webpage.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.765957 | 96 | 0.598299 |
084345c06cc1dc469757ea7ec80dbb73e9f6b6c4 | 225 | py | Python | py2env/bin/parse_xsd2.py | JonathanRowe/python-saml-master | 81dad60667191e6e1443a770bf779f175ed6beac | [
"MIT"
] | null | null | null | py2env/bin/parse_xsd2.py | JonathanRowe/python-saml-master | 81dad60667191e6e1443a770bf779f175ed6beac | [
"MIT"
] | 2 | 2020-06-06T00:11:05.000Z | 2021-06-10T22:19:47.000Z | py2env/bin/parse_xsd2.py | JonathanRowe/python-saml-master | 81dad60667191e6e1443a770bf779f175ed6beac | [
"MIT"
] | null | null | null | #!/Users/jonathan/Desktop/python-saml-master/py2env/bin/python
# EASY-INSTALL-SCRIPT: 'pysaml2==4.9.0','parse_xsd2.py'
__requires__ = 'pysaml2==4.9.0'
__import__('pkg_resources').run_script('pysaml2==4.9.0', 'parse_xsd2.py')
| 45 | 73 | 0.742222 |
0843941b61faea6a4783199b8e94f3d3f27ba659 | 5,424 | py | Python | mlvajra/model/vajron.py | rajagurunath/mlvajra | abaa40717342cecc785144700884e1c9d5910c43 | [
"Apache-2.0"
] | 2 | 2019-04-22T12:25:05.000Z | 2019-05-05T16:49:12.000Z | mlvajra/model/vajron.py | rajagurunath/mlvajra | abaa40717342cecc785144700884e1c9d5910c43 | [
"Apache-2.0"
] | 9 | 2019-04-06T14:27:22.000Z | 2021-04-30T20:42:19.000Z | mlvajra/model/vajron.py | rajagurunath/mlvajra | abaa40717342cecc785144700884e1c9d5910c43 | [
"Apache-2.0"
] | null | null | null | from ..evaluation import classification_metrics,regression_metrics
try:
from mlflow import (create_experiment, set_experiment, run,ActiveRun ,
log_metric, log_param, set_tag, log_artifacts, log_artifact,
active_run, start_run ,end_run, get_artifact_uri )
except... | 57.094737 | 138 | 0.621128 |
0843c046e4fe6922ee5bf2a7fad95ed1949a2d24 | 1,399 | py | Python | python/learn/PythonDataVisualizationCookbookSE_Code/Chapter 03/ch03-rec15-stacked-plot.py | flyingwjw/Documentation | 567608f388ca369b864c2d75a94647801b5dfa1e | [
"Unlicense"
] | null | null | null | python/learn/PythonDataVisualizationCookbookSE_Code/Chapter 03/ch03-rec15-stacked-plot.py | flyingwjw/Documentation | 567608f388ca369b864c2d75a94647801b5dfa1e | [
"Unlicense"
] | null | null | null | python/learn/PythonDataVisualizationCookbookSE_Code/Chapter 03/ch03-rec15-stacked-plot.py | flyingwjw/Documentation | 567608f388ca369b864c2d75a94647801b5dfa1e | [
"Unlicense"
] | 2 | 2020-09-22T18:37:46.000Z | 2021-09-02T11:02:59.000Z | import pandas as pd
import matplotlib.pyplot as plt
# We load the data with pandas.
df = pd.read_csv('ch03-energy-production.csv')
# We give names for the columns that we want to load. Different types of energy have been ordrered by total production values).
columns = ['Coal', 'Natural Gas (Dry)', 'Crude Oil', 'Nucle... | 36.815789 | 127 | 0.722659 |
0843d28d4b157b12549c858910fc7a9708ba27df | 9,799 | py | Python | synapse/replication/http/_base.py | juhovan/synapse | 57feeab364325374b14ff67ac97c288983cc5cde | [
"Apache-2.0"
] | null | null | null | synapse/replication/http/_base.py | juhovan/synapse | 57feeab364325374b14ff67ac97c288983cc5cde | [
"Apache-2.0"
] | null | null | null | synapse/replication/http/_base.py | juhovan/synapse | 57feeab364325374b14ff67ac97c288983cc5cde | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018 New Vector 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 la... | 38.57874 | 88 | 0.622615 |
0843e28006bed4541d6e9f507c0bc74620a6c322 | 183 | py | Python | Tr4PrFnPredLib/tokenizer/IdentityTokenizer.py | Tr4PrFnPred/TransformerProteinFunctionPredLib | 115dd4105631f96e05409fd9e7f6186ecb5df898 | [
"MIT"
] | 1 | 2021-04-13T21:03:10.000Z | 2021-04-13T21:03:10.000Z | Tr4PrFnPredLib/tokenizer/IdentityTokenizer.py | Tr4PrFnPred/TransformerProteinFunctionPredLib | 115dd4105631f96e05409fd9e7f6186ecb5df898 | [
"MIT"
] | 1 | 2021-04-13T22:27:45.000Z | 2021-04-13T22:27:45.000Z | Tr4PrFnPredLib/tokenizer/IdentityTokenizer.py | Tr4PrFnPred/Tr4PrFnPredLib | 115dd4105631f96e05409fd9e7f6186ecb5df898 | [
"MIT"
] | null | null | null | from .Tokenizer import Tokenizer
import logging
logger = logging.getLogger(__name__)
class IdentityTokenizer(Tokenizer):
def tokenize(self, sequence):
return sequence
| 16.636364 | 36 | 0.759563 |
0843e7d94c99b1a798a846b05cc9ced557906f94 | 310 | py | Python | chapter11/twisted/socket_client.py | yangwawa0323/Learning-Python-Networking-Second-Edition | 5460fe4fb6acc5d0df19bf36e52ac09e9a11eb8b | [
"MIT"
] | 52 | 2018-12-17T19:33:06.000Z | 2022-03-25T18:14:02.000Z | chapter11/twisted/socket_client.py | barretthugh/Learning-Python-Networking-Second-Edition | 0f00b8b20c1c85e76754e47113dff8ca9e99d5ca | [
"MIT"
] | null | null | null | chapter11/twisted/socket_client.py | barretthugh/Learning-Python-Networking-Second-Edition | 0f00b8b20c1c85e76754e47113dff8ca9e99d5ca | [
"MIT"
] | 38 | 2018-12-18T09:08:43.000Z | 2022-02-06T02:53:05.000Z | #!/usr/bin/env python3
from socket import socket
s = socket()
s.connect(("127.0.0.1", 8080))
while True:
output_data = input("Enter message> ")
if output_data:
s.send(output_data.encode())
input_data = s.recv(1024)
if input_data:
print(input_data.decode("utf-8")) | 22.142857 | 45 | 0.616129 |
084425bbeea99e384918f2673aa311cc5cd95fbc | 937 | py | Python | hyperion/models/comment.py | ExiaSR/hyperion | 0b14ef55ed00b964f1966c722f4162c475aa4895 | [
"MIT"
] | 3 | 2019-01-30T03:50:04.000Z | 2019-02-20T00:33:05.000Z | hyperion/models/comment.py | ExiaSR/hyperion | 0b14ef55ed00b964f1966c722f4162c475aa4895 | [
"MIT"
] | 173 | 2019-01-30T08:30:54.000Z | 2019-04-05T19:43:06.000Z | hyperion/models/comment.py | ExiaSR/hyperion | 0b14ef55ed00b964f1966c722f4162c475aa4895 | [
"MIT"
] | 2 | 2019-05-06T22:59:56.000Z | 2020-09-29T03:13:03.000Z | from django.db import models
from django.utils import timezone
from .user import UserProfile
from .post import Post
class Comment(models.Model):
"""
author: UserProfile
create_date: date
post: Post
id: UUID
"""
class Meta:
app_label = "hyperion"
COMMENT_CONTENT_TYPE_CHOICE = ... | 29.28125 | 100 | 0.680896 |
08445d3e95ea293ed3467cac9d419640148f4cf0 | 3,003 | py | Python | config.py | DariHernandez/wonduu-csv-scraper | 2de5c2814998a53bfc844088eedc0d91c0ba6ac1 | [
"MIT"
] | 3 | 2021-09-19T19:51:48.000Z | 2021-11-14T19:52:47.000Z | config.py | DariHernandez/wonduu-csv-scraper | 2de5c2814998a53bfc844088eedc0d91c0ba6ac1 | [
"MIT"
] | null | null | null | config.py | DariHernandez/wonduu-csv-scraper | 2de5c2814998a53bfc844088eedc0d91c0ba6ac1 | [
"MIT"
] | null | null | null | import os
import json
current_file = os.path.basename(__file__)
current_folder = os.path.dirname(__file__)
default_config_path = os.path.join(current_folder, "config.json")
class Config ():
def __init__ (self, config_path=default_config_path, utf8=False):
"""Contructor of class
Args:
... | 29.732673 | 110 | 0.567766 |
08448b14376aeb424a2a8c8410c94a8f407d3027 | 4,561 | py | Python | acme_diags/plot/vcs/lat_lon_plot.py | zshaheen/e3sm_diags | 0317d5634b14221052c0984ad0c1a27ca8484e2e | [
"BSD-3-Clause"
] | null | null | null | acme_diags/plot/vcs/lat_lon_plot.py | zshaheen/e3sm_diags | 0317d5634b14221052c0984ad0c1a27ca8484e2e | [
"BSD-3-Clause"
] | null | null | null | acme_diags/plot/vcs/lat_lon_plot.py | zshaheen/e3sm_diags | 0317d5634b14221052c0984ad0c1a27ca8484e2e | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
import os
import sys
import vcs
import acme_diags
import acme_diags.plot.vcs as utils
from acme_diags.driver.utils.general import get_output_dir
textcombined_objs = {}
def plot(reference, test, diff, metrics_dict, parameter):
vcs_canvas = vcs.init(bg=True, geometry=(
... | 41.09009 | 162 | 0.697435 |
08449494c40e43deb54db1e9fa2a6b3fb2ecb28c | 15,694 | py | Python | numba/analysis.py | sighingnow/numba | ae88a6ff4a41f76e50672a1af9d9aa66c205b51b | [
"BSD-2-Clause"
] | null | null | null | numba/analysis.py | sighingnow/numba | ae88a6ff4a41f76e50672a1af9d9aa66c205b51b | [
"BSD-2-Clause"
] | null | null | null | numba/analysis.py | sighingnow/numba | ae88a6ff4a41f76e50672a1af9d9aa66c205b51b | [
"BSD-2-Clause"
] | null | null | null | """
Utils for IR analysis
"""
import operator
from functools import reduce
from collections import namedtuple, defaultdict
from numba import ir
from numba.controlflow import CFGraph
from numba import types
#
# Analysis related to variable lifetime
#
_use_defs_result = namedtuple('use_defs_result', 'usemap,defmap')
... | 38 | 80 | 0.619918 |
0844e4ef25e77803e974c02a68f1848738835cbc | 784 | py | Python | AnalysisPyAfm/program/util.py | rcmurray/WorkflowComponents | 368f8132ce5bef3ac3fb9d8e1a13a08f91764cfa | [
"BSD-4-Clause-UC"
] | 26 | 2016-09-14T18:15:29.000Z | 2021-12-01T20:01:29.000Z | AnalysisPyAfm/program/util.py | rcmurray/WorkflowComponents | 368f8132ce5bef3ac3fb9d8e1a13a08f91764cfa | [
"BSD-4-Clause-UC"
] | 122 | 2017-09-12T15:22:03.000Z | 2021-09-27T17:25:08.000Z | AnalysisPyAfm/program/util.py | rcmurray/WorkflowComponents | 368f8132ce5bef3ac3fb9d8e1a13a08f91764cfa | [
"BSD-4-Clause-UC"
] | 17 | 2017-02-16T16:04:41.000Z | 2021-02-06T05:36:44.000Z | from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division
from math import log
from math import exp
import numpy as np
def log_one_plus_exp(z):
"""
This function returns log(1 + exp(z)) where it rewrites the terms to re... | 23.058824 | 79 | 0.659439 |
0844f0176f1fe21025bdbe86738c245fa18d1277 | 2,668 | py | Python | leetcode_python/Backtracking/implement-magic-dictionary.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 18 | 2019-08-01T07:45:02.000Z | 2022-03-31T18:05:44.000Z | leetcode_python/Backtracking/implement-magic-dictionary.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Backtracking/implement-magic-dictionary.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 15 | 2019-12-29T08:46:20.000Z | 2022-03-08T14:14:05.000Z | # V0
# V1
# http://bookshadow.com/weblog/2017/09/10/leetcode-implement-magic-dictionary/
import collections
class MagicDictionary(object):
def __init__(self):
"""
Initialize your data structure here.
"""
self.dmap = collections.defaultdict(set)
def buildDict(self, dict):
... | 30.318182 | 116 | 0.54985 |
08450b8c879ec0a018c80c9760703909f793a7e7 | 637 | py | Python | pyhumour/tests/properties/test_compatibility.py | mellon-collie/pyhumour | 7ce3ad56d4c01174c97aea2d52c2a97d56bd64f3 | [
"BSD-3-Clause"
] | 1 | 2021-08-21T15:35:40.000Z | 2021-08-21T15:35:40.000Z | pyhumour/tests/properties/test_compatibility.py | mellon-collie/pyhumour | 7ce3ad56d4c01174c97aea2d52c2a97d56bd64f3 | [
"BSD-3-Clause"
] | 1 | 2021-11-27T07:25:35.000Z | 2021-11-27T07:25:35.000Z | pyhumour/tests/properties/test_compatibility.py | mellon-collie/pyhumour | 7ce3ad56d4c01174c97aea2d52c2a97d56bd64f3 | [
"BSD-3-Clause"
] | 1 | 2021-12-09T08:53:02.000Z | 2021-12-09T08:53:02.000Z | """Unit tests for _properties/compatibility.py."""
# pylint: disable=protected-access
# pylint: disable=invalid-name,missing-docstring
import unittest
from unittest import mock
from pyhumour._properties.compatibility import Compatibility
class TestCompatibility(unittest.TestCase):
def test_calculate(self):
... | 28.954545 | 67 | 0.682889 |
0845195fdd5975b60e93c38f3479c72b38131192 | 24,690 | py | Python | fedml_experiments/distributed/fedavg_cross_silo/main_fedavg_cross_silo.py | Little0o0/FedML | 720015c90fcfec88d465a81b1e8fb45676dce9fb | [
"Apache-2.0"
] | null | null | null | fedml_experiments/distributed/fedavg_cross_silo/main_fedavg_cross_silo.py | Little0o0/FedML | 720015c90fcfec88d465a81b1e8fb45676dce9fb | [
"Apache-2.0"
] | null | null | null | fedml_experiments/distributed/fedavg_cross_silo/main_fedavg_cross_silo.py | Little0o0/FedML | 720015c90fcfec88d465a81b1e8fb45676dce9fb | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import json
import os
import platform
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.getcwd(), "./../../../../")))
sys.path.insert(0, os.path.abspath(os.path.join(os.getcwd(), "./../../../")))
sys.path.insert(0, os.path.abspath(os.path.join(os.getcwd(), "./../../")))
sys.path.inse... | 35.576369 | 140 | 0.650425 |
08451efa2bc7c80f9faa0fcd45f4cf4eca9f2893 | 6,143 | py | Python | atlas/prodtask/helper.py | PanDAWMS/panda-bigmon-atlas | a3688b9ed722a15c0469c8bee84cc9a417670608 | [
"Apache-2.0"
] | null | null | null | atlas/prodtask/helper.py | PanDAWMS/panda-bigmon-atlas | a3688b9ed722a15c0469c8bee84cc9a417670608 | [
"Apache-2.0"
] | 15 | 2015-01-06T13:41:52.000Z | 2022-03-30T10:37:25.000Z | atlas/prodtask/helper.py | PanDAWMS/panda-bigmon-atlas | a3688b9ed722a15c0469c8bee84cc9a417670608 | [
"Apache-2.0"
] | 1 | 2017-07-20T08:01:24.000Z | 2017-07-20T08:01:24.000Z | import threading
class SingletonException(Exception):
pass
_stSingletons = set()
_lockForSingletons = threading.RLock()
_lockForSingletonCreation = threading.RLock() # Ensure only one instance of each Singleton
# class is created. This is not bound to the
... | 39.88961 | 128 | 0.619893 |
08453d74ad12002b9cf044200d818ea08e55775d | 4,162 | py | Python | tflearn/helpers/evaluator.py | lfwin/tflearn | 06015c73a4d9ad9edafeb9b61ee9004fd715f69e | [
"MIT"
] | null | null | null | tflearn/helpers/evaluator.py | lfwin/tflearn | 06015c73a4d9ad9edafeb9b61ee9004fd715f69e | [
"MIT"
] | null | null | null | tflearn/helpers/evaluator.py | lfwin/tflearn | 06015c73a4d9ad9edafeb9b61ee9004fd715f69e | [
"MIT"
] | null | null | null | from __future__ import division, print_function, absolute_import
import tensorflow as tf
import tflearn
from ..utils import to_list
from .. import data_flow
from .. import metrics
from .trainer import evaluate_flow
class Evaluator(object):
""" Evaluator.
A class used for performing predictions and evaluat... | 36.508772 | 79 | 0.574003 |
084563c4ad84f328790029ad9693b509ad75ff20 | 10,236 | py | Python | API/feowl-api/feowl/migrations/0001_initial.py | jplusplus/feowl | f6278d41329f911f30760cb21a387c1cc9fa7a83 | [
"Apache-2.0"
] | null | null | null | API/feowl-api/feowl/migrations/0001_initial.py | jplusplus/feowl | f6278d41329f911f30760cb21a387c1cc9fa7a83 | [
"Apache-2.0"
] | 2 | 2020-06-05T16:54:58.000Z | 2021-06-10T17:35:33.000Z | API/feowl-api/feowl/migrations/0001_initial.py | jplusplus/feowl | f6278d41329f911f30760cb21a387c1cc9fa7a83 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'UserProfile'
db.create_table('feowl_userprofile', (
('id', self.gf('django.db.mo... | 66.901961 | 182 | 0.582454 |
0845b8283de4beca797b315273d97be5e26471c8 | 16,366 | py | Python | src/main/python/cobra/internal/base/moimpl.py | tm0nk/cobra-j | daeb85250e63cb21e9c02ecc2acfdf8ba1e44d6b | [
"Apache-2.0"
] | null | null | null | src/main/python/cobra/internal/base/moimpl.py | tm0nk/cobra-j | daeb85250e63cb21e9c02ecc2acfdf8ba1e44d6b | [
"Apache-2.0"
] | null | null | null | src/main/python/cobra/internal/base/moimpl.py | tm0nk/cobra-j | daeb85250e63cb21e9c02ecc2acfdf8ba1e44d6b | [
"Apache-2.0"
] | null | null | null | # *************************************************************************
# Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
# *************************************************************************
from cobra.mit.naming import Dn
from cobra.mit.naming import Rn
class MoStatus(object):
# Status Co... | 36.943567 | 110 | 0.572834 |
0845d6d4c70bf793605ca3684214dcd77021902d | 9,415 | py | Python | salt/modules/launchctl.py | cbosdo/salt-1 | 9084d662781f9c0944804ba087e652c2ddb730bf | [
"Apache-2.0"
] | null | null | null | salt/modules/launchctl.py | cbosdo/salt-1 | 9084d662781f9c0944804ba087e652c2ddb730bf | [
"Apache-2.0"
] | null | null | null | salt/modules/launchctl.py | cbosdo/salt-1 | 9084d662781f9c0944804ba087e652c2ddb730bf | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Module for the management of MacOS systems that use launchd/launchctl
.. important::
If you feel that Salt should be using this module to manage services on a
minion, and it is using a different module (or gives an error similar to
*'service.start' is not available*), see :ref:`... | 27.609971 | 84 | 0.596707 |
0845f68ed00e4a20468ec3404006bff9bf6c91ee | 2,572 | py | Python | tests/test_ASN1SpecHandler.py | AssaelDan/asn1editor | 8f4917ffe8c5fb8a4925c28239268583cbb6e742 | [
"MIT"
] | 5 | 2021-02-09T08:57:37.000Z | 2022-03-05T09:23:39.000Z | tests/test_ASN1SpecHandler.py | AssaelDan/asn1editor | 8f4917ffe8c5fb8a4925c28239268583cbb6e742 | [
"MIT"
] | 24 | 2020-08-03T09:57:03.000Z | 2022-03-25T10:23:31.000Z | tests/test_ASN1SpecHandler.py | AssaelDan/asn1editor | 8f4917ffe8c5fb8a4925c28239268583cbb6e742 | [
"MIT"
] | 2 | 2020-12-22T21:15:59.000Z | 2021-12-22T15:26:55.000Z | import filecmp
import os
from unittest import TestCase
from asn1editor.ASN1SpecHandler import ASN1SpecHandler
from asn1editor.view.AbstractViewFactory import AbstractViewFactory
class TestASN1SpecHandler(TestCase):
def test_init_and_get_filenames(self):
asn1_spec_handler = ASN1SpecHandler(['example/examp... | 40.1875 | 102 | 0.703344 |
0846316a6996e5da0b7b397c1fd17fb78e142cdf | 21,392 | py | Python | controller/cellar/core/_cluster.py | euxhenh/cellar | 679387216043f3d287ea29a15f78868f412d2948 | [
"MIT"
] | 9 | 2021-09-08T16:56:45.000Z | 2021-12-12T03:13:29.000Z | controller/cellar/core/_cluster.py | euxhenh/cellar | 679387216043f3d287ea29a15f78868f412d2948 | [
"MIT"
] | null | null | null | controller/cellar/core/_cluster.py | euxhenh/cellar | 679387216043f3d287ea29a15f78868f412d2948 | [
"MIT"
] | 1 | 2022-01-20T03:04:44.000Z | 2022-01-20T03:04:44.000Z | import igraph as ig
import leidenalg as la
import numpy as np
from app import logger
from faiss.swigfaiss_avx2 import compute_PQ_dis_tables_dsub2
from scipy.sparse import csr_matrix, issparse
from sklearn.cluster import AgglomerativeClustering, KMeans, SpectralClustering
from sklearn_extra.cluster import KMedoids
from... | 35.126437 | 92 | 0.616819 |
08466a519c8f2af3e501a50594f781a59973252f | 1,640 | py | Python | userbot/plugins/timeprofile.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | userbot/plugins/timeprofile.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | userbot/plugins/timeprofile.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | # Credits by @Hackintush
import asyncio
import time
from telethon.errors import FloodWaitError
from telethon.tl import functions
from uniborg.util import edit_or_reply, sudo_cmd
from userbot import bot as cipherx
from userbot.utils import admin_cmd as cipherx_on_cmd
from userbot import ALIVE_NAME, CMD_HELP
DEL_T... | 25.230769 | 75 | 0.562805 |
0846891f9816b3c74e03ebf73d2ec13b06794419 | 9,515 | py | Python | simulation/evaluator/strategy/belady_min.py | nbelzer/msc-thesis | 91d37305275c988140e32ce15486275e3b984fb5 | [
"Apache-2.0"
] | null | null | null | simulation/evaluator/strategy/belady_min.py | nbelzer/msc-thesis | 91d37305275c988140e32ce15486275e3b984fb5 | [
"Apache-2.0"
] | null | null | null | simulation/evaluator/strategy/belady_min.py | nbelzer/msc-thesis | 91d37305275c988140e32ce15486275e3b984fb5 | [
"Apache-2.0"
] | null | null | null | import pathlib
import argparse
from typing import Tuple
from collections import defaultdict
from simulation.evaluator.instruction_parser import TraceIterator
from simulation.evaluator.instructions import RequestInstruction, SetIterationInstruction
from simulation.generator.utils import read_resource_map
import sys
from... | 38.522267 | 144 | 0.662953 |
08469fb11ecf0167517ad6d6b602ba822214307f | 14,403 | py | Python | Sklearn_scipy_numpy/source/sklearn/learning_curve.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | 4 | 2018-01-21T21:18:35.000Z | 2022-03-23T21:57:56.000Z | Sklearn_scipy_numpy/source/sklearn/learning_curve.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | null | null | null | Sklearn_scipy_numpy/source/sklearn/learning_curve.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | null | null | null | """Utilities to evaluate models with respect to a variable
"""
# Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import warnings
import numpy as np
from .base import is_classifier, clone
from .cross_validation import check_cv
from .externals.joblib import Parallel, delayed
fro... | 42.612426 | 79 | 0.663542 |
0846d28ac7c0edb9bee74a649537c0b39afe4bb2 | 3,127 | py | Python | tools/dockerize/webportal/usr/lib/python2.7/site-packages/daoliproxy/remail.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | 1 | 2019-09-11T11:56:19.000Z | 2019-09-11T11:56:19.000Z | tools/dockerize/webportal/usr/lib/python2.7/site-packages/daoliproxy/remail.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | tools/dockerize/webportal/usr/lib/python2.7/site-packages/daoliproxy/remail.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | users=[
#('testwm', '18611230744', 'wenbo.mao@daolicloud.com', 'g52e90t3'),
#('mingtai101', '13918234299', 'mingtai101@gmail.com', 'fjn7ued1'),
('Yuuki', '15300873506', '18021622551@163.com', 'djnbe9fi'),
('rstevens', '13501099505', '2361228@qq.com', 'bih1g95o'),
('shlallen', '15869045568', 'shlallen@zju.edu.cn', '71i8... | 48.107692 | 93 | 0.626159 |
0846d3a7d944fca7c400f32cec9e659286a8d5bb | 2,386 | py | Python | src/swarm_rescue/tuto_spg_jupyter/tuto_01.py | filliat/swarm-rescue | ce323c90ccb4a25216c63abccd09d3f31eea1189 | [
"MIT"
] | 5 | 2021-11-11T12:19:00.000Z | 2022-03-09T08:47:37.000Z | src/swarm_rescue/tuto_spg_jupyter/tuto_01.py | filliat/swarm-rescue | ce323c90ccb4a25216c63abccd09d3f31eea1189 | [
"MIT"
] | 4 | 2021-11-06T17:19:11.000Z | 2022-02-16T11:46:54.000Z | src/swarm_rescue/tuto_spg_jupyter/tuto_01.py | filliat/swarm-rescue | ce323c90ccb4a25216c63abccd09d3f31eea1189 | [
"MIT"
] | 3 | 2021-11-10T17:14:55.000Z | 2021-11-22T16:32:17.000Z | from simple_playgrounds.playground import SingleRoom
from simple_playgrounds.engine import Engine
from simple_playgrounds.element.elements.basic import Physical
from simple_playgrounds.agent.controllers import Keyboard
from simple_playgrounds.agent.agents import BaseAgent
# matplotlib inline
import matplotlib.pyplot a... | 43.381818 | 124 | 0.784158 |
0847138d3e58ff64eaf86861903307a544447f33 | 11,136 | py | Python | nova/api/openstack/compute/plugins/v3/extended_volumes.py | osrg/nova | 14b6bc655145c832bd9c822e48f877818e0e53ff | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/compute/plugins/v3/extended_volumes.py | osrg/nova | 14b6bc655145c832bd9c822e48f877818e0e53ff | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/compute/plugins/v3/extended_volumes.py | osrg/nova | 14b6bc655145c832bd9c822e48f877818e0e53ff | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 OpenStack Foundation
#
# 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... | 41.864662 | 79 | 0.621408 |
08472e6ac388e61f738ab76b87a54d7739a285fd | 127,963 | py | Python | autoaug/archive.py | bottlenome/cutmix | d18c2bda47e7d1786819420edbb2c8e5ad43385f | [
"MIT"
] | 150 | 2021-12-10T01:21:06.000Z | 2022-03-30T08:13:42.000Z | autoaug/archive.py | ildoonet/pytorch-cutmix | 1bc006b5f40c284a6bf4ef881906e2109a27ef6c | [
"MIT"
] | 6 | 2019-10-16T11:49:36.000Z | 2021-01-11T08:33:07.000Z | autoaug/archive.py | ildoonet/pytorch-cutmix | 1bc006b5f40c284a6bf4ef881906e2109a27ef6c | [
"MIT"
] | 54 | 2021-12-10T03:36:27.000Z | 2022-03-22T11:57:12.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import defaultdict
from autoaug.augmentations import get_augment
def arsaug_policy():
exp0_0 = [
[('Solarize', 0.66, 0.34), ('Equalize', 0.56, 0.61)],
[('Equalize', 0.43,... | 427.9699 | 55,424 | 0.738448 |
08474c5400e01e31cd1cd39a6cb03e477e60b4ff | 447 | py | Python | tests/ibis/test_parser.py | jdpatt/PyAMI | 82b4912496b7c5ca89b20974a5e93eddb2c519de | [
"BSD-2-Clause"
] | null | null | null | tests/ibis/test_parser.py | jdpatt/PyAMI | 82b4912496b7c5ca89b20974a5e93eddb2c519de | [
"BSD-2-Clause"
] | 1 | 2019-03-20T01:33:20.000Z | 2019-04-12T00:22:02.000Z | tests/ibis/test_parser.py | jdpatt/PyAMI | 82b4912496b7c5ca89b20974a5e93eddb2c519de | [
"BSD-2-Clause"
] | null | null | null | from pyibisami.ibis.parser import parse_ibis_file
def test_parse_ibis_file_with_ideal_file(ibis_test_file):
"""Test that pyibisami can parse the template 5.1 ibis model file."""
status_string, ibis_dictionary = parse_ibis_file(ibis_test_file)
assert status_string == "Success!"
assert ibis_dictionary["... | 40.636364 | 73 | 0.753915 |
0847546d7fa264a582abffa1597eecb9e204b8e0 | 11,901 | py | Python | tests/test_metrics.py | EPAENERGYSTAR/epathermostat | 98aaf571fe8e15e1a372567776081fd9dae7e872 | [
"MIT"
] | 12 | 2017-03-08T23:17:44.000Z | 2021-10-15T15:56:30.000Z | tests/test_metrics.py | EPAENERGYSTAR/epathermostat | 98aaf571fe8e15e1a372567776081fd9dae7e872 | [
"MIT"
] | 23 | 2017-10-24T00:07:37.000Z | 2021-07-15T14:42:31.000Z | tests/test_metrics.py | EPAENERGYSTAR/epathermostat | 98aaf571fe8e15e1a372567776081fd9dae7e872 | [
"MIT"
] | 11 | 2017-03-22T22:35:30.000Z | 2021-01-01T22:30:14.000Z | from thermostat.exporters import metrics_to_csv
from thermostat.multiple import multiple_thermostat_calculate_epa_field_savings_metrics
import pandas as pd
import numpy as np
from numpy.testing import assert_allclose
import tempfile
import pytest
from .fixtures.thermostats import thermostat_type_1
from .fixtures.th... | 36.063636 | 118 | 0.735989 |
084768d7d6dc6034a6dd53d5bb5d4a6841161990 | 21,621 | py | Python | QUANTAXIS/QAFetch/QAQuery_Advance.py | simplezhang57/QUANTAXIS | 0fab23ee3cc4048a30b5eed3c311a5c9cdce8110 | [
"MIT"
] | 1 | 2021-01-19T08:33:35.000Z | 2021-01-19T08:33:35.000Z | QUANTAXIS/QAFetch/QAQuery_Advance.py | simplezhang57/QUANTAXIS | 0fab23ee3cc4048a30b5eed3c311a5c9cdce8110 | [
"MIT"
] | 1 | 2019-01-23T04:46:52.000Z | 2019-01-23T04:46:52.000Z | QUANTAXIS/QAFetch/QAQuery_Advance.py | simplezhang57/QUANTAXIS | 0fab23ee3cc4048a30b5eed3c311a5c9cdce8110 | [
"MIT"
] | 1 | 2021-12-12T14:39:22.000Z | 2021-12-12T14:39:22.000Z | # coding: utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
#
# 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 t... | 35.042139 | 147 | 0.630406 |
08477a009be3ed6b46dd22bb88d61a7dacedec49 | 10,367 | py | Python | code_server/run.py | Dragon-M-Ren/grad_code | d814b81adaec709d5dffd737f0c350953cc361fd | [
"Apache-2.0"
] | null | null | null | code_server/run.py | Dragon-M-Ren/grad_code | d814b81adaec709d5dffd737f0c350953cc361fd | [
"Apache-2.0"
] | null | null | null | code_server/run.py | Dragon-M-Ren/grad_code | d814b81adaec709d5dffd737f0c350953cc361fd | [
"Apache-2.0"
] | null | null | null | '''
This script is used to debug te model
Write the code in a new file to test the models
'''
import tensorflow as tf
from utils import *
from model.gcn import GCN
from model.mlp import MLP
from model.firstcheb import FirstCheb
from model.gat import GAT
from model.dcnn import DCNN
from model.spectralcnn import Spectra... | 27.571809 | 124 | 0.687759 |
084783b0918ecc889a52f98bbceba4754ab0f2b4 | 5,013 | py | Python | tests/test_core_routes.py | cangkevin/asain-show-rss-website-wrapper | ca7953e2b764705d1a78c691e1920b2f632e6bc9 | [
"MIT"
] | null | null | null | tests/test_core_routes.py | cangkevin/asain-show-rss-website-wrapper | ca7953e2b764705d1a78c691e1920b2f632e6bc9 | [
"MIT"
] | 46 | 2018-12-16T02:38:34.000Z | 2021-06-01T22:44:45.000Z | tests/test_core_routes.py | cangkevin/asain-show-rss-website-wrapper | ca7953e2b764705d1a78c691e1920b2f632e6bc9 | [
"MIT"
] | 1 | 2019-01-06T04:13:51.000Z | 2019-01-06T04:13:51.000Z | from urllib.parse import urlparse
from pathlib import Path
import requests
import responses
from website.client.utils import (
build_movies_uri,
build_shows_uri,
build_episodes_uri,
build_sources_uri,
)
from website.const import (
MOVIES_RESP_FILE,
EPISODES_RESP_FILE,
SOURCES_RESP_FILE,
... | 28.976879 | 88 | 0.659485 |
08479ed846943738f7eae4a407a986734292aab0 | 3,205 | py | Python | spark-stream-tweets.py | coti92/spark-streaming-twitter-kafka-master | 007b6da6dc2a3a515c57b20fe6d3c63096540321 | [
"MIT"
] | 27 | 2016-03-14T20:37:47.000Z | 2022-02-24T04:03:49.000Z | spark-stream-tweets.py | coti92/spark-streaming-twitter-kafka-master | 007b6da6dc2a3a515c57b20fe6d3c63096540321 | [
"MIT"
] | null | null | null | spark-stream-tweets.py | coti92/spark-streaming-twitter-kafka-master | 007b6da6dc2a3a515c57b20fe6d3c63096540321 | [
"MIT"
] | 16 | 2017-04-11T14:58:59.000Z | 2022-03-23T14:35:02.000Z | #!/usr/bin/env python
from __future__ import print_function
import sys
import json
from pyspark import SparkContext
from pyspark.streaming import StreamingContext
from pyspark.streaming.kafka import KafkaUtils
def get_people_with_hashtags(tweet):
"""
Returns (people, hashtags) if successful, otherwise retur... | 30.52381 | 100 | 0.652418 |
0847ef7b4914676b35fe5134c25da1ab1f5c7345 | 183 | py | Python | Misc/subarray_sum_negative.py | saisankargochhayat/algo_quest | a24f9a22c019ab31d56bd5a7ca5ba790d54ce5dc | [
"Apache-2.0"
] | 3 | 2017-02-15T20:55:04.000Z | 2018-09-26T18:48:24.000Z | Misc/subarray_sum_negative.py | saisankargochhayat/algo_quest | a24f9a22c019ab31d56bd5a7ca5ba790d54ce5dc | [
"Apache-2.0"
] | 4 | 2017-10-07T18:59:20.000Z | 2019-10-08T05:43:25.000Z | Misc/subarray_sum_negative.py | saisankargochhayat/algo_quest | a24f9a22c019ab31d56bd5a7ca5ba790d54ce5dc | [
"Apache-2.0"
] | 1 | 2017-10-08T06:52:21.000Z | 2017-10-08T06:52:21.000Z |
t=int(input())
for i in range(t):
arr=list()
N,X=map(int,input().split())
for j in range(N):
num=int(input())
arr.append(num)
subarray(arr,N,X)
| 11.4375 | 32 | 0.513661 |
0847f5b6434e8f9303848e371759c065a035e48e | 1,230 | py | Python | items/gateway_api/__init__.py | SwatKat1977/intmac | 3559296e7968ac6b9f9737664e92b68cd3e885be | [
"Apache-2.0"
] | null | null | null | items/gateway_api/__init__.py | SwatKat1977/intmac | 3559296e7968ac6b9f9737664e92b68cd3e885be | [
"Apache-2.0"
] | null | null | null | items/gateway_api/__init__.py | SwatKat1977/intmac | 3559296e7968ac6b9f9737664e92b68cd3e885be | [
"Apache-2.0"
] | null | null | null | '''
Copyright 2014-2021 Integrated Test Management Suite
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 ... | 25.625 | 72 | 0.749593 |
0848063d1e67caf360d912ad29ae8ca2c229ac1b | 18,067 | py | Python | a2c_ppo_acktr/storage_ma.py | IouJenLiu/HTS-RL | 7972340c765ef45d2bda353a197b78e0b844f2bd | [
"MIT"
] | 17 | 2020-10-14T02:38:57.000Z | 2022-03-13T16:18:12.000Z | a2c_ppo_acktr/storage_ma.py | IouJenLiu/HTS-RL | 7972340c765ef45d2bda353a197b78e0b844f2bd | [
"MIT"
] | 1 | 2020-12-28T16:40:09.000Z | 2020-12-29T15:31:01.000Z | a2c_ppo_acktr/storage_ma.py | IouJenLiu/HTS-RL | 7972340c765ef45d2bda353a197b78e0b844f2bd | [
"MIT"
] | 2 | 2020-12-21T11:57:51.000Z | 2021-08-30T08:08:23.000Z | import torch
from torch.utils.data.sampler import BatchSampler, SubsetRandomSampler
from a2c_ppo_acktr.storage import RolloutStorage
import time
def _flatten_helper(T, N, _tensor):
return _tensor.view(T * N, *_tensor.size()[2:])
class RolloutStorageMA(object):
def __init__(self, num_steps, num_processes, ob... | 48.178667 | 175 | 0.588753 |
084859366b59c9ca824f5e3cda57dd7f5f76448d | 778 | py | Python | pulser-core/pulser/register/__init__.py | lvignoli/Pulser | 263149799d722023b2f7ab1fe653fbdebb2fe894 | [
"Apache-2.0"
] | null | null | null | pulser-core/pulser/register/__init__.py | lvignoli/Pulser | 263149799d722023b2f7ab1fe653fbdebb2fe894 | [
"Apache-2.0"
] | null | null | null | pulser-core/pulser/register/__init__.py | lvignoli/Pulser | 263149799d722023b2f7ab1fe653fbdebb2fe894 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 Pulser Development Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 40.947368 | 74 | 0.785347 |
08486300614345d3de7088ca26b6bfb62571b659 | 3,124 | py | Python | code/BERT-gloss-tagger.py | Merterm/-Modeling-Intensification-for-SLG | 800fff3d3c7bacc86c1db8382f7c2e68d2f0c074 | [
"MIT"
] | 5 | 2022-03-14T15:52:09.000Z | 2022-03-30T11:42:47.000Z | code/BERT-gloss-tagger.py | Merterm/Modeling-Intensification-for-SLG | 800fff3d3c7bacc86c1db8382f7c2e68d2f0c074 | [
"MIT"
] | null | null | null | code/BERT-gloss-tagger.py | Merterm/Modeling-Intensification-for-SLG | 800fff3d3c7bacc86c1db8382f7c2e68d2f0c074 | [
"MIT"
] | null | null | null | import numpy as np
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
from sklearn.svm import LinearSVC
from sklearn.metrics import accuracy_score, f1_score, recall_score, precision_score
from collections import Counter
import os
import ktrain
from ktrain import text
os.environ["CUDA_DEVICE_... | 24.40625 | 104 | 0.714789 |
084864b813561e953c359241d314ba657f11a011 | 28,198 | py | Python | tests/test_compilesim.py | konman2/PyRTL | dd7d219c59fb1ca0f79092eb9f69c84c45751e91 | [
"BSD-3-Clause"
] | null | null | null | tests/test_compilesim.py | konman2/PyRTL | dd7d219c59fb1ca0f79092eb9f69c84c45751e91 | [
"BSD-3-Clause"
] | null | null | null | tests/test_compilesim.py | konman2/PyRTL | dd7d219c59fb1ca0f79092eb9f69c84c45751e91 | [
"BSD-3-Clause"
] | null | null | null | import unittest
import six
import pyrtl
from pyrtl.corecircuits import _basic_add
# the code below disables testing of CompiledSim on systems where there does
# not appear to be the right version of gcc. This is a not an ideal way to check
# and more work is required to more elegantly check compiledsim across multip... | 36.197689 | 97 | 0.580289 |
0848806b88a57af4086d91072963e713bc3d40f7 | 3,046 | py | Python | analysis/geometry2D.py | buddyd16/theToolbox | b04ca462595af1e90b7c2d1d35527aaf19664b0d | [
"BSD-3-Clause"
] | 1 | 2022-02-21T16:06:22.000Z | 2022-02-21T16:06:22.000Z | analysis/geometry2D.py | buddyd16/theToolbox | b04ca462595af1e90b7c2d1d35527aaf19664b0d | [
"BSD-3-Clause"
] | 2 | 2022-02-10T03:38:50.000Z | 2022-03-02T14:52:43.000Z | analysis/geometry2D.py | buddyd16/theToolbox | b04ca462595af1e90b7c2d1d35527aaf19664b0d | [
"BSD-3-Clause"
] | null | null | null | '''
BSD 3-Clause License
Copyright (c) 2022, Donald N. Bockoven III
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
l... | 37.604938 | 79 | 0.639527 |
0848c5afa2a3bb89fe62db8f0a06d8277c5b4287 | 1,814 | py | Python | bin/stop.py | uwieder/Hillview | 783fcf0399a46961d36cd9eea2369b7ab611662e | [
"Apache-2.0"
] | null | null | null | bin/stop.py | uwieder/Hillview | 783fcf0399a46961d36cd9eea2369b7ab611662e | [
"Apache-2.0"
] | null | null | null | bin/stop.py | uwieder/Hillview | 783fcf0399a46961d36cd9eea2369b7ab611662e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""This Python program stops the Hillview service on the machines specified in the
configuration file."""
# pylint: disable=invalid-name
from argparse import ArgumentParser
from hillviewCommon import ClusterConfiguration, get_config
def stop_webserver(config):
"""Stops the Hillview web ... | 39.434783 | 102 | 0.646637 |
0848e5bd64198710d258ff338ad3dc95e9c3aced | 4,900 | py | Python | tofu/tests/tests07_inversions/test_01_isotropic.py | WinstonLHS/tofu | c95b2eb6aedcf4bac5676752b9635b78f31af6ca | [
"MIT"
] | 6 | 2016-09-15T17:01:19.000Z | 2017-03-06T22:53:10.000Z | tofu/tests/tests07_inversions/test_01_isotropic.py | WinstonLHS/tofu | c95b2eb6aedcf4bac5676752b9635b78f31af6ca | [
"MIT"
] | 9 | 2016-09-14T17:23:52.000Z | 2017-04-13T07:30:07.000Z | tofu/tests/tests07_inversions/test_01_isotropic.py | Didou09/tofu | 4a4e1f058bab8e7556ed9d518f90807cec605476 | [
"MIT"
] | null | null | null | """
This module contains tests for tofu.geom in its structured version
"""
# Built-in
import os
import shutil
import itertools as itt
import warnings
# Standard
import numpy as np
import matplotlib.pyplot as plt
# tofu-specific
from tofu import __version__
import tofu as tf
_here = os.path.abspath(os.path.dirnam... | 27.52809 | 76 | 0.47449 |
08491a3d55a28cf2bfad3e46c058116d111f8839 | 443 | py | Python | src/server/tests/stubs/model_stub.py | sudo-at-night/palmox | 90651be4349ae09c3c1fc77b42eb75901fb10d81 | [
"MIT"
] | 1 | 2021-05-18T07:32:37.000Z | 2021-05-18T07:32:37.000Z | src/server/tests/stubs/model_stub.py | sudo-at-night/palmox | 90651be4349ae09c3c1fc77b42eb75901fb10d81 | [
"MIT"
] | null | null | null | src/server/tests/stubs/model_stub.py | sudo-at-night/palmox | 90651be4349ae09c3c1fc77b42eb75901fb10d81 | [
"MIT"
] | null | null | null | class ModelFilterResultDataStub:
key = "test-1"
one = 1
two = 2
three = 3
class ModelFilterResultStub:
def first(self):
return ModelFilterResultDataStub()
class ModelStub:
"""
A stub for an SQLAlchemy model.
"""
class query:
def filter_by(key):
return... | 18.458333 | 77 | 0.61851 |
08495e58dc4f10932ab693797fd8d1d4c5ce5216 | 6,727 | py | Python | appengine/findit/gae_libs/model/test/versioned_model_test.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 2 | 2021-04-13T21:22:18.000Z | 2021-09-07T02:11:57.000Z | appengine/findit/gae_libs/model/test/versioned_model_test.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 21 | 2020-09-06T02:41:05.000Z | 2022-03-02T04:40:01.000Z | appengine/findit/gae_libs/model/test/versioned_model_test.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2015 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.api import datastore_errors
from google.appengine.ext import ndb
from testing_utils import testing
from gae_libs.model.versioned_mode... | 32.186603 | 77 | 0.708934 |
084963d6bbe7488084bf6a59d8f71bab212f01ca | 294 | py | Python | Home_Work_2_B_Naychuk_Anastasiya/Task6.py | NaychukAnastasiya/goiteens-python3-naychuk | a79d0af238a15f58a822bb5d8e4d48227d4a7bc1 | [
"MIT"
] | null | null | null | Home_Work_2_B_Naychuk_Anastasiya/Task6.py | NaychukAnastasiya/goiteens-python3-naychuk | a79d0af238a15f58a822bb5d8e4d48227d4a7bc1 | [
"MIT"
] | null | null | null | Home_Work_2_B_Naychuk_Anastasiya/Task6.py | NaychukAnastasiya/goiteens-python3-naychuk | a79d0af238a15f58a822bb5d8e4d48227d4a7bc1 | [
"MIT"
] | null | null | null | # Створити функцію " Перетворення годин у секунди ".
# Функція приймає 1 аргумент (hours) і має надрукувати
# кількість секунд ( cкористатися print() )
print("Введіть кількість годин")
hours = float(input())
seconds = hours*60*60
print (hours, "годин/а становить :",seconds,"секунд" ) | 36.75 | 56 | 0.714286 |
0849763fc50c057aac1fb9057de57e3a7a5ac354 | 3,646 | py | Python | intersight/models/equipment_io_expander_ref.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/equipment_io_expander_ref.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/equipment_io_expander_ref.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-255
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class EquipmentIoExpanderRef(object):
"""
NOTE: Thi... | 24.306667 | 77 | 0.546078 |
084990926fefb3c32e870ef586020a246dd10d1a | 2,915 | py | Python | einshape/tests/tensorflow/preprocessing_test.py | LaudateCorpus1/einshape | b1a0e696c20c025074f09071790b97b42754260d | [
"Apache-2.0"
] | 38 | 2021-07-23T12:00:08.000Z | 2022-03-18T08:40:33.000Z | einshape/tests/tensorflow/preprocessing_test.py | deepmind/einshape | aa4b56d3f850204912511c05de3c4b4e767fb2ce | [
"Apache-2.0"
] | 1 | 2022-03-20T23:41:15.000Z | 2022-03-26T03:21:57.000Z | einshape/tests/tensorflow/preprocessing_test.py | LaudateCorpus1/einshape | b1a0e696c20c025074f09071790b97b42754260d | [
"Apache-2.0"
] | 3 | 2021-08-04T16:18:29.000Z | 2021-11-13T14:33:20.000Z | # coding=utf-8
# Copyright 2021 DeepMind 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 applic... | 39.391892 | 75 | 0.733791 |
0849a98a381680a4d64fde869235c8f9781652bd | 2,248 | py | Python | python/akg/ops/nn/ascend/sparse_softmax_cross_entropy_with_logits_ad.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | python/akg/ops/nn/ascend/sparse_softmax_cross_entropy_with_logits_ad.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | python/akg/ops/nn/ascend/sparse_softmax_cross_entropy_with_logits_ad.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 30 | 2020-07-17T01:04:14.000Z | 2021-12-27T14:05:19.000Z | # Copyright 2019-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... | 48.869565 | 119 | 0.675712 |
0849d4f66b215f75759fc76ed94b189e4155f7fb | 559 | py | Python | DL/train.py | xdr940/NPMCM2020 | dba9d943e83eb94ec816bfd972e28274d7c45cee | [
"MIT"
] | null | null | null | DL/train.py | xdr940/NPMCM2020 | dba9d943e83eb94ec816bfd972e28274d7c45cee | [
"MIT"
] | null | null | null | DL/train.py | xdr940/NPMCM2020 | dba9d943e83eb94ec816bfd972e28274d7c45cee | [
"MIT"
] | null | null | null | # Copyright Niantic 2019. Patent Pending. All rights reserved.
#
# This software is licensed under the terms of the Monodepth2 licence
# which allows for non-commercial use only, the full terms of which are made
# available in the LICENSE file.
from __future__ import absolute_import, division, print_function
... | 27.95 | 77 | 0.728086 |
0849e8969d62cf0ed7dee5f18daefaba4d140558 | 2,315 | py | Python | pytrack/simulation.py | petersvenningsson/radar-Bayesian-human-motion | 728db0f39c107faccf9d711670177aac74456e3f | [
"MIT"
] | 1 | 2022-02-01T20:42:24.000Z | 2022-02-01T20:42:24.000Z | pytrack/simulation.py | petersvenningsson/radar-Bayesian-human-motion | 728db0f39c107faccf9d711670177aac74456e3f | [
"MIT"
] | null | null | null | pytrack/simulation.py | petersvenningsson/radar-Bayesian-human-motion | 728db0f39c107faccf9d711670177aac74456e3f | [
"MIT"
] | null | null | null | import numpy as np
from matplotlib import pyplot as plt
from . import processmodels
from . import utils
from . import measmodels
from . import render
from .density import Gaussian
from . import radar_configuration
def simulate_ct_radar():
time_steps = 50
process_model = processmodels.CoordinatedTurnModel( T ... | 39.237288 | 149 | 0.719654 |
084a190089a034816008dc6fdf695cf96c18fd8f | 28,739 | py | Python | dace/transformation/helpers.py | manuelburger/dace | a55f41dbb2a523229361bd161ba38b37d25af86d | [
"BSD-3-Clause"
] | 1 | 2021-07-26T07:58:06.000Z | 2021-07-26T07:58:06.000Z | dace/transformation/helpers.py | manuelburger/dace | a55f41dbb2a523229361bd161ba38b37d25af86d | [
"BSD-3-Clause"
] | null | null | null | dace/transformation/helpers.py | manuelburger/dace | a55f41dbb2a523229361bd161ba38b37d25af86d | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
""" Transformation helper API. """
import copy
import itertools
from networkx import MultiDiGraph
from dace.subsets import Range, Subset, union
import dace.subsets as subsets
from typing import Dict, List, Optional, Tuple, Set
from dace impor... | 39.047554 | 80 | 0.618637 |
084a2447fc230d98ba20546ba0e67ffefd4b8689 | 14,513 | py | Python | lib/cifar10_model.py | chawins/entangle-rep | 3e9e0d6e7536b0de0e35d7f8717f2ccc8e887759 | [
"MIT"
] | 15 | 2019-06-30T12:30:17.000Z | 2021-12-07T20:20:36.000Z | lib/cifar10_model.py | chawins/entangle-rep | 3e9e0d6e7536b0de0e35d7f8717f2ccc8e887759 | [
"MIT"
] | 2 | 2020-06-11T10:10:52.000Z | 2021-12-21T08:50:33.000Z | lib/cifar10_model.py | chawins/entangle-rep | 3e9e0d6e7536b0de0e35d7f8717f2ccc8e887759 | [
"MIT"
] | 9 | 2019-07-09T14:52:30.000Z | 2020-10-27T19:18:34.000Z | '''
Define CIFAR-10 CNN models excluding ResNet models which are in cifar_resnet.py
'''
import copy
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions.normal import Normal
from lib.cifar_resnet import *
class CIFAR10_VAE(nn.Module):
def... | 39.013441 | 80 | 0.567422 |
084a2e271da608c9c51b7efcf7f65eb29221a2d0 | 2,235 | py | Python | tests/measure_tests/numerical_data_tests/chessboard_distance_test.py | cenkbircanoglu/clustering | 0a97fbf43e58e65e8d9eed30eecff00bcd47f093 | [
"MIT"
] | 23 | 2015-01-21T01:39:11.000Z | 2019-08-27T09:43:39.000Z | tests/measure_tests/numerical_data_tests/chessboard_distance_test.py | cenkbircanoglu/clustering | 0a97fbf43e58e65e8d9eed30eecff00bcd47f093 | [
"MIT"
] | 1 | 2015-01-18T08:52:30.000Z | 2015-01-18T08:52:30.000Z | tests/measure_tests/numerical_data_tests/chessboard_distance_test.py | cenkbircanoglu/clustering | 0a97fbf43e58e65e8d9eed30eecff00bcd47f093 | [
"MIT"
] | 6 | 2015-03-23T16:58:18.000Z | 2019-03-12T06:31:56.000Z | # coding=utf-8
from unittest import TestCase
from similarityPy.measure.numerical_data.chessboard_distance import ChessBoardDistance
from tests import test_logger
__author__ = 'cenk'
class ChessBoardDistanceTest(TestCase):
def test_algorithm(self):
test_logger.debug("ChessBoardDistanceTest - test_algori... | 37.881356 | 97 | 0.653244 |
084a502859acb4d953d0954c8872f2d599c34cbf | 574 | py | Python | Task1C.py | anirudhbhalekar/Part1A-FWS-97 | 0de5e84d2bc99fe376b57106c22be4a4d5972acd | [
"MIT"
] | 2 | 2022-02-01T16:38:42.000Z | 2022-02-01T16:38:57.000Z | Task1C.py | anirudhbhalekar/Part1A-FWS-97 | 0de5e84d2bc99fe376b57106c22be4a4d5972acd | [
"MIT"
] | 1 | 2022-02-04T19:56:15.000Z | 2022-02-04T19:56:45.000Z | Task1C.py | anirudhbhalekar/Part1A-FWS-97 | 0de5e84d2bc99fe376b57106c22be4a4d5972acd | [
"MIT"
] | null | null | null | from distutils.command.build import build
from floodsystem.geo import stations_within_radius
from floodsystem.stationdata import build_station_list
centre = (52.2053, 0.1218)
r = 10
def sort_tuple(tup):
tup.sort(key = lambda x: x[0])
return tup
def station_names_within_r(station, centre, r):
st_names =... | 26.090909 | 65 | 0.738676 |
084a5ae070c8ece66429df9284c0514e14fea861 | 5,697 | py | Python | recognition/SubCenter-ArcFace/sample_config.py | dwhite54/insightface | ea172e4921c3960c0684404afff6d0d862447eae | [
"MIT"
] | 12,377 | 2017-12-04T02:46:57.000Z | 2022-03-31T16:48:31.000Z | recognition/SubCenter-ArcFace/sample_config.py | dwhite54/insightface | ea172e4921c3960c0684404afff6d0d862447eae | [
"MIT"
] | 1,851 | 2017-12-05T05:41:23.000Z | 2022-03-30T13:06:22.000Z | recognition/SubCenter-ArcFace/sample_config.py | dwhite54/insightface | ea172e4921c3960c0684404afff6d0d862447eae | [
"MIT"
] | 4,198 | 2017-12-05T02:57:19.000Z | 2022-03-30T10:29:37.000Z | import numpy as np
import os
from easydict import EasyDict as edict
config = edict()
config.bn_mom = 0.9
config.workspace = 256
config.emb_size = 512
config.ckpt_embedding = True
config.net_se = 0
config.net_act = 'prelu'
config.net_unit = 3
config.net_input = 1
config.net_blocks = [1, 4, 6, 2]
config.net_output = 'E... | 25.32 | 63 | 0.737932 |
084a6714d8a529a49cedcfcdf799112ef1e6ab8c | 5,738 | py | Python | osna/mytwitter.py | tapilab/elevate-osna-harassment | 5019a569c88269a86c98ef4a0908d1f25e7e5d2c | [
"MIT"
] | 2 | 2019-07-16T06:23:37.000Z | 2019-07-26T15:17:40.000Z | osna/mytwitter.py | tapilab/elevate-osna-harassment | 5019a569c88269a86c98ef4a0908d1f25e7e5d2c | [
"MIT"
] | 3 | 2021-08-25T15:41:04.000Z | 2022-02-10T00:14:57.000Z | osna/mytwitter.py | tapilab/elevate-osna-harassment | 5019a569c88269a86c98ef4a0908d1f25e7e5d2c | [
"MIT"
] | null | null | null | """
Wrapper for Twitter API.
"""
from itertools import cycle
import json
import requests
import sys
import time
import traceback
from TwitterAPI import TwitterAPI
RATE_LIMIT_CODES = set([88, 130, 420, 429])
class Twitter:
def get_twitter(credential_file):
""" Read the credential_file and construct an instance of ... | 31.701657 | 93 | 0.679157 |
084ab666467419f294a9de36bb67783acad1cd28 | 10,277 | py | Python | fairseq/modules/multihead_attention.py | ghchen18/leca | 325c3112d325e671cd5f3ba5f2c7a7bf19abd5e6 | [
"BSD-3-Clause"
] | 11 | 2020-09-30T00:43:58.000Z | 2022-02-25T01:39:08.000Z | fairseq/modules/multihead_attention.py | ghchen18/leca | 325c3112d325e671cd5f3ba5f2c7a7bf19abd5e6 | [
"BSD-3-Clause"
] | 13 | 2020-07-30T08:08:07.000Z | 2022-03-04T01:17:33.000Z | fairseq/modules/multihead_attention.py | ghchen18/leca | 325c3112d325e671cd5f3ba5f2c7a7bf19abd5e6 | [
"BSD-3-Clause"
] | 5 | 2021-05-18T06:50:15.000Z | 2022-02-18T04:42:31.000Z | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import torch
from torch import nn
... | 40.944223 | 114 | 0.601829 |
084aba231039ace1befafa920dd9d09a2fb92496 | 30,215 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_availability_sets_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_availability_sets_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_availability_sets_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 ... | 40.941734 | 204 | 0.670627 |
084ac8f1686c58ab7da0285cf02feb2932346d5d | 2,437 | py | Python | modules/tools/mapshow/subplot_speed.py | DavidSplit/apollo-3.0 | 9f82838e857e4c9146952946cbc34b9f35098deb | [
"Apache-2.0"
] | 6 | 2019-10-11T07:57:49.000Z | 2022-02-23T15:23:41.000Z | modules/tools/mapshow/subplot_speed.py | DavidSplit/apollo-3.0 | 9f82838e857e4c9146952946cbc34b9f35098deb | [
"Apache-2.0"
] | null | null | null | modules/tools/mapshow/subplot_speed.py | DavidSplit/apollo-3.0 | 9f82838e857e4c9146952946cbc34b9f35098deb | [
"Apache-2.0"
] | 12 | 2019-10-11T07:57:49.000Z | 2022-03-16T05:13:00.000Z | #!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
# Modifications Copyright (c) 2018 LG Electronics, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not ... | 38.078125 | 79 | 0.568732 |
084af461ebf7c79c50e2b00977b999e03f5e7172 | 908 | py | Python | questioner/apps/helpers/validators.py | sam-karis/questioner-api | bbffe431cc94fc2eeaae29600fb546a1f483920d | [
"MIT"
] | null | null | null | questioner/apps/helpers/validators.py | sam-karis/questioner-api | bbffe431cc94fc2eeaae29600fb546a1f483920d | [
"MIT"
] | null | null | null | questioner/apps/helpers/validators.py | sam-karis/questioner-api | bbffe431cc94fc2eeaae29600fb546a1f483920d | [
"MIT"
] | null | null | null | import re
from rest_framework import serializers
class Validators(object):
def is_valid_password(self, password):
if not re.match(r'^(?=.*[A-Za-z])(?=.*[0-9])(?=.*[^A-Za-z0-9]).*', password): # noqa E501
raise serializers.ValidationError(
'Password must contain a number, capi... | 36.32 | 100 | 0.603524 |
084b027e746f1150db941dcdf2a995f4278d2395 | 1,445 | py | Python | motor/stimuli.py | gjheij/experiments | 4eddce164a9e48823f5807ce5037d785b5224417 | [
"MIT"
] | null | null | null | motor/stimuli.py | gjheij/experiments | 4eddce164a9e48823f5807ce5037d785b5224417 | [
"MIT"
] | null | null | null | motor/stimuli.py | gjheij/experiments | 4eddce164a9e48823f5807ce5037d785b5224417 | [
"MIT"
] | null | null | null | import numpy as np
from psychopy.visual import TextStim, ShapeStim, RadialStim, MovieStim3
class FixationCross(object):
def __init__(self, win, lineWidth, color, *args, **kwargs):
self.color = color
self.linewidth = lineWidth
self.fixation = ShapeStim(win,
... | 37.051282 | 130 | 0.60346 |
084b0ddac227b5fdcc8a370e6aeab684da0c7aab | 2,913 | py | Python | influxdb_client/domain/users_links.py | kelseiv/influxdb-client-python | 9a0d2d659157cca96f6a04818fdeb215d699bdd7 | [
"MIT"
] | 1 | 2021-06-06T10:39:47.000Z | 2021-06-06T10:39:47.000Z | influxdb_client/domain/users_links.py | kelseiv/influxdb-client-python | 9a0d2d659157cca96f6a04818fdeb215d699bdd7 | [
"MIT"
] | null | null | null | influxdb_client/domain/users_links.py | kelseiv/influxdb-client-python | 9a0d2d659157cca96f6a04818fdeb215d699bdd7 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Influx API Service
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: 0.1.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class User... | 25.778761 | 124 | 0.548232 |
084b5223c04b626159f792476a2aafb7a5c75009 | 2,346 | py | Python | sessions/003 session-numbers/exercises/calc-codealong-advanced.py | robotlightsyou/pfb-resources | 3623f54d87f7eddb0ea858d14845552d356643a9 | [
"MIT"
] | null | null | null | sessions/003 session-numbers/exercises/calc-codealong-advanced.py | robotlightsyou/pfb-resources | 3623f54d87f7eddb0ea858d14845552d356643a9 | [
"MIT"
] | 2 | 2021-04-21T05:12:55.000Z | 2021-04-21T05:15:04.000Z | sessions/003 session-numbers/exercises/calc-codealong-advanced.py | robotlightsyou/pfb-resources | 3623f54d87f7eddb0ea858d14845552d356643a9 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
"""
This program is a basic calculator providing the user addition,
subtraction, multiplication, float division, integer division,
and the modulo operation.
"""
def main():
"""
ask user what function to perform, take input, use control flow to
print return of desired function, ... | 26.659091 | 86 | 0.581415 |
084b5806b4559d1c055278d5dd27861968182c03 | 3,494 | py | Python | utils/model_saver.py | katjaschwarz/layout2im | f931a09e349941a760ef89c97ee5515058c510a1 | [
"Apache-2.0"
] | null | null | null | utils/model_saver.py | katjaschwarz/layout2im | f931a09e349941a760ef89c97ee5515058c510a1 | [
"Apache-2.0"
] | null | null | null | utils/model_saver.py | katjaschwarz/layout2im | f931a09e349941a760ef89c97ee5515058c510a1 | [
"Apache-2.0"
] | null | null | null | import os
import re
import torch
from pathlib import Path
def prepare_dir(name):
log_save_dir = 'checkpoints/{}/logs'.format(name)
model_save_dir = 'checkpoints/{}/models'.format(name)
sample_save_dir = 'checkpoints/{}/samples'.format(name)
result_save_dir = 'checkpoints/{}/results'.format(name)
... | 35.292929 | 89 | 0.585575 |
084be5a5d676a6549b3c9590a5b69bfea45ea8ec | 1,068 | py | Python | usaspending_api/accounts/urls_federal_accounts_v2.py | animatecitizen/usaspending-api | 556511ff51fe80a8be8361daa5876fd684a04efe | [
"CC0-1.0"
] | null | null | null | usaspending_api/accounts/urls_federal_accounts_v2.py | animatecitizen/usaspending-api | 556511ff51fe80a8be8361daa5876fd684a04efe | [
"CC0-1.0"
] | 3 | 2020-02-12T01:16:46.000Z | 2021-06-10T20:36:57.000Z | usaspending_api/accounts/urls_federal_accounts_v2.py | COEJKnight/five | 0777303f4bee60a10afaccbd0f5c56d880ad0059 | [
"CC0-1.0"
] | null | null | null | from django.conf.urls import url
from usaspending_api.accounts.views import federal_accounts_v2 as views
# bind ViewSets to URLs
object_class_federal_accounts = views.ObjectClassFederalAccountsViewSet.as_view()
fiscal_year_snapshot_federal_accounts = views.FiscalYearSnapshotFederalAccountsViewSet.as_view()
spending_o... | 53.4 | 105 | 0.799625 |
084becb089eee5665d11016c3355f9b3ed6b782c | 89 | py | Python | idlib/systems/isni.py | tgbugs/idlib | 4760322b023cc38a8f6800141fe8735d10fa014a | [
"MIT"
] | 2 | 2021-11-28T23:52:48.000Z | 2022-02-17T18:12:32.000Z | idlib/systems/isni.py | tgbugs/idlib | 4760322b023cc38a8f6800141fe8735d10fa014a | [
"MIT"
] | 2 | 2020-05-22T10:40:58.000Z | 2022-01-05T22:38:06.000Z | idlib/systems/isni.py | tgbugs/idlib | 4760322b023cc38a8f6800141fe8735d10fa014a | [
"MIT"
] | null | null | null | import idlib
class ISNI(idlib.Identifier): # has a uri representation ...
""" """
| 14.833333 | 61 | 0.629213 |
084c152a93d33ac23bd2e1f050e46de20cd0f82d | 477 | py | Python | api/src/generic_handler.py | Aragos/tichu-tournament | 4cdf727a30af8820ad56fe3097ec9a8e84892068 | [
"MIT"
] | 7 | 2016-12-12T02:29:42.000Z | 2020-05-12T21:21:21.000Z | api/src/generic_handler.py | Aragos/tichu-tournament | 4cdf727a30af8820ad56fe3097ec9a8e84892068 | [
"MIT"
] | 31 | 2017-01-05T06:07:28.000Z | 2018-05-27T13:13:06.000Z | api/src/generic_handler.py | Aragos/tichu-tournament | 4cdf727a30af8820ad56fe3097ec9a8e84892068 | [
"MIT"
] | 3 | 2017-12-21T23:30:12.000Z | 2019-01-03T20:51:52.000Z | import sys
import traceback
import webapp2
from handler_utils import SetErrorStatus
class GenericHandler(webapp2.RequestHandler):
''' Generic handler that all server side handler should extend. '''
#def handle_exception(self, exception, debug_mode):
# ''' Save relevant error details in any unexpected excepti... | 31.8 | 75 | 0.771488 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.