hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
04877321d7346de18c008eda4da9ef7235b7af55 | 1,545 | py | Python | setup.py | dyyni/pyVat | bb6aaeb4abcf1cfddbd5f7ea57521944b33fdac6 | [
"MIT"
] | 3 | 2020-09-19T23:08:01.000Z | 2022-02-07T16:53:31.000Z | setup.py | dyyni/pyVat | bb6aaeb4abcf1cfddbd5f7ea57521944b33fdac6 | [
"MIT"
] | null | null | null | setup.py | dyyni/pyVat | bb6aaeb4abcf1cfddbd5f7ea57521944b33fdac6 | [
"MIT"
] | 4 | 2020-03-02T19:12:35.000Z | 2020-10-02T10:42:59.000Z | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="vat-format-checker",
version="0.0.4",
author="Radu Boncea",
author_email="radu.boncea@gmail.com",
description="A library for checking on European VAT formats",
long_description=long_d... | 35.113636 | 71 | 0.611003 |
c0408fef7e979c6afea86ff93f59d7bfa494e495 | 2,522 | py | Python | python/src/nnabla/backward_function/log_sigmoid.py | sdonatti/nnabla | ac4a42e62dd358f16bd79c08a9a9f3d83c0100c9 | [
"Apache-2.0"
] | 1 | 2020-08-03T12:49:19.000Z | 2020-08-03T12:49:19.000Z | python/src/nnabla/backward_function/log_sigmoid.py | sdonatti/nnabla | ac4a42e62dd358f16bd79c08a9a9f3d83c0100c9 | [
"Apache-2.0"
] | 1 | 2020-11-09T07:33:29.000Z | 2020-11-09T07:33:29.000Z | python/src/nnabla/backward_function/log_sigmoid.py | sdonatti/nnabla | ac4a42e62dd358f16bd79c08a9a9f3d83c0100c9 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017 Sony 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 required by applicabl... | 35.027778 | 74 | 0.615385 |
a5b8d04f0ba7c968777d09ec3967bffc158a06fa | 6,988 | py | Python | MidiController.py | mattipt/obs-nk | 8bde655d1f92d1f0b528ade8b6ad5aadcd12ee5d | [
"MIT"
] | 3 | 2020-06-07T01:28:32.000Z | 2020-09-24T22:51:09.000Z | MidiController.py | mattipt/obs-nk | 8bde655d1f92d1f0b528ade8b6ad5aadcd12ee5d | [
"MIT"
] | null | null | null | MidiController.py | mattipt/obs-nk | 8bde655d1f92d1f0b528ade8b6ad5aadcd12ee5d | [
"MIT"
] | null | null | null | import mido
import sys
import time
from collections import OrderedDict
class Controller:
def __init__(self, name='', channel=0):
"""
Initialise a connection to a MIDI device.
Makes a connection to the first MIDI device matching the substring.
Args:
name (str): Substrin... | 41.844311 | 114 | 0.543646 |
964af8e2168a9c6e35356fa640499fb7072c3b24 | 3,149 | py | Python | implementations/PointNet/MLP_tf2.py | PointCloudYC/PointCloud-Architectures | ff38033401badf264573c01c9d836b148f7d6e4a | [
"MIT"
] | 5 | 2020-08-17T04:23:04.000Z | 2021-10-02T03:30:08.000Z | implementations/PointNet/MLP_tf2.py | PointCloudYC/PointCloud-Architectures | ff38033401badf264573c01c9d836b148f7d6e4a | [
"MIT"
] | null | null | null | implementations/PointNet/MLP_tf2.py | PointCloudYC/PointCloud-Architectures | ff38033401badf264573c01c9d836b148f7d6e4a | [
"MIT"
] | 1 | 2021-03-18T03:29:10.000Z | 2021-03-18T03:29:10.000Z | '''
1. import modules
'''
import numpy as np
from tensorflow.keras.models import Sequential, Model
from tensorflow.keras.layers import Input, Dense, Conv2D, Activation, BatchNormalization
import tensorflow as tf
np.random.seed(1234)
tf.random.set_seed(1234)
'''
2. load data
'''
(x_train,y_train),(x_test, y_test) = t... | 26.024793 | 88 | 0.68625 |
cd105c9c8cab374e6086d28bf0a37d91765b3663 | 2,363 | py | Python | sagas/nlu/uni_impl_knp.py | samlet/stack | 47db17fd4fdab264032f224dca31a4bb1d19b754 | [
"Apache-2.0"
] | 3 | 2020-01-11T13:55:38.000Z | 2020-08-25T22:34:15.000Z | sagas/nlu/uni_impl_knp.py | samlet/stack | 47db17fd4fdab264032f224dca31a4bb1d19b754 | [
"Apache-2.0"
] | null | null | null | sagas/nlu/uni_impl_knp.py | samlet/stack | 47db17fd4fdab264032f224dca31a4bb1d19b754 | [
"Apache-2.0"
] | 1 | 2021-01-01T05:21:44.000Z | 2021-01-01T05:21:44.000Z | from typing import Text, Any, Dict, List
from sagas.nlu.uni_intf import RootWordImpl, WordIntf, SentenceIntf
class KnpWordImpl(WordIntf):
def __init__(self, data, deps):
self.deps = deps
super().__init__(data)
def setup(self, tag):
from sagas.ja.knp_helper import get_by_keyset, tag_pos... | 36.921875 | 100 | 0.595853 |
8d0e47d4ce33cf7b9c2f1613e397913ea17b9e86 | 2,736 | py | Python | saleor/api/customer/views.py | glosoftgroup/restaurant | 5b10a8f5199103e5bee01b45952c9638e63f28af | [
"BSD-3-Clause"
] | null | null | null | saleor/api/customer/views.py | glosoftgroup/restaurant | 5b10a8f5199103e5bee01b45952c9638e63f28af | [
"BSD-3-Clause"
] | null | null | null | saleor/api/customer/views.py | glosoftgroup/restaurant | 5b10a8f5199103e5bee01b45952c9638e63f28af | [
"BSD-3-Clause"
] | null | null | null | from django.db.models import Q
from rest_framework import pagination
from rest_framework import generics
from django.contrib.auth import get_user_model
from .pagination import CustomPagination
from .serializers import (
CustomerListSerializer,
CreditWorthyCustomerSerializer,
CustomerUpdateSerializer,
... | 33.777778 | 101 | 0.678363 |
8d7f4aa61304e71154004d3be42322d4c015e5c8 | 8,086 | py | Python | aiochannels/channel.py | isanich/aiochannels | 0f2fc1466ade008bf9c470b3e681412ddbb01a73 | [
"MIT"
] | null | null | null | aiochannels/channel.py | isanich/aiochannels | 0f2fc1466ade008bf9c470b3e681412ddbb01a73 | [
"MIT"
] | null | null | null | aiochannels/channel.py | isanich/aiochannels | 0f2fc1466ade008bf9c470b3e681412ddbb01a73 | [
"MIT"
] | null | null | null | import asyncio
import weakref
import logging
from collections import deque, AsyncIterable
from .aiterable_deque import AiterableDeque
from .utils import asyncinit, asynclshift
log = logging.getLogger(__name__)
class ChannelError(Exception):
pass
@asyncinit
class Channel(AsyncIterable):
@asynclshift
... | 36.26009 | 108 | 0.596463 |
666d6ca0ce71cb2078dee1048f68dfc1438c039c | 1,008 | py | Python | ocdskit/cli/commands/package_records.py | mariob0y/ocdskit | be377c35644d93b037e7ff7a6ad3014ccb20747f | [
"BSD-3-Clause"
] | 12 | 2018-12-04T08:53:33.000Z | 2022-01-17T18:23:45.000Z | ocdskit/cli/commands/package_records.py | mariob0y/ocdskit | be377c35644d93b037e7ff7a6ad3014ccb20747f | [
"BSD-3-Clause"
] | 166 | 2017-11-19T01:42:19.000Z | 2022-02-10T22:04:31.000Z | ocdskit/cli/commands/package_records.py | mariob0y/ocdskit | be377c35644d93b037e7ff7a6ad3014ccb20747f | [
"BSD-3-Clause"
] | 5 | 2018-08-01T16:59:08.000Z | 2021-06-16T14:01:36.000Z | from ocdskit.cli.commands.base import OCDSCommand
from ocdskit.combine import package_records
from ocdskit.util import grouper
class Command(OCDSCommand):
name = 'package-records'
help = 'reads records from standard input, and prints one record package'
def add_arguments(self):
self.add_argument(... | 37.333333 | 95 | 0.662698 |
968ac7c6a3b3a0c38878e8754f080a2c04690651 | 4,120 | py | Python | pytorch3d/io/pluggable_formats.py | shubham-goel/pytorch3d | e5e6e90af6f81b3eccb35bbdfdc7e64ec6a4df21 | [
"BSD-3-Clause"
] | 5 | 2021-01-26T11:57:26.000Z | 2021-06-24T14:56:07.000Z | pytorch3d/io/pluggable_formats.py | shubham-goel/pytorch3d | e5e6e90af6f81b3eccb35bbdfdc7e64ec6a4df21 | [
"BSD-3-Clause"
] | null | null | null | pytorch3d/io/pluggable_formats.py | shubham-goel/pytorch3d | e5e6e90af6f81b3eccb35bbdfdc7e64ec6a4df21 | [
"BSD-3-Clause"
] | 1 | 2021-07-29T12:11:44.000Z | 2021-07-29T12:11:44.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
from pathlib import Path
from typing import Optional, Tuple, Union
from iopath.common.file_io import PathManager
from pytorch... | 30.072993 | 84 | 0.61699 |
e8e88d278aabe48db5017ec27947f7c45cd73213 | 71 | py | Python | tinysched/__init__.py | dbjohnson/tinysched | f44957fa45aabeb046ca330fdc7f7becc4171f81 | [
"MIT"
] | null | null | null | tinysched/__init__.py | dbjohnson/tinysched | f44957fa45aabeb046ca330fdc7f7becc4171f81 | [
"MIT"
] | null | null | null | tinysched/__init__.py | dbjohnson/tinysched | f44957fa45aabeb046ca330fdc7f7becc4171f81 | [
"MIT"
] | 3 | 2018-10-06T14:47:42.000Z | 2018-10-30T23:42:22.000Z | __all__ = ['tinysched']
__version__ = '0.1.2'
from .scheduler import *
| 17.75 | 24 | 0.690141 |
c9c085ccf514fd0ed0e5739f3123e46e4883fd6c | 363 | py | Python | trade_remedies_public/config/constants.py | uktrade/trade-remedies-public | bf2984c49c445bc5f8c5087e37a3cf59d06a5a0f | [
"MIT"
] | 1 | 2020-08-27T09:50:42.000Z | 2020-08-27T09:50:42.000Z | trade_remedies_public/config/constants.py | uktrade/trade-remedies-public | bf2984c49c445bc5f8c5087e37a3cf59d06a5a0f | [
"MIT"
] | 5 | 2020-08-27T22:19:06.000Z | 2021-11-10T11:29:45.000Z | trade_remedies_public/config/constants.py | uktrade/trade-remedies-public | bf2984c49c445bc5f8c5087e37a3cf59d06a5a0f | [
"MIT"
] | null | null | null | SECURITY_GROUP_ORGANISATION_OWNER = "Organisation Owner"
SECURITY_GROUP_ORGANISATION_USER = "Organisation User"
SECURITY_GROUP_THIRD_PARTY_USER = "Third Party User"
SECURITY_GROUP_TRA_INVESTIGATOR = "TRA Investigator"
SECURITY_GROUP_TRA_ADMINISTRATOR = "TRA Administrator"
ROLE_APPLICANT = 1
CASE_ROLE_APPLICANT = "Appl... | 36.3 | 56 | 0.853994 |
4984b4b4709fc4846e30f4b0d704176f336c6ad1 | 6,270 | py | Python | fluent.runtime/tests/format/test_attributes.py | shlomyb-di/python-fluent | 284507d5aed60a2d4bc9b4433ff7fef121529d6f | [
"Apache-2.0"
] | 155 | 2017-02-15T11:39:45.000Z | 2022-03-15T19:06:58.000Z | fluent.runtime/tests/format/test_attributes.py | shlomyb-di/python-fluent | 284507d5aed60a2d4bc9b4433ff7fef121529d6f | [
"Apache-2.0"
] | 113 | 2017-03-14T16:47:57.000Z | 2022-02-03T20:53:07.000Z | fluent.runtime/tests/format/test_attributes.py | shlomyb-di/python-fluent | 284507d5aed60a2d4bc9b4433ff7fef121529d6f | [
"Apache-2.0"
] | 18 | 2017-02-08T01:22:51.000Z | 2021-12-21T03:07:34.000Z | import unittest
from fluent.runtime import FluentBundle, FluentResource
from fluent.runtime.errors import FluentReferenceError
from ..utils import dedent_ftl
class TestAttributesWithStringValues(unittest.TestCase):
def setUp(self):
self.bundle = FluentBundle(['en-US'], use_isolating=False)
self... | 42.653061 | 107 | 0.63126 |
4f8452cc71735a6e39cb67e1ae71c16e2722fed8 | 513 | py | Python | gen-demoh5.py | cdluminate/leicht | 1ef84f1ad70539b64a2c0972a67086c31d035969 | [
"MIT"
] | 7 | 2019-02-22T16:45:18.000Z | 2022-01-07T18:12:07.000Z | gen-demoh5.py | cdluminate/leicht | 1ef84f1ad70539b64a2c0972a67086c31d035969 | [
"MIT"
] | null | null | null | gen-demoh5.py | cdluminate/leicht | 1ef84f1ad70539b64a2c0972a67086c31d035969 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import h5py
import numpy as np
import sys
if len(sys.argv)==1: # demo.h5
f = h5py.File('demo.h5', 'w')
f['data'] = np.random.rand(10, 784)
f['label'] = np.arange(10)
else:
f = h5py.File('mnist.fake.h5', 'w') # fake mnist for benchmarking
f['/train/images'] = np.random.rand(37800... | 27 | 69 | 0.602339 |
efcf95fca4fe255bd9623db6f238a6e0245386a3 | 251 | py | Python | manage.py | yeaske/picscope | efb38459631b7aee8b2db4f38da1f437c2d96ad8 | [
"MIT"
] | null | null | null | manage.py | yeaske/picscope | efb38459631b7aee8b2db4f38da1f437c2d96ad8 | [
"MIT"
] | null | null | null | manage.py | yeaske/picscope | efb38459631b7aee8b2db4f38da1f437c2d96ad8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "picscope.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 22.818182 | 72 | 0.772908 |
4465088d2a3ea3b9d9523e7e8074e22b0301fa10 | 209 | py | Python | test/scripts/quit.py | dbgate/datadmin | 3c86ec23c2adea8fb88985b8d7a9e5ce8f9eaa6f | [
"MIT"
] | null | null | null | test/scripts/quit.py | dbgate/datadmin | 3c86ec23c2adea8fb88985b8d7a9e5ce8f9eaa6f | [
"MIT"
] | null | null | null | test/scripts/quit.py | dbgate/datadmin | 3c86ec23c2adea8fb88985b8d7a9e5ce8f9eaa6f | [
"MIT"
] | null | null | null | def main():
pass
menu1 = root.MainMenuStrip.Items['mnuFile']
menu9 = menu1.DropDownItems['mnuQuit']
menu9.PerformClick();DoEvents()
if procedure is None: main()
if procedure == 'main': main()
| 23.222222 | 47 | 0.669856 |
762fd0490c450afce51b268197373f3f7e5766b0 | 633 | py | Python | Documentation/Max Documentation/_create_tmp.py | AlexHarker/FrameLib | 04b9882561c83d3240c6cb07f14861244d1d6272 | [
"BSD-3-Clause"
] | 33 | 2017-08-13T00:02:41.000Z | 2022-03-10T23:02:17.000Z | Documentation/Max Documentation/_create_tmp.py | AlexHarker/FrameLib | 04b9882561c83d3240c6cb07f14861244d1d6272 | [
"BSD-3-Clause"
] | 60 | 2018-02-01T23:33:36.000Z | 2022-03-23T23:25:13.000Z | Documentation/Max Documentation/_create_tmp.py | AlexHarker/FrameLib | 04b9882561c83d3240c6cb07f14861244d1d6272 | [
"BSD-3-Clause"
] | 8 | 2018-02-01T20:18:46.000Z | 2020-07-03T12:53:04.000Z | import os
from shutil import rmtree
from FrameLibDocs.classes import Documentation
def main(docs: Documentation):
docs.temporary_dir.mkdir(exist_ok=True)
docs.databases_dir.mkdir(exist_ok=True)
docs.raw_xml_dir.mkdir(exist_ok=True)
# Interfaces
for files in docs.interfaces_dir.iterdir():
... | 25.32 | 69 | 0.661927 |
e7cd2ee3036fe509e6df0aafe252b57dc4919ad8 | 8,702 | py | Python | aurora/synth_diags.py | ToFuProject/Aurora | 27556691e3094a3711fedbe1277bac67c6197600 | [
"MIT"
] | null | null | null | aurora/synth_diags.py | ToFuProject/Aurora | 27556691e3094a3711fedbe1277bac67c6197600 | [
"MIT"
] | null | null | null | aurora/synth_diags.py | ToFuProject/Aurora | 27556691e3094a3711fedbe1277bac67c6197600 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2021 Francesco Sciortino
#
# 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,... | 37.670996 | 126 | 0.626638 |
fc18f57d56aadba5b91b407093304ce933611bd6 | 36,219 | py | Python | docker/docker-airflow/spark_files/spark-2.4.5-bin-hadoop2.6/python/pyspark/sql/session.py | saurabhkhandelwal15/airflow_data_pipeline | f1832ef5edaae95c144a15012b6c301c55394b1b | [
"MIT"
] | 2,327 | 2020-03-01T09:47:34.000Z | 2021-11-25T12:38:42.000Z | docker/docker-airflow/spark_files/spark-2.4.5-bin-hadoop2.6/python/pyspark/sql/session.py | saurabhkhandelwal15/airflow_data_pipeline | f1832ef5edaae95c144a15012b6c301c55394b1b | [
"MIT"
] | 209 | 2020-03-01T17:14:12.000Z | 2021-11-08T20:35:42.000Z | docker/docker-airflow/spark_files/spark-2.4.5-bin-hadoop2.6/python/pyspark/sql/session.py | saurabhkhandelwal15/airflow_data_pipeline | f1832ef5edaae95c144a15012b6c301c55394b1b | [
"MIT"
] | 686 | 2020-03-03T17:24:51.000Z | 2021-11-25T23:39:12.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 41.53555 | 100 | 0.595958 |
a7fed2cb718b5b1d9deebae46bd96b47be23a42c | 2,418 | py | Python | apps/mac/iterm/iterm.py | dmartzol/knausj_talon | 97972d938647c38dd330f681264a756d2dfe24d3 | [
"MIT"
] | null | null | null | apps/mac/iterm/iterm.py | dmartzol/knausj_talon | 97972d938647c38dd330f681264a756d2dfe24d3 | [
"MIT"
] | null | null | null | apps/mac/iterm/iterm.py | dmartzol/knausj_talon | 97972d938647c38dd330f681264a756d2dfe24d3 | [
"MIT"
] | null | null | null | from talon import Context, Module, actions, imgui, settings, ui
import os
ctx = Context()
ctx.matches = r"""
app: iterm2
"""
directories_to_remap = {}
directories_to_exclude = {}
@ctx.action_class("user")
class user_actions:
# def file_manager_current_path():
# title = ui.active_window().title
# ... | 26.571429 | 103 | 0.59512 |
ce731b3e3c85135e73dd038c713a6f3449178c96 | 680 | py | Python | example/protocolfeed.py | zepheira/amara3-xml | 5d9646c372607f4b25598f3d4c9c94548e2a1093 | [
"Apache-2.0"
] | 7 | 2015-02-03T05:03:42.000Z | 2021-04-17T15:39:39.000Z | example/protocolfeed.py | zepheira/amara3-xml | 5d9646c372607f4b25598f3d4c9c94548e2a1093 | [
"Apache-2.0"
] | 4 | 2015-05-08T15:36:55.000Z | 2021-02-03T17:24:50.000Z | example/protocolfeed.py | zepheira/amara3-xml | 5d9646c372607f4b25598f3d4c9c94548e2a1093 | [
"Apache-2.0"
] | 2 | 2018-11-11T03:08:54.000Z | 2019-07-24T06:02:35.000Z | #Sample usage, from project root dir:
#python example/markdownlinkchecker.py README.md
import sys
from collections import deque
from amara3.uxml.parser import parsefrags, event
docfragments = deque()
with open(sys.argv[1]) as f:
for line in f.readlines():
docfragments.append(line)
for ev in parsefrags... | 17.894737 | 48 | 0.673529 |
5cf637fdbaf1d44c430549a4d9e18ed34e64d29e | 1,456 | py | Python | blog/models.py | Yubisel/webempresa | a96086a225946aff0c79c537da6d6f11a852f4ad | [
"MIT"
] | null | null | null | blog/models.py | Yubisel/webempresa | a96086a225946aff0c79c537da6d6f11a852f4ad | [
"MIT"
] | null | null | null | blog/models.py | Yubisel/webempresa | a96086a225946aff0c79c537da6d6f11a852f4ad | [
"MIT"
] | null | null | null | from django.db import models
from django.utils.timezone import now
from django.contrib.auth.models import User
# Create your models here.
class Category(models.Model):
name = models.CharField(max_length=100, verbose_name="nombre")
created = models.DateTimeField(auto_now_add=True, verbose_name="fecha de creacio... | 41.6 | 102 | 0.728709 |
8662836b1aa3ad20180a142fb5f2602add09994f | 218 | py | Python | LeetCode/35.py | KevinTMtz/CompetitiveProgramming | 0bf8a297c404073df707b6d7b06965b055ccd872 | [
"MIT"
] | 1 | 2020-12-08T02:01:18.000Z | 2020-12-08T02:01:18.000Z | LeetCode/35.py | KevinTMtz/CompetitiveProgramming | 0bf8a297c404073df707b6d7b06965b055ccd872 | [
"MIT"
] | null | null | null | LeetCode/35.py | KevinTMtz/CompetitiveProgramming | 0bf8a297c404073df707b6d7b06965b055ccd872 | [
"MIT"
] | null | null | null | #
# LeetCode
#
# Problem - 35
# URL - https://leetcode.com/problems/search-insert-position/
#
class Solution:
def searchInsert(self, nums: List[int], target: int) -> int:
return bisect.bisect_left(nums, target)
| 19.818182 | 62 | 0.697248 |
caa5657f0210495a77c325ebec767124a834e68c | 564 | py | Python | WebMirror/management/rss_parser_funcs/feed_parse_extractCultureasiatlBlogspotCom.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 193 | 2016-08-02T22:04:35.000Z | 2022-03-09T20:45:41.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractCultureasiatlBlogspotCom.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 533 | 2016-08-23T20:48:23.000Z | 2022-03-28T15:55:13.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractCultureasiatlBlogspotCom.py | rrosajp/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 19 | 2015-08-13T18:01:08.000Z | 2021-07-12T17:13:09.000Z |
def extractCultureasiatlBlogspotCom(item):
'''
Parser for 'cultureasiatl.blogspot.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
(... | 25.636364 | 104 | 0.641844 |
b50987bb565d363477b1914de084caed168290d3 | 8,751 | py | Python | pele_platform/Frag/libraries.py | cescgina/pele_platform | 9db1f69c35bb2b188047ddcdb4b3280964f86b77 | [
"Apache-2.0"
] | null | null | null | pele_platform/Frag/libraries.py | cescgina/pele_platform | 9db1f69c35bb2b188047ddcdb4b3280964f86b77 | [
"Apache-2.0"
] | null | null | null | pele_platform/Frag/libraries.py | cescgina/pele_platform | 9db1f69c35bb2b188047ddcdb4b3280964f86b77 | [
"Apache-2.0"
] | null | null | null | import glob
import os
import subprocess
import shutil
from rdkit import Chem
from pele_platform.constants import constants as cs
OUTPUT = "input.conf"
def get_symmetry_groups(mol):
"""
Computes the symmetry class for each atom and returns a list with the idx of non-symmetric atoms.
Parameters
------... | 37.883117 | 184 | 0.481774 |
78a4063468db5a5bb35cea977fd2edfa12865d0f | 619 | py | Python | HumanPose/dataset/mpii.py | harrisonford/mybabybrain-model | 06cce4e1aada0fb7b25616869bd17de164995c21 | [
"MIT"
] | null | null | null | HumanPose/dataset/mpii.py | harrisonford/mybabybrain-model | 06cce4e1aada0fb7b25616869bd17de164995c21 | [
"MIT"
] | 14 | 2020-03-24T18:14:17.000Z | 2022-02-10T01:36:17.000Z | HumanPose/dataset/mpii.py | harrisonford/mybabybrain-model | 06cce4e1aada0fb7b25616869bd17de164995c21 | [
"MIT"
] | null | null | null | from HumanPose.dataset.pose_dataset import PoseDataset
class MPII(PoseDataset):
def __init__(self, cfg):
cfg.all_joints = [[0, 5], [1, 4], [2, 3], [6, 11], [7, 10], [8, 9], [12], [13]]
cfg.all_joints_names = ['ankle', 'knee', 'hip', 'wrist', 'elbow', 'shoulder', 'chin', 'forehead']
cfg.num... | 36.411765 | 105 | 0.55412 |
adfe5abe5f228b833be7d715e0b746d6ed7bc74b | 3,976 | py | Python | urlfix/dirurlfix.py | prabhupad26/urlfix | 9dac12f0e7c4513a964bf9b2407f0095e7dacfd6 | [
"MIT"
] | 1 | 2021-07-05T05:04:24.000Z | 2021-07-05T05:04:24.000Z | urlfix/dirurlfix.py | prabhupad26/urlfix | 9dac12f0e7c4513a964bf9b2407f0095e7dacfd6 | [
"MIT"
] | null | null | null | urlfix/dirurlfix.py | prabhupad26/urlfix | 9dac12f0e7c4513a964bf9b2407f0095e7dacfd6 | [
"MIT"
] | null | null | null | from .urlfix import URLFix, file_format
import os
from warnings import warn
def replace_urls_root(in_dir, recursive=False, sub_recursive=False, **kwargs):
"""
:param in_dir: Input directory
:param recursive: Bool, should URLs be replaced in sub-directories if they exist?
:param kwargs: Other argument... | 47.903614 | 116 | 0.595322 |
6cd2239c74a7136d1ed9c68eff9a221afda452dc | 2,147 | py | Python | aplpy/slicer.py | teuben/aplpy | 5d8176cd550bd119af7055aa66f57abc06c86cdb | [
"MIT"
] | 98 | 2015-02-16T19:25:18.000Z | 2022-03-19T13:41:45.000Z | aplpy/slicer.py | teuben/aplpy | 5d8176cd550bd119af7055aa66f57abc06c86cdb | [
"MIT"
] | 244 | 2015-01-12T10:40:59.000Z | 2022-03-25T05:43:38.000Z | aplpy/slicer.py | teuben/aplpy | 5d8176cd550bd119af7055aa66f57abc06c86cdb | [
"MIT"
] | 57 | 2015-01-26T16:38:54.000Z | 2022-03-30T15:09:00.000Z |
def slice_hypercube(data, header, dimensions=[0, 1], slices=[]):
"""
Extract a slice from an n-dimensional HDU data/header pair, and return the
new data (without changing the header).
"""
if type(slices) == int:
slices = (slices, )
else:
slices = slices[:]
shape = data.sha... | 30.239437 | 78 | 0.520261 |
66cf6f3b745f56dd84cd172f94cca90cf137bdd8 | 2,019 | py | Python | test/filters/test_unsharp_mask.py | ChristophReich1996/kornia | 35f955b46e8015da1cb9faa28c6943ec2b09cc2a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/filters/test_unsharp_mask.py | ChristophReich1996/kornia | 35f955b46e8015da1cb9faa28c6943ec2b09cc2a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/filters/test_unsharp_mask.py | ChristophReich1996/kornia | 35f955b46e8015da1cb9faa28c6943ec2b09cc2a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import pytest
import torch
from torch.autograd import gradcheck
from torch.testing import assert_allclose
import kornia
import kornia.testing as utils # test utils
class Testunsharp:
@pytest.mark.parametrize("batch_shape", [(1, 4, 8, 15), (2, 3, 11, 7)])
def test_cardinality(self, batch_shape, device, dtyp... | 33.65 | 94 | 0.62209 |
b1918bd4ad21c48f34fd9e90f8b0a311969ce6eb | 18,358 | py | Python | notebook/utils.py | ryy1221/MutSigCVsyn | 2a0a404bdc96044e825e93b76df230b613c52adc | [
"MIT"
] | null | null | null | notebook/utils.py | ryy1221/MutSigCVsyn | 2a0a404bdc96044e825e93b76df230b613c52adc | [
"MIT"
] | null | null | null | notebook/utils.py | ryy1221/MutSigCVsyn | 2a0a404bdc96044e825e93b76df230b613c52adc | [
"MIT"
] | null | null | null | from Bio import SeqIO
from Bio.Seq import Seq
from bisect import bisect_left
import mmap
import re
nuc = ["A", "T", "C", "G"]
table = {
'ATA': 'I', 'ATC': 'I', 'ATT': 'I', 'ATG': 'M',
'ACA': 'T', 'ACC': 'T', 'ACG': 'T', 'ACT': 'T',
'AAC': 'N', 'AAT': 'N', 'AAA': 'K', 'AAG': 'K',
'AGC': 'S', 'AGT': 'S',... | 38.16632 | 133 | 0.584595 |
a4e36afedb855c732a590b976951d0bf2358e426 | 9,589 | py | Python | singer_sdk/helpers/_state.py | meltano/sdk | 83dde4fe922f9f91bd3c57277849a2a2daa8f09a | [
"Apache-2.0"
] | 13 | 2021-06-21T17:30:32.000Z | 2021-12-06T18:45:34.000Z | singer_sdk/helpers/_state.py | meltano/sdk | 83dde4fe922f9f91bd3c57277849a2a2daa8f09a | [
"Apache-2.0"
] | null | null | null | singer_sdk/helpers/_state.py | meltano/sdk | 83dde4fe922f9f91bd3c57277849a2a2daa8f09a | [
"Apache-2.0"
] | null | null | null | """Helper functions for state and bookmark management."""
import datetime
from typing import Any, Callable, List, Optional, Union, cast
from singer_sdk.exceptions import InvalidStreamSortException
from singer_sdk.helpers._typing import to_json_compatible
PROGRESS_MARKERS = "progress_markers"
PROGRESS_MARKER_NOTE = "... | 34.003546 | 88 | 0.704453 |
1d4aa100d5d89f61b407d9e16a196bf34fd07164 | 1,381 | py | Python | pano/views/node_facts.py | jeroenzeegers/panopuppet | 5024bf3a8b87a54aade197385438cec80120fac6 | [
"Apache-2.0"
] | null | null | null | pano/views/node_facts.py | jeroenzeegers/panopuppet | 5024bf3a8b87a54aade197385438cec80120fac6 | [
"Apache-2.0"
] | 1 | 2021-06-11T00:04:03.000Z | 2021-06-11T00:04:03.000Z | pano/views/node_facts.py | jeroenzeegers/panopuppet | 5024bf3a8b87a54aade197385438cec80120fac6 | [
"Apache-2.0"
] | null | null | null | import pytz
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect, render
from django.views.decorators.cache import cache_page
from pano.puppetdb import puppetdb
from pano.puppetdb.puppetdb import set_server, get_server
from pano.settings import AVAILABLE_SOURCES, CACHE_TIME
... | 30.021739 | 69 | 0.660391 |
576ca13a0bda6fe20295c589c04d9d97965401b0 | 6,890 | py | Python | tests/test_stac_validator.py | vincentsarago/stac-validator | 2bc527cdf5b05bab499100e88254a3bdd3d65fe1 | [
"Apache-2.0"
] | null | null | null | tests/test_stac_validator.py | vincentsarago/stac-validator | 2bc527cdf5b05bab499100e88254a3bdd3d65fe1 | [
"Apache-2.0"
] | null | null | null | tests/test_stac_validator.py | vincentsarago/stac-validator | 2bc527cdf5b05bab499100e88254a3bdd3d65fe1 | [
"Apache-2.0"
] | null | null | null | """
Description: Test the validator
"""
__author__ = "James Banting"
import stac_validator
import trio
import pytest
def _run_validate(url, version="master"):
stac = stac_validator.StacValidate(url, version)
trio.run(stac.run)
return stac
def test_good_item_validation_v052():
stac = _run_validate("... | 36.648936 | 137 | 0.518287 |
1917c4a87b2d058193e502480071adb4746b89ad | 509 | py | Python | benchmarks/DNNF-CIFAR-EQ/properties/local_targeted_diff_6_9_property_1.py | dlshriver/dnnv-benchmarks | 84b5bf1e046226d269da1cdbd7a7690fd90d024b | [
"MIT"
] | 1 | 2022-03-01T08:59:32.000Z | 2022-03-01T08:59:32.000Z | benchmarks/DNNF-CIFAR-EQ/properties/local_targeted_diff_6_9_property_1.py | dlshriver/dnnv-benchmarks | 84b5bf1e046226d269da1cdbd7a7690fd90d024b | [
"MIT"
] | null | null | null | benchmarks/DNNF-CIFAR-EQ/properties/local_targeted_diff_6_9_property_1.py | dlshriver/dnnv-benchmarks | 84b5bf1e046226d269da1cdbd7a7690fd90d024b | [
"MIT"
] | null | null | null | from dnnv.properties import *
import numpy as np
N1 = Network("N1")
N2 = Network("N2")
x = Image(__path__.parent / "input_1.npy")
epsilon = Parameter("epsilon", type=float)
true_class = 6
other_class = 9
Forall(
x_,
Implies(
((x - epsilon) < x_ < (x + epsilon)) & (0 <= x_ <= 1),
And(
... | 22.130435 | 87 | 0.569745 |
7b443950d263df10de98be9cd5f77447a0620b0a | 11,037 | py | Python | astropy/__init__.py | ananyashreyjain/astropy | 18c4c13fcc5d2907c236ff3a3a9875c78e5a69c4 | [
"BSD-3-Clause"
] | null | null | null | astropy/__init__.py | ananyashreyjain/astropy | 18c4c13fcc5d2907c236ff3a3a9875c78e5a69c4 | [
"BSD-3-Clause"
] | null | null | null | astropy/__init__.py | ananyashreyjain/astropy | 18c4c13fcc5d2907c236ff3a3a9875c78e5a69c4 | [
"BSD-3-Clause"
] | 1 | 2018-08-02T09:33:21.000Z | 2018-08-02T09:33:21.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Astropy is a package intended to contain core functionality and some
common tools needed for performing astronomy and astrophysics research with
Python. It also provides an index for other astronomy packages and tools for
managing them.
"""
import sy... | 32.084302 | 107 | 0.650267 |
3a1117d9a235ba1a67d06d0301f9d7adae52f3e5 | 409 | py | Python | iso10g.py | brunston/nextTwilight | 51b32cb211bdb7c7bddcfb98adceaa388fcfce33 | [
"MIT"
] | 2 | 2015-04-17T08:54:42.000Z | 2015-11-27T01:37:39.000Z | iso10g.py | brupoon/nextTwilight | 51b32cb211bdb7c7bddcfb98adceaa388fcfce33 | [
"MIT"
] | null | null | null | iso10g.py | brupoon/nextTwilight | 51b32cb211bdb7c7bddcfb98adceaa388fcfce33 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 17 10:19:03 2014
@author: demure
"""
import numpy as np
from matplotlib import pyplot as plt
data = np.loadtxt(r"C:\pyf\ast\iso10G.txt")
logteff = data[:,0]
mbol = data[:,1]
#logteff_inv = list(reversed(logteff))
plt.plot(logteff, mbol, 'g.',markersize = 5)
plt.title("Iso... | 22.722222 | 44 | 0.677262 |
2783a9a3ee4791471b79df05e98f2f03818663ee | 3,124 | py | Python | src/pyff/test/__init__.py | Razumain/pyFF | 55c51e0f3e64aef09ccf76bd42f0429d451d2428 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | src/pyff/test/__init__.py | Razumain/pyFF | 55c51e0f3e64aef09ccf76bd42f0429d451d2428 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | src/pyff/test/__init__.py | Razumain/pyFF | 55c51e0f3e64aef09ccf76bd42f0429d451d2428 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null |
import logging
import subprocess
import sys
import tempfile
from unittest import TestCase
import os
import pkg_resources
from pyff import __version__ as pyffversion
class ExitException(Exception):
def __init__(self, code):
self.code = code
def __str__(self):
return "would have exited with %... | 25.193548 | 96 | 0.612036 |
86847de30892ca3aa04564b6a80f7771ea6e7d5a | 12,547 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_waf_profile_constraint_urlparamlength.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2020-01-22T13:11:23.000Z | 2020-01-22T13:11:23.000Z | venv/lib/python3.6/site-packages/ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_waf_profile_constraint_urlparamlength.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_waf_profile_constraint_urlparamlength.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | null | null | null | #!/usr/bin/python
from __future__ import absolute_import, division, print_function
# Copyright 2019-2021 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the ... | 33.369681 | 153 | 0.498924 |
e4b885ba6fa1ad6b27c27beeb384aaf6aa7b6eb9 | 6,477 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/ospfsralgorithmlist_6d5b092154ba202ff142c9a80bdf1352.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/ospfsralgorithmlist_6d5b092154ba202ff142c9a80bdf1352.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/ospfsralgorithmlist_6d5b092154ba202ff142c9a80bdf1352.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# 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, ... | 40.48125 | 174 | 0.662807 |
5445b65464ba6f0c591a9517c06632c89a9f22d7 | 25,399 | py | Python | meta/train/env.py | mtcrawshaw/meta-world | b511885af4405715c7b35f8295cef88021a926be | [
"MIT"
] | 4 | 2021-09-21T07:24:26.000Z | 2022-03-25T00:28:33.000Z | meta/train/env.py | mtcrawshaw/meta | b511885af4405715c7b35f8295cef88021a926be | [
"MIT"
] | null | null | null | meta/train/env.py | mtcrawshaw/meta | b511885af4405715c7b35f8295cef88021a926be | [
"MIT"
] | null | null | null | """ Environment wrappers + functionality. """
import pickle
from typing import Dict, Tuple, List, Any, Callable
import numpy as np
import torch
import gym
from gym import Env
from gym.spaces import Box, Discrete, Space
from baselines import bench
from baselines.common.running_mean_std import RunningMeanStd
from basel... | 32.942931 | 88 | 0.622347 |
24e27c8dc73f2fc8560cce58427a4fcfda454f63 | 29,042 | py | Python | Kai/run/testEntireChain.py | NJManganelli/FourTopNAOD | 9743d5b49bdbad27a74abb7b2d5b7295f678a0e3 | [
"Apache-2.0"
] | 1 | 2022-01-17T17:29:38.000Z | 2022-01-17T17:29:38.000Z | Kai/run/testEntireChain.py | NJManganelli/FourTopNAOD | 9743d5b49bdbad27a74abb7b2d5b7295f678a0e3 | [
"Apache-2.0"
] | null | null | null | Kai/run/testEntireChain.py | NJManganelli/FourTopNAOD | 9743d5b49bdbad27a74abb7b2d5b7295f678a0e3 | [
"Apache-2.0"
] | 1 | 2021-12-15T10:56:50.000Z | 2021-12-15T10:56:50.000Z | from __future__ import division, print_function
import os, sys, subprocess
import ROOT
ROOT.PyConfig.IgnoreCommandLineOptions = True
from PhysicsTools.NanoAODTools.postprocessing.framework.postprocessor import PostProcessor
from PhysicsTools.NanoAODTools.postprocessing.framework.datamodel import Collection, Object
fr... | 46.4672 | 257 | 0.52851 |
b2778ff253236fbfc44dd305804ba4a992cc3ce4 | 837 | py | Python | Problems/Euler Project 95.py | vishwas-21/Project-Euler | ecc6cd843425647582488bcaaaa1815439251d56 | [
"MIT"
] | null | null | null | Problems/Euler Project 95.py | vishwas-21/Project-Euler | ecc6cd843425647582488bcaaaa1815439251d56 | [
"MIT"
] | null | null | null | Problems/Euler Project 95.py | vishwas-21/Project-Euler | ecc6cd843425647582488bcaaaa1815439251d56 | [
"MIT"
] | null | null | null | import time
import math
start = time.time()
def sum_prop_div(n):
sumProp = 1
for i in range(2, int(math.sqrt(n)) + 1):
if n % i == 0:
if i != n // i:
sumProp += i + n // i
else:
sumProp += i
return sumProp
def length_chain(n):
ans = 1
... | 18.6 | 56 | 0.433692 |
951062f2b612221df9b887fa8975ee39eba5e471 | 250,219 | py | Python | python/cudf/cudf/tests/test_dataframe.py | Quansight-Labs/cudf | d05de978f2d1f34b7629bd54ab9485df1f9949ef | [
"Apache-2.0"
] | null | null | null | python/cudf/cudf/tests/test_dataframe.py | Quansight-Labs/cudf | d05de978f2d1f34b7629bd54ab9485df1f9949ef | [
"Apache-2.0"
] | 1 | 2020-04-03T20:46:09.000Z | 2020-04-20T15:22:10.000Z | python/cudf/cudf/tests/test_dataframe.py | Quansight-Labs/cudf | d05de978f2d1f34b7629bd54ab9485df1f9949ef | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018-2021, NVIDIA CORPORATION.
import array as arr
import datetime
import io
import operator
import random
import re
import string
import textwrap
from copy import copy
import cupy
import numpy as np
import pandas as pd
import pyarrow as pa
import pytest
from numba import cuda
import cudf
from cudf.c... | 28.760805 | 79 | 0.524357 |
ad1cb0cd1cde8868d6fcf102bba0b10b331df33d | 783 | py | Python | 13_Day_List_comprehension/lc.py | diegofregolente/30-Days-Of-Python | e0cad31f6d5ab1384ad6fa5a5d24a84771d6c267 | [
"Apache-2.0"
] | null | null | null | 13_Day_List_comprehension/lc.py | diegofregolente/30-Days-Of-Python | e0cad31f6d5ab1384ad6fa5a5d24a84771d6c267 | [
"Apache-2.0"
] | null | null | null | 13_Day_List_comprehension/lc.py | diegofregolente/30-Days-Of-Python | e0cad31f6d5ab1384ad6fa5a5d24a84771d6c267 | [
"Apache-2.0"
] | null | null | null | # List Comprehension Basic
language = 'Python'
lst = [i for i in language]
print(lst)
# Generating Numbers
numbers = [i for i in range(11)]
print(numbers)
# Square with LC
squares = [i * i for i in range(11)]
print(squares)
# List of Tuples with LC
numbers = [(i, i * i) for i in range(11)]
print(numbers)
# Lists of... | 24.46875 | 69 | 0.659004 |
41b7fd276571f517b7df8ec4ce99b6b5b30213c6 | 1,441 | py | Python | containsDuplicates.py | anilgitme/py | 6739f2ccfadc339dcfdd6118f4f2ad97f4452300 | [
"MIT"
] | null | null | null | containsDuplicates.py | anilgitme/py | 6739f2ccfadc339dcfdd6118f4f2ad97f4452300 | [
"MIT"
] | null | null | null | containsDuplicates.py | anilgitme/py | 6739f2ccfadc339dcfdd6118f4f2ad97f4452300 | [
"MIT"
] | null | null | null |
class Solution:
def containsDuplicate(self, nums: List[int]) -> bool:
noDups = {}
for num in nums:
if num not in noDups:
noDups[num] = 1
else:
return True
return False
# brute force
class Solution:
def containsDuplicate(s... | 24.423729 | 59 | 0.530187 |
3d75bfdaa4fb099695ac1c3c050f8eb4070c7cb4 | 38,265 | py | Python | zarr/tests/test_hierarchy.py | raphaeldussin/zarr-python | be29d3659daf83b8ff2b119ac98d97c47324706c | [
"MIT"
] | null | null | null | zarr/tests/test_hierarchy.py | raphaeldussin/zarr-python | be29d3659daf83b8ff2b119ac98d97c47324706c | [
"MIT"
] | null | null | null | zarr/tests/test_hierarchy.py | raphaeldussin/zarr-python | be29d3659daf83b8ff2b119ac98d97c47324706c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import atexit
import os
import pickle
import shutil
import tempfile
import textwrap
import unittest
import numpy as np
import pytest
from numcodecs import Zlib
from numpy.testing import assert_array_equal
from zarr.attrs import Attributes
from zarr.core import Array
from zarr.creation import o... | 31.008914 | 86 | 0.553273 |
bf35440be20ead0a87f87a94cfe6fae4ac50a720 | 1,903 | py | Python | eggs/Cheetah-2.2.2-py2.7-linux-x86_64-ucs4.egg/Cheetah/Tests/Filters.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | null | null | null | eggs/Cheetah-2.2.2-py2.7-linux-x86_64-ucs4.egg/Cheetah/Tests/Filters.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | null | null | null | eggs/Cheetah-2.2.2-py2.7-linux-x86_64-ucs4.egg/Cheetah/Tests/Filters.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | 1 | 2020-07-25T21:03:18.000Z | 2020-07-25T21:03:18.000Z | #!/usr/bin/env python
import sys
import Cheetah.Template
import Cheetah.Filters
import unittest_local_copy as unittest
majorVer, minorVer = sys.version_info[0], sys.version_info[1]
versionTuple = (majorVer, minorVer)
class BasicMarkdownFilterTest(unittest.TestCase):
'''
Test that our markdown filter w... | 27.57971 | 112 | 0.633736 |
bd0b53385438ef4852e5fad4322aa35a3ac43406 | 1,868 | py | Python | setup.py | nicc777/flask-prod-docker | b345b92f9fdf4c06e72bb852e9dc5478f29019e0 | [
"MIT"
] | null | null | null | setup.py | nicc777/flask-prod-docker | b345b92f9fdf4c06e72bb852e9dc5478f29019e0 | [
"MIT"
] | 8 | 2020-03-21T06:13:47.000Z | 2021-04-25T04:59:43.000Z | setup.py | nicc777/flask-prod-docker | b345b92f9fdf4c06e72bb852e9dc5478f29019e0 | [
"MIT"
] | 1 | 2017-05-22T18:13:17.000Z | 2017-05-22T18:13:17.000Z | """A setuptools based setup module.
See:
https://packaging.python.org/guides/distributing-packages-using-setuptools/
https://github.com/pypa/sampleproject
"""
from setuptools import setup, find_packages
from os import path
from io import open
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'REA... | 32.77193 | 96 | 0.631692 |
31be14e735c5a362dcf3f59025265b6b80432445 | 7,640 | py | Python | interact.py | echodarkstar/transfer-learning-conv-ai | b8fcf26055af6fcbb3c2b8e63d631f13e450afbf | [
"MIT"
] | null | null | null | interact.py | echodarkstar/transfer-learning-conv-ai | b8fcf26055af6fcbb3c2b8e63d631f13e450afbf | [
"MIT"
] | null | null | null | interact.py | echodarkstar/transfer-learning-conv-ai | b8fcf26055af6fcbb3c2b8e63d631f13e450afbf | [
"MIT"
] | null | null | null | # # Copyright (c) 2019-present, HuggingFace Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import logging
import random
from argparse import ArgumentParser
from itertools import chain
from pprint import pforma... | 50.263158 | 184 | 0.699738 |
29dc75e44fa531da0eec3ca22654aa2803fd933d | 5,078 | py | Python | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/common/djangoapps/third_party_auth/tests/utils.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 3 | 2021-12-15T04:58:18.000Z | 2022-02-06T12:15:37.000Z | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/common/djangoapps/third_party_auth/tests/utils.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | null | null | null | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/common/djangoapps/third_party_auth/tests/utils.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 1 | 2019-01-02T14:38:50.000Z | 2019-01-02T14:38:50.000Z | """Common utility for testing third party oauth2 features."""
import json
from base64 import b64encode
from unittest import skip
import httpretty
from onelogin.saml2.utils import OneLogin_Saml2_Utils
from oauth2_provider.models import Application
from social_core.backends.facebook import API_VERSION as FACEBOOK_API_... | 33.407895 | 107 | 0.687082 |
fadb86777297abab5f529ff5ff4b201ec2850a5f | 1,304 | py | Python | exercises/ex28.py | jinkyukim-me/StudyPython | 6c98598c23c506101882392645fbb14d4aa998d4 | [
"MIT"
] | null | null | null | exercises/ex28.py | jinkyukim-me/StudyPython | 6c98598c23c506101882392645fbb14d4aa998d4 | [
"MIT"
] | null | null | null | exercises/ex28.py | jinkyukim-me/StudyPython | 6c98598c23c506101882392645fbb14d4aa998d4 | [
"MIT"
] | null | null | null | # Exercise 28. Boolean Practice
print("True and True : ",True and True)
print("False and True : ", False and True)
print("1 == 1 and 2 == 1 : ", 1 == 1 and 2 == 1)
print('"test" == "test" : ', "test" == "test")
print("1 == 1 or 2 != 1 : ", 1 == 1 or 2 != 1)
print("True and 1 == 1 : ", True and 1 == 1)
print("False an... | 54.333333 | 138 | 0.497699 |
344913a1ad6e42887dd1e91e8bc968120cdf3f90 | 21,096 | py | Python | examples/dmm/dmm.py | DEVESHTARASIA/pyro | 7fce5508fe4f15a1a65a267e8d6df3aeead1a3ec | [
"MIT"
] | null | null | null | examples/dmm/dmm.py | DEVESHTARASIA/pyro | 7fce5508fe4f15a1a65a267e8d6df3aeead1a3ec | [
"MIT"
] | null | null | null | examples/dmm/dmm.py | DEVESHTARASIA/pyro | 7fce5508fe4f15a1a65a267e8d6df3aeead1a3ec | [
"MIT"
] | null | null | null | """
An implementation of a Deep Markov Model in Pyro based on reference [1].
This is essentially the DKS variant outlined in the paper. The primary difference
between this implementation and theirs is that in our version any KL divergence terms
in the ELBO are estimated via sampling, while they make use of the analytic... | 48.385321 | 104 | 0.659699 |
547e75370413b6895362924e1b549e2995a10400 | 6,528 | py | Python | c11_keras_dl_selu.py | jamielapointe/jl_tensorflow_tutorial | f8f3751454d1727face4385a0b98a8ebbd47d5f6 | [
"MIT"
] | null | null | null | c11_keras_dl_selu.py | jamielapointe/jl_tensorflow_tutorial | f8f3751454d1727face4385a0b98a8ebbd47d5f6 | [
"MIT"
] | null | null | null | c11_keras_dl_selu.py | jamielapointe/jl_tensorflow_tutorial | f8f3751454d1727face4385a0b98a8ebbd47d5f6 | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow import keras
from tensorflow.python.ops import math_ops
from tensorflow.python.keras import backend as K
import numpy as np
from sklearn.metrics import (precision_score,
recall_score,
... | 35.478261 | 89 | 0.575827 |
6f7863c71802dd8723aa784df6ae95e6af36f22d | 322 | py | Python | Estudos/Python_Exercicios_Curso_Em_Video/ex085.py | wiltonjr4/Python_Language | 4433b86b19c7d90bb6cb3a921a3ee396f1cd5b5d | [
"MIT"
] | null | null | null | Estudos/Python_Exercicios_Curso_Em_Video/ex085.py | wiltonjr4/Python_Language | 4433b86b19c7d90bb6cb3a921a3ee396f1cd5b5d | [
"MIT"
] | null | null | null | Estudos/Python_Exercicios_Curso_Em_Video/ex085.py | wiltonjr4/Python_Language | 4433b86b19c7d90bb6cb3a921a3ee396f1cd5b5d | [
"MIT"
] | null | null | null | total = [[], []]
for p, c in enumerate(range(0, 7)):
num = int(input(f'Digite o {p+1}° valor: '))
if num % 2 == 0:
total[0].append(num)
else:
total[1].append(num)
print(f'Os valores pares digitados foram: {sorted(total[0])}')
print(f'Os valores ímpares digitados foram: {sorted(total[1])}')
... | 24.769231 | 64 | 0.586957 |
6fa1d3555523eb1d2d8507765361a052f3edbc6b | 2,243 | py | Python | carball/analysis/stats/possession/turnovers.py | unitedroguegg/carball | 4767f2c5d195b7d5d60e6a5575415262803acef7 | [
"Apache-2.0"
] | 119 | 2018-09-14T02:14:19.000Z | 2022-03-06T05:06:54.000Z | carball/analysis/stats/possession/turnovers.py | unitedroguegg/carball | 4767f2c5d195b7d5d60e6a5575415262803acef7 | [
"Apache-2.0"
] | 207 | 2018-09-06T18:53:06.000Z | 2022-02-12T22:39:36.000Z | carball/analysis/stats/possession/turnovers.py | unitedroguegg/carball | 4767f2c5d195b7d5d60e6a5575415262803acef7 | [
"Apache-2.0"
] | 44 | 2018-09-10T16:54:13.000Z | 2022-02-19T03:07:50.000Z | from typing import Dict
import pandas as pd
from carball.generated.api.stats.events_pb2 import Hit
from ....analysis.constants.field_constants import FieldConstants
from ....analysis.stats.stats import HitStat
from ....generated.api import game_pb2
from ....generated.api.player_pb2 import Player
from ....json_parser.... | 47.723404 | 118 | 0.705751 |
fa48cdafa26e7a81b114a2e288e5d0be5de34aeb | 2,156 | py | Python | 2020_July_Leetcode_30_days_challenge/Week_3_Remove Linked List Elements/by_iteration.py | coderMaruf/leetcode-1 | 20ffe26e43999e44c8acf9800acb371a49bb5853 | [
"MIT"
] | 32 | 2020-01-05T13:37:16.000Z | 2022-03-26T07:27:09.000Z | 2020_July_Leetcode_30_days_challenge/Week_3_Remove Linked List Elements/by_iteration.py | coderMaruf/leetcode-1 | 20ffe26e43999e44c8acf9800acb371a49bb5853 | [
"MIT"
] | null | null | null | 2020_July_Leetcode_30_days_challenge/Week_3_Remove Linked List Elements/by_iteration.py | coderMaruf/leetcode-1 | 20ffe26e43999e44c8acf9800acb371a49bb5853 | [
"MIT"
] | 8 | 2020-06-18T16:17:27.000Z | 2022-03-15T23:58:18.000Z | '''
Description:
Remove all elements from a linked list of integers that have value val.
Example:
Input: 1->2->6->3->4->5->6, val = 6
Output: 1->2->3->4->5
'''
# Definition for singly-linked list.
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class... | 18.912281 | 84 | 0.534323 |
6ca06c064637545e351302d4dcb7349c4b1b3388 | 3,085 | py | Python | infrastructure-provisioning/src/general/scripts/os/ipynb_output_filter.py | roolrd/incubator-datalab | 2045207ecd1b381193f1a1ec143cc968716ad989 | [
"Apache-2.0"
] | 66 | 2020-10-03T08:36:48.000Z | 2022-03-20T23:16:20.000Z | infrastructure-provisioning/src/general/scripts/os/ipynb_output_filter.py | roolrd/incubator-datalab | 2045207ecd1b381193f1a1ec143cc968716ad989 | [
"Apache-2.0"
] | 48 | 2019-02-28T12:11:33.000Z | 2020-09-15T08:27:08.000Z | infrastructure-provisioning/src/general/scripts/os/ipynb_output_filter.py | roolrd/incubator-datalab | 2045207ecd1b381193f1a1ec143cc968716ad989 | [
"Apache-2.0"
] | 44 | 2019-01-14T10:31:55.000Z | 2020-09-22T17:53:33.000Z | #!/usr/bin/python3
# *****************************************************************************
#
# 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 ... | 33.532609 | 93 | 0.573096 |
6c941c5ed70c6470c40c476cb2fcc35fbeea2f04 | 1,177 | py | Python | backend/utils/logging.py | kurisu-gh/DistributedReplays | 7f9f15805bda2f7789162fb16cd856913f80b279 | [
"Apache-2.0"
] | null | null | null | backend/utils/logging.py | kurisu-gh/DistributedReplays | 7f9f15805bda2f7789162fb16cd856913f80b279 | [
"Apache-2.0"
] | null | null | null | backend/utils/logging.py | kurisu-gh/DistributedReplays | 7f9f15805bda2f7789162fb16cd856913f80b279 | [
"Apache-2.0"
] | null | null | null | import logging
from typing import Callable
backup_logger = logging.getLogger(__name__)
logger_callbacks = []
class ErrorLogger:
@staticmethod
def add_logging_callback(callback: Callable):
"""
Adds a callback for logging purposes.
:param callback: A function that takes in an excepti... | 30.179487 | 101 | 0.643161 |
38644170dd42a901f91c97273b9598d5f75a6243 | 4,571 | py | Python | ml_source/src/blocktorch/blocktorch/pipelines/components/estimators/classifiers/elasticnet_classifier.py | blocktorch/blocktorch | 044aa269813ab22c5fd27f84272e5fb540fc522b | [
"MIT"
] | 1 | 2021-09-23T12:23:02.000Z | 2021-09-23T12:23:02.000Z | ml_source/src/blocktorch/blocktorch/pipelines/components/estimators/classifiers/elasticnet_classifier.py | blocktorch/blocktorch | 044aa269813ab22c5fd27f84272e5fb540fc522b | [
"MIT"
] | null | null | null | ml_source/src/blocktorch/blocktorch/pipelines/components/estimators/classifiers/elasticnet_classifier.py | blocktorch/blocktorch | 044aa269813ab22c5fd27f84272e5fb540fc522b | [
"MIT"
] | null | null | null | """Elastic Net Classifier. Uses Logistic Regression with elasticnet penalty as the base estimator."""
import warnings
import numpy as np
from sklearn.linear_model import LogisticRegression
from skopt.space import Real
from blocktorch.model_family import ModelFamily
from blocktorch.pipelines.components.estimators impo... | 42.324074 | 166 | 0.644717 |
924807c060f5c37dc3578a8e46a41b1fce7cd4bb | 2,864 | py | Python | examples/misc/svg_filter_pie.py | jbbrokaw/matplotlib | 86ec1b6fc5628bfb2d09797c58d7eed0ca8c2427 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | examples/misc/svg_filter_pie.py | jbbrokaw/matplotlib | 86ec1b6fc5628bfb2d09797c58d7eed0ca8c2427 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | examples/misc/svg_filter_pie.py | jbbrokaw/matplotlib | 86ec1b6fc5628bfb2d09797c58d7eed0ca8c2427 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | """
Demonstrate SVG filtering effects which might be used with mpl.
The pie chart drawing code is borrowed from pie_demo.py
Note that the filtering effects are only effective if your svg rederer
support it.
"""
import matplotlib
matplotlib.use("Svg")
import matplotlib.pyplot as plt
from matplotlib.patches import S... | 29.833333 | 91 | 0.673883 |
ea93824bae4f42a53dbd5b018734f006402d15ef | 3,090 | py | Python | models/pointnet2_sem_seg_msg.py | yufeiwang63/Pointnet_Pointnet2_pytorch | f9078a71b973c13ae7ffa897e142dc7b1e8e88be | [
"MIT"
] | null | null | null | models/pointnet2_sem_seg_msg.py | yufeiwang63/Pointnet_Pointnet2_pytorch | f9078a71b973c13ae7ffa897e142dc7b1e8e88be | [
"MIT"
] | null | null | null | models/pointnet2_sem_seg_msg.py | yufeiwang63/Pointnet_Pointnet2_pytorch | f9078a71b973c13ae7ffa897e142dc7b1e8e88be | [
"MIT"
] | null | null | null | import torch.nn as nn
import torch.nn.functional as F
from haptic.Pointnet_Pointnet2_pytorch.models.pointnet2_utils import PointNetSetAbstractionMsg,PointNetFeaturePropagation
class get_model(nn.Module):
def __init__(self, use_batch_norm, num_classes):
super(get_model, self).__init__()
self.sa1 =... | 42.916667 | 146 | 0.653074 |
d9c564f8709f94560a0f634fb56021f4170deca8 | 3,053 | py | Python | core/python/kungfu/practice/master.py | Grass-CLP/kungfu | 6085a9e642c092c97af0df849fb18ceeb8896bba | [
"Apache-2.0"
] | null | null | null | core/python/kungfu/practice/master.py | Grass-CLP/kungfu | 6085a9e642c092c97af0df849fb18ceeb8896bba | [
"Apache-2.0"
] | null | null | null | core/python/kungfu/practice/master.py | Grass-CLP/kungfu | 6085a9e642c092c97af0df849fb18ceeb8896bba | [
"Apache-2.0"
] | null | null | null | import sys
import traceback
import json
import time
import functools
import pyyjj
import pywingchun
from . import os_signal
from kungfu import nanomsg
from kungfu.log import create_logger
import kungfu.service.kfs as kfs
from kungfu.service.kfs import system
from kungfu.service.kfs import calendar
import kungfu.yij... | 35.917647 | 155 | 0.654111 |
e1f0685f08772361aa627b99a31decab8fd7fb79 | 2,156 | py | Python | items/__init__.py | Belvarm/roguelike-tutorial | ea989c080b0f7dd61c38b5719ab8e502a45a0489 | [
"MIT"
] | null | null | null | items/__init__.py | Belvarm/roguelike-tutorial | ea989c080b0f7dd61c38b5719ab8e502a45a0489 | [
"MIT"
] | null | null | null | items/__init__.py | Belvarm/roguelike-tutorial | ea989c080b0f7dd61c38b5719ab8e502a45a0489 | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import Optional, TYPE_CHECKING
import graphic
from actions import Impossible
if TYPE_CHECKING:
from actions import ActionWithItem
from location import Location
from inventory import Inventory
class Item(graphic.Graphic):
render_order = 1
def __in... | 32.179104 | 86 | 0.637291 |
4eb7a6965e734a14df75736d41bb8050fd850cb0 | 7,470 | py | Python | tests/test_utils/test_misc.py | mrzhuzhe/mmdetection | c04ca2c2a65500bc248a5d2ab6ace5b15f00064d | [
"Apache-2.0"
] | null | null | null | tests/test_utils/test_misc.py | mrzhuzhe/mmdetection | c04ca2c2a65500bc248a5d2ab6ace5b15f00064d | [
"Apache-2.0"
] | null | null | null | tests/test_utils/test_misc.py | mrzhuzhe/mmdetection | c04ca2c2a65500bc248a5d2ab6ace5b15f00064d | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
import tempfile
import numpy as np
import pytest
import torch
from mmdet.core.bbox import distance2bbox
from mmdet.core.mask.structures import BitmapMasks, PolygonMasks
from mmdet.core.utils import (center_of_mass, filter_scores_and_topk,
... | 36.617647 | 80 | 0.608701 |
7ae23317b4d1495a492890e0843cb0f425d8e89b | 42,794 | py | Python | Docker-Compose2UML_nonokawa2019/docker-compose2uml/src/main/resources/Lib/site-packages/docker/models/containers.py | kisolab/astah_plugins_released | e1ed674e998f953ab9becefc9bd9c474b8c569b7 | [
"Apache-2.0"
] | null | null | null | Docker-Compose2UML_nonokawa2019/docker-compose2uml/src/main/resources/Lib/site-packages/docker/models/containers.py | kisolab/astah_plugins_released | e1ed674e998f953ab9becefc9bd9c474b8c569b7 | [
"Apache-2.0"
] | null | null | null | Docker-Compose2UML_nonokawa2019/docker-compose2uml/src/main/resources/Lib/site-packages/docker/models/containers.py | kisolab/astah_plugins_released | e1ed674e998f953ab9becefc9bd9c474b8c569b7 | [
"Apache-2.0"
] | 4 | 2021-02-11T03:51:39.000Z | 2021-02-12T05:10:43.000Z | import copy
import ntpath
from collections import namedtuple
from ..api import APIClient
from ..constants import DEFAULT_DATA_CHUNK_SIZE
from ..errors import (
ContainerError, DockerException, ImageNotFound,
NotFound, create_unexpected_kwargs_error
)
from ..types import HostConfig
from ..utils import version_g... | 38.587917 | 82 | 0.564682 |
5b7eef74c9e604a935d921b723e9dd99f1c3dcce | 2,654 | py | Python | pyaz/network/application_gateway/client_cert/__init__.py | py-az-cli/py-az-cli | 9a7dc44e360c096a5a2f15595353e9dad88a9792 | [
"MIT"
] | null | null | null | pyaz/network/application_gateway/client_cert/__init__.py | py-az-cli/py-az-cli | 9a7dc44e360c096a5a2f15595353e9dad88a9792 | [
"MIT"
] | null | null | null | pyaz/network/application_gateway/client_cert/__init__.py | py-az-cli/py-az-cli | 9a7dc44e360c096a5a2f15595353e9dad88a9792 | [
"MIT"
] | 1 | 2022-02-03T09:12:01.000Z | 2022-02-03T09:12:01.000Z | from .... pyaz_utils import _call_az
def add(data, gateway_name, name, resource_group):
'''
Add trusted client certificate of the application gateway.
Required Parameters:
- data -- Certificate public data.
- gateway_name -- Name of the application gateway.
- name -- Name of the trusted client... | 42.126984 | 128 | 0.727958 |
ac6d719eda3254140de2766460aeb488f02a6549 | 2,762 | py | Python | server/auvsi_suas/models/distance.py | RMMichael/interop | b68a1b0b2324b5a1d9b2683b97299cb6f214cdb9 | [
"Apache-2.0"
] | 175 | 2015-09-15T15:37:06.000Z | 2022-02-14T23:21:48.000Z | server/auvsi_suas/models/distance.py | RMMichael/interop | b68a1b0b2324b5a1d9b2683b97299cb6f214cdb9 | [
"Apache-2.0"
] | 376 | 2015-09-16T19:34:15.000Z | 2022-02-19T12:55:55.000Z | server/auvsi_suas/models/distance.py | RMMichael/interop | b68a1b0b2324b5a1d9b2683b97299cb6f214cdb9 | [
"Apache-2.0"
] | 109 | 2015-09-16T17:05:14.000Z | 2022-01-26T12:49:38.000Z | """Functions for computing distance."""
import logging
import math
import numpy as np
import pyproj
from auvsi_suas.models import units
logger = logging.getLogger(__name__)
proj_wgs84 = pyproj.Proj(init="epsg:4326")
proj_web_mercator = pyproj.Proj(init="epsg:3857")
def haversine(lon1, lat1, lon2, lat2):
"""
... | 28.770833 | 118 | 0.636495 |
684ba354c0b6f9c716d0e6ec020c4744135585db | 3,386 | py | Python | src/encode_task_spp.py | CollinsLabBioComp/chip-seq-pipeline2 | 61f77dd94b3afe39bd718b30f1a9a6a7b9676c30 | [
"MIT"
] | 1 | 2019-12-08T08:04:15.000Z | 2019-12-08T08:04:15.000Z | src/encode_task_spp.py | kundajelab/cut-n-run-pipeline | 0f9cf7870288d462f69449cb2b99faa9292af3bc | [
"MIT"
] | null | null | null | src/encode_task_spp.py | kundajelab/cut-n-run-pipeline | 0f9cf7870288d462f69449cb2b99faa9292af3bc | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# ENCODE DCC spp call peak wrapper
# Author: Jin Lee (leepc12@gmail.com)
import sys
import os
import argparse
from encode_lib_common import (
assert_file_not_empty, human_readable_number, log,
ls_l, mkdir_p, rm_f, run_shell_cmd, strip_ext_ta)
def parse_arguments():
parser = argpars... | 32.557692 | 79 | 0.594507 |
7f6b75e00f6de67cd9129bcf13b50967d7126b2e | 59 | py | Python | tests/urlpatterns_reverse/erroneous_views_module.py | webjunkie/django | 5dbca13f3baa2e1bafd77e84a80ad6d8a074712e | [
"BSD-3-Clause"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | AppServer/lib/django-1.5/tests/regressiontests/urlpatterns_reverse/erroneous_views_module.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | AppServer/lib/django-1.5/tests/regressiontests/urlpatterns_reverse/erroneous_views_module.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | import non_existent
def erroneous_view(request):
pass
| 11.8 | 28 | 0.779661 |
45eddffd0285fbccf3d6b3c9c35142ec3031c52d | 4,982 | py | Python | src/pyrin/caching/remote/decorators.py | wilsonGmn/pyrin | 25dbe3ce17e80a43eee7cfc7140b4c268a6948e0 | [
"BSD-3-Clause"
] | null | null | null | src/pyrin/caching/remote/decorators.py | wilsonGmn/pyrin | 25dbe3ce17e80a43eee7cfc7140b4c268a6948e0 | [
"BSD-3-Clause"
] | null | null | null | src/pyrin/caching/remote/decorators.py | wilsonGmn/pyrin | 25dbe3ce17e80a43eee7cfc7140b4c268a6948e0 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
caching remote decorators module.
"""
from functools import update_wrapper
import pyrin.caching.services as caching_services
def memcached(*old_method, **options):
"""
decorator to convert a method or function into a lazy one.
note that this cache type supports expire time a... | 34.839161 | 85 | 0.620032 |
4a13f300deb89c54eed42acfd7d0c86232c6b40d | 8,234 | py | Python | userena/tests/tests_forms.py | bsavelev/django-userena | 1b841560ceef95c3f4dfd8f7e2bdef9f845bc417 | [
"BSD-3-Clause"
] | null | null | null | userena/tests/tests_forms.py | bsavelev/django-userena | 1b841560ceef95c3f4dfd8f7e2bdef9f845bc417 | [
"BSD-3-Clause"
] | null | null | null | userena/tests/tests_forms.py | bsavelev/django-userena | 1b841560ceef95c3f4dfd8f7e2bdef9f845bc417 | [
"BSD-3-Clause"
] | 1 | 2019-07-27T19:23:35.000Z | 2019-07-27T19:23:35.000Z | # encoding: utf-8
from __future__ import unicode_literals
from django.test import TestCase
from django.utils.translation import ugettext_lazy as _, override
from userena import forms
from userena import settings as userena_settings
from userena.utils import get_user_model
class SignupFormTests(TestCase):
""" Te... | 37.9447 | 136 | 0.546393 |
50ed09f4520aa4f2cf7555a9b4e50a474d33e658 | 26,637 | py | Python | source/deepsecurity/api/policy_firewall_rule_details_api.py | felipecosta09/cloudone-workload-controltower-lifecycle | 7927c84d164058b034fc872701b5ee117641f4d1 | [
"Apache-2.0"
] | 1 | 2021-10-30T16:40:09.000Z | 2021-10-30T16:40:09.000Z | source/deepsecurity/api/policy_firewall_rule_details_api.py | felipecosta09/cloudone-workload-controltower-lifecycle | 7927c84d164058b034fc872701b5ee117641f4d1 | [
"Apache-2.0"
] | 1 | 2021-07-28T20:19:03.000Z | 2021-07-28T20:19:03.000Z | source/deepsecurity/api/policy_firewall_rule_details_api.py | felipecosta09/cloudone-workload-controltower-lifecycle | 7927c84d164058b034fc872701b5ee117641f4d1 | [
"Apache-2.0"
] | 1 | 2021-10-30T16:40:02.000Z | 2021-10-30T16:40:02.000Z | # coding: utf-8
"""
Trend Micro Deep Security API
Copyright 2018 - 2020 Trend Micro Incorporated.<br/>Get protected, stay secured, and keep informed with Trend Micro Deep Security's new RESTful API. Access system data and manage security configurations to automate your security workflows and integrate De... | 50.737143 | 311 | 0.637497 |
81cc1d1a52c5407940c3efe37272c346d5e582cd | 1,242 | py | Python | profiles_api/serializers.py | geonsangyoo/django-rest-api-beginner | 935a83975a86005972cffc8fb8cc201cfb2976b2 | [
"MIT"
] | null | null | null | profiles_api/serializers.py | geonsangyoo/django-rest-api-beginner | 935a83975a86005972cffc8fb8cc201cfb2976b2 | [
"MIT"
] | null | null | null | profiles_api/serializers.py | geonsangyoo/django-rest-api-beginner | 935a83975a86005972cffc8fb8cc201cfb2976b2 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from profiles_api import models
class HelloSerializer(serializers.Serializer):
"""Serializes a name field for testing our APIView"""
name = serializers.CharField(max_length=10)
class UserProfileSerializer(serializers.ModelSerializer):
"""Serializes a user profile obj... | 29.571429 | 68 | 0.598229 |
2c6c30de6408a10765e16116fe181f68179cdb30 | 2,021 | py | Python | scripts/create_librispeech_trans.py | takasyo/TensorFlowASR | b518ea2aa68b3307ffe9dfd675f84e3ef38894a4 | [
"Apache-2.0"
] | 1 | 2021-01-21T09:04:26.000Z | 2021-01-21T09:04:26.000Z | scripts/create_librispeech_trans.py | takasyo/TensorFlowASR | b518ea2aa68b3307ffe9dfd675f84e3ef38894a4 | [
"Apache-2.0"
] | null | null | null | scripts/create_librispeech_trans.py | takasyo/TensorFlowASR | b518ea2aa68b3307ffe9dfd675f84e3ef38894a4 | [
"Apache-2.0"
] | 1 | 2021-10-16T22:40:42.000Z | 2021-10-16T22:40:42.000Z | # Copyright 2020 Huy Le Nguyen (@usimarit)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 34.254237 | 78 | 0.700643 |
da1703f39aaf4e535d355f1336eee360486e1adb | 11,091 | py | Python | gslab_make/private/runprogramdirective.py | lboxell/gslab_python | 0e6d687962146d8745cd80d5c888c69647863d2d | [
"MIT"
] | 12 | 2017-03-03T20:48:50.000Z | 2020-11-27T23:37:15.000Z | gslab_make/private/runprogramdirective.py | lboxell/gslab_python | 0e6d687962146d8745cd80d5c888c69647863d2d | [
"MIT"
] | 132 | 2017-01-11T23:32:01.000Z | 2022-03-31T17:00:06.000Z | gslab_make/private/runprogramdirective.py | lboxell/gslab_python | 0e6d687962146d8745cd80d5c888c69647863d2d | [
"MIT"
] | 10 | 2017-07-22T02:35:29.000Z | 2021-02-16T00:09:44.000Z | #! /usr/bin/env python
import os
import re
import shutil
import subprocess
from exceptionclasses import CustomError, CritError, SyntaxError, LogicError
import messages as messages
import metadata as metadata
class RunProgramDirective(object):
def __init__(self, kwargs, program_bool = True):
... | 36.483553 | 101 | 0.553692 |
e1d84bc6f5c9d001ff60c86fdd025558cbffaa85 | 21,858 | py | Python | simulators/scasim/detector_properties.py | mwregan2/MiriTE | 6b65939454db60bf10619d50fcb5769d23598b76 | [
"CNRI-Python"
] | null | null | null | simulators/scasim/detector_properties.py | mwregan2/MiriTE | 6b65939454db60bf10619d50fcb5769d23598b76 | [
"CNRI-Python"
] | 24 | 2019-08-09T15:03:20.000Z | 2022-03-04T10:04:48.000Z | simulators/scasim/detector_properties.py | mwregan2/MiriTE | 6b65939454db60bf10619d50fcb5769d23598b76 | [
"CNRI-Python"
] | 4 | 2019-06-16T15:03:23.000Z | 2020-12-02T19:51:52.000Z | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Module detector_properties - Defines the properties of the MIRI SCA
detector.
NOTE: Other JWST detectors can be simulated as long as their
properties can be described by the parameters contained here.
The main differences are the material, pixel size and detector
thic... | 54.10396 | 92 | 0.707247 |
25e37d117f588df7bd2e63c33965a7a0f19bf7c7 | 1,091 | py | Python | fc_sql/SQLModifier.py | fangqk1991/py-sql | 61acf9c4ca8fe3544a9d6b79fd338f3548f2f838 | [
"MIT"
] | null | null | null | fc_sql/SQLModifier.py | fangqk1991/py-sql | 61acf9c4ca8fe3544a9d6b79fd338f3548f2f838 | [
"MIT"
] | null | null | null | fc_sql/SQLModifier.py | fangqk1991/py-sql | 61acf9c4ca8fe3544a9d6b79fd338f3548f2f838 | [
"MIT"
] | null | null | null | from .SQLException import SQLException
from .BuilderBase import BuilderBase
from .FCDatabase import FCDatabase
class SQLModifier(BuilderBase):
__updateColumns: list = None
__updateValues: list = None
def __init__(self, db: FCDatabase):
super().__init__(db)
self.__updateColumns = []
... | 30.305556 | 80 | 0.598533 |
93652bf0fc81defd6635deceb62496df4a4526c5 | 27,251 | py | Python | reco_utils/recommender/deeprec/models/base_model.py | rafsanulhasan/recommenders | cbc863f320624fc87d6d008a244fe55fcf954856 | [
"MIT"
] | 2 | 2021-04-14T02:33:03.000Z | 2021-05-13T03:15:44.000Z | reco_utils/recommender/deeprec/models/base_model.py | likebupt/recommenders | 6815e5663ef87da1d0b9029bc9a8a367dc3d33a7 | [
"MIT"
] | 1 | 2021-05-10T01:11:41.000Z | 2021-05-10T01:11:41.000Z | reco_utils/recommender/deeprec/models/base_model.py | likebupt/recommenders | 6815e5663ef87da1d0b9029bc9a8a367dc3d33a7 | [
"MIT"
] | 1 | 2021-08-28T18:05:09.000Z | 2021-08-28T18:05:09.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from os.path import join
import abc
import time
import os
import numpy as np
import tensorflow as tf
from tensorflow import keras
from reco_utils.recommender.deeprec.deeprec_utils import cal_metric
__all__ = ["BaseModel"]
... | 38.490113 | 118 | 0.551319 |
ebf1dc53aa648ac3a1bb11e3f73666244aecc09d | 1,652 | py | Python | python/datasources/county_adjacency.py | adams314/health-equity-tracker | 2c6b63381a79227009376a255325d43300dda7cf | [
"MIT"
] | null | null | null | python/datasources/county_adjacency.py | adams314/health-equity-tracker | 2c6b63381a79227009376a255325d43300dda7cf | [
"MIT"
] | null | null | null | python/datasources/county_adjacency.py | adams314/health-equity-tracker | 2c6b63381a79227009376a255325d43300dda7cf | [
"MIT"
] | null | null | null | from ingestion import gcs_to_bq_util
from datasources.data_source import DataSource
# Adjacent counties for each county in the United States from US Census data
class CountyAdjacency(DataSource):
@staticmethod
def get_id():
"""Returns the data source's unique id. """
return 'COUNTY_ADJACENCY'... | 36.711111 | 85 | 0.64891 |
2084a3facb71d7ee0fdfb2fff9b2376583773716 | 5,795 | py | Python | azure-mgmt-web/azure/mgmt/web/models/site_extension_info.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-web/azure/mgmt/web/models/site_extension_info.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-web/azure/mgmt/web/models/site_extension_info.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.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 ... | 45.273438 | 108 | 0.639517 |
fc160bcea27c34433d77fd970a778e1b9415f68d | 17,834 | py | Python | pypeit/scripts/coadd_datacube.py | NathanSandford/PypeIt | 89470d27422b7f8662642060b5687a5b2fda27ed | [
"BSD-3-Clause"
] | null | null | null | pypeit/scripts/coadd_datacube.py | NathanSandford/PypeIt | 89470d27422b7f8662642060b5687a5b2fda27ed | [
"BSD-3-Clause"
] | null | null | null | pypeit/scripts/coadd_datacube.py | NathanSandford/PypeIt | 89470d27422b7f8662642060b5687a5b2fda27ed | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# See top-level LICENSE file for Copyright information
#
# -*- coding: utf-8 -*-
"""
This script enables the user to convert spec2D FITS files
from IFU instruments into a 3D cube with a defined WCS.
"""
import argparse
from astropy import units
from astropy.io import fits
from astropy.coordina... | 49.265193 | 147 | 0.639172 |
59b40d5df2810c48036390ec2c4d829d5b3e23f0 | 58,538 | py | Python | resources/WPy32/python-3.10.2/Lib/threading.py | eladkarako/yt-dlp_kit | 6365651111ef4d2f94335cf38bf4d9b0136d42d2 | [
"Unlicense"
] | 1 | 2022-03-26T15:43:50.000Z | 2022-03-26T15:43:50.000Z | resources/WPy32/python-3.10.2/Lib/threading.py | eladkarako/yt-dlp_kit | 6365651111ef4d2f94335cf38bf4d9b0136d42d2 | [
"Unlicense"
] | null | null | null | resources/WPy32/python-3.10.2/Lib/threading.py | eladkarako/yt-dlp_kit | 6365651111ef4d2f94335cf38bf4d9b0136d42d2 | [
"Unlicense"
] | 1 | 2022-03-28T19:28:45.000Z | 2022-03-28T19:28:45.000Z | """Thread module emulating a subset of Java's threading model."""
import os as _os
import sys as _sys
import _thread
import functools
from time import monotonic as _time
from _weakrefset import WeakSet
from itertools import islice as _islice, count as _count
try:
from _collections import deque as _dequ... | 35.71568 | 93 | 0.612594 |
eca8d98364b0e3c8d120dd66c07005a1980de419 | 17,630 | py | Python | keras_retinanet/bin/train.py | Muhannes/keras-retinanet | e8d6418a9a7170cb2d6355bbcb62b29cf7cded99 | [
"Apache-2.0"
] | 1 | 2019-01-03T08:48:15.000Z | 2019-01-03T08:48:15.000Z | keras_retinanet/bin/train.py | Muhannes/keras-retinanet | e8d6418a9a7170cb2d6355bbcb62b29cf7cded99 | [
"Apache-2.0"
] | null | null | null | keras_retinanet/bin/train.py | Muhannes/keras-retinanet | e8d6418a9a7170cb2d6355bbcb62b29cf7cded99 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
Copyright 2017-2018 Fizyr (https://fizyr.com)
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 applicabl... | 40.159453 | 187 | 0.66937 |
2a681ae39ca6fa62be09d20c3970640a1c569924 | 5,640 | py | Python | grafana_backup/grafanaSettings.py | bilalbayasut/grafana-backup-tool | 442b62e3e95302dce6efba6d6c6ddbd99fa1fa22 | [
"MIT"
] | null | null | null | grafana_backup/grafanaSettings.py | bilalbayasut/grafana-backup-tool | 442b62e3e95302dce6efba6d6c6ddbd99fa1fa22 | [
"MIT"
] | null | null | null | grafana_backup/grafanaSettings.py | bilalbayasut/grafana-backup-tool | 442b62e3e95302dce6efba6d6c6ddbd99fa1fa22 | [
"MIT"
] | null | null | null | import base64
import json
import os
from datetime import datetime
from grafana_backup.commons import (load_config,
to_python2_and_3_compatible_string)
def main(config_path):
# Load config from optional configuration file located at ~/.grafana-backup.json
# or load defaults... | 45.483871 | 109 | 0.712766 |
1627b37a4682efc46d3bbc8355fd52814105e8cd | 12,461 | py | Python | rpython/jit/backend/llsupport/asmmemmgr.py | kantai/passe-pypy-taint-tracking | b60a3663f8fe89892dc182c8497aab97e2e75d69 | [
"MIT"
] | 2 | 2016-07-06T23:30:20.000Z | 2017-05-30T15:59:31.000Z | rpython/jit/backend/llsupport/asmmemmgr.py | kantai/passe-pypy-taint-tracking | b60a3663f8fe89892dc182c8497aab97e2e75d69 | [
"MIT"
] | null | null | null | rpython/jit/backend/llsupport/asmmemmgr.py | kantai/passe-pypy-taint-tracking | b60a3663f8fe89892dc182c8497aab97e2e75d69 | [
"MIT"
] | 2 | 2020-07-09T08:14:22.000Z | 2021-01-15T18:01:25.000Z | import sys
from rpython.rlib.rarithmetic import intmask, r_uint, LONG_BIT
from rpython.rlib.objectmodel import we_are_translated
from rpython.rlib import rmmap
from rpython.rlib.debug import debug_start, debug_print, debug_stop
from rpython.rlib.debug import have_debug_prints
from rpython.rtyper.lltypesystem import llt... | 38.341538 | 79 | 0.599149 |
7fe38f91bad4cbd0fd97bfbf8448d5d06f624e98 | 2,502 | py | Python | denver/_colorama/ansi.py | AdityaJ7/denver | b17e46b7d68980ce695f15bc078b05916dd1705a | [
"MIT"
] | null | null | null | denver/_colorama/ansi.py | AdityaJ7/denver | b17e46b7d68980ce695f15bc078b05916dd1705a | [
"MIT"
] | null | null | null | denver/_colorama/ansi.py | AdityaJ7/denver | b17e46b7d68980ce695f15bc078b05916dd1705a | [
"MIT"
] | null | null | null | # Copyright (c) 2020 Xcodz.
# All Rights Reserved.
'''
This module generates ANSI character codes to printing colors to terminals.
See: http://en.wikipedia.org/wiki/ANSI_escape_code
'''
CSI = '\033['
OSC = '\033]'
BEL = '\007'
def code_to_chars(code):
return CSI + str(code) + 'm'
def set_title(title):
ret... | 24.057692 | 78 | 0.548361 |
54500b4818e5c6b90bfd28406619f1fe33aece74 | 2,818 | py | Python | analytics/tests/stats/test_cluster.py | Genometric/ToolVisibilityQuantifier | 82572a678c27820ec1a8dbbc54dcee18ee601096 | [
"MIT"
] | 3 | 2020-04-03T02:00:10.000Z | 2020-06-18T01:39:22.000Z | analytics/tests/stats/test_cluster.py | Genometric/ToolVisibilityQuantifier | 82572a678c27820ec1a8dbbc54dcee18ee601096 | [
"MIT"
] | 1 | 2020-07-14T06:39:02.000Z | 2020-07-14T06:39:02.000Z | analytics/tests/stats/test_cluster.py | Genometric/ToolVisibilityQuantifier | 82572a678c27820ec1a8dbbc54dcee18ee601096 | [
"MIT"
] | 1 | 2020-05-22T20:12:47.000Z | 2020-05-22T20:12:47.000Z | """
"""
import os
from ..base_test_case import BaseTestCase
from lib.stats.cluster import Cluster
from lib.base import Base, CLUSTER_NAME_COLUMN_LABEL
import math
from os import listdir
class TestCluster(BaseTestCase):
"""
"""
def test_if_all_expected_files_written(self, tmp_clustered_files):
# ... | 32.767442 | 108 | 0.606458 |
28bda633611d6f1b7263e1d3b195c46eba4497d3 | 4,794 | py | Python | airbyte-integrations/connectors/source-zendesk-support/source_zendesk_support/source.py | heap/airbyte | 35e65f444f38b617a12e12d425da2115f08b5f14 | [
"MIT"
] | 22 | 2020-08-27T00:47:20.000Z | 2020-09-17T15:39:39.000Z | airbyte-integrations/connectors/source-zendesk-support/source_zendesk_support/source.py | heap/airbyte | 35e65f444f38b617a12e12d425da2115f08b5f14 | [
"MIT"
] | 116 | 2020-08-27T01:11:27.000Z | 2020-09-19T02:47:52.000Z | airbyte-integrations/connectors/source-zendesk-support/source_zendesk_support/source.py | heap/airbyte | 35e65f444f38b617a12e12d425da2115f08b5f14 | [
"MIT"
] | 1 | 2020-09-15T06:10:01.000Z | 2020-09-15T06:10:01.000Z | #
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
#
import base64
from typing import Any, List, Mapping, Tuple
import requests
from airbyte_cdk.sources import AbstractSource
from airbyte_cdk.sources.streams import Stream
from airbyte_cdk.sources.streams.http.requests_native_auth import TokenAuthenticator
fro... | 37.453125 | 117 | 0.644139 |
a777279e25e5f54d2f1baa3f5a903f9db98549ea | 305 | py | Python | scripts/find_unmatched.py | dyelax/selfie2bitmoji | 1aa292800827a250494f43246b65812cff96b921 | [
"MIT"
] | 3 | 2017-12-21T05:15:12.000Z | 2018-01-26T16:36:06.000Z | scripts/find_unmatched.py | dyelax/selfie2bitmoji | 1aa292800827a250494f43246b65812cff96b921 | [
"MIT"
] | 1 | 2018-11-30T12:02:01.000Z | 2018-12-04T12:01:19.000Z | scripts/find_unmatched.py | dyelax/selfie2bitmoji | 1aa292800827a250494f43246b65812cff96b921 | [
"MIT"
] | 2 | 2018-09-21T16:52:29.000Z | 2019-12-02T08:15:46.000Z | from glob import glob
import os
png_paths = glob('../data/bitmoji/*/*.png')
npy_paths = glob('../data/bitmoji/*/*.npy')
png_set = set([os.path.splitext(p)[0] for p in png_paths])
npy_set = set([os.path.splitext(p)[0] for p in npy_paths])
sym_diff = png_set ^ npy_set
print len(sym_diff)
print sym_diff | 23.461538 | 58 | 0.698361 |
924a7519f61f4047837e62e04bf45c90cc2a16bd | 13,311 | py | Python | darling_ansible/python_venv/lib/python3.7/site-packages/oci/data_catalog/models/work_request.py | revnav/sandbox | f9c8422233d093b76821686b6c249417502cf61d | [
"Apache-2.0"
] | null | null | null | darling_ansible/python_venv/lib/python3.7/site-packages/oci/data_catalog/models/work_request.py | revnav/sandbox | f9c8422233d093b76821686b6c249417502cf61d | [
"Apache-2.0"
] | null | null | null | darling_ansible/python_venv/lib/python3.7/site-packages/oci/data_catalog/models/work_request.py | revnav/sandbox | f9c8422233d093b76821686b6c249417502cf61d | [
"Apache-2.0"
] | 1 | 2020-06-25T03:12:58.000Z | 2020-06-25T03:12:58.000Z | # coding: utf-8
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 33.528967 | 245 | 0.648336 |
a8173161eb19f96e96b3ea300c2dd2b83f831312 | 8,727 | py | Python | code/utils/loss.py | JJBUP/yolov3_pytorch | 448ff1de08c321bf14fa24eb38b5fc19482a338b | [
"MIT"
] | 1 | 2021-12-17T14:34:21.000Z | 2021-12-17T14:34:21.000Z | code/utils/loss.py | JJBUP/yolov3_pytorch | 448ff1de08c321bf14fa24eb38b5fc19482a338b | [
"MIT"
] | null | null | null | code/utils/loss.py | JJBUP/yolov3_pytorch | 448ff1de08c321bf14fa24eb38b5fc19482a338b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import math
import torch
import torch.nn as nn
from .util import to_cpu
def compute_loss(predictions, targets, model):
"""
:param predictions: 三个尺度的输出 (b,3,13,13,85) ,(b,3,26,26,85),(b,3,52,52,85)
:param targets: 真实框
:param model:
:return:
"""
device = targets.devi... | 42.570732 | 114 | 0.561247 |
a6ca425d4935104b85eda28b7c891a01353aaeda | 97 | py | Python | tests/io/file_close.py | Euromance/pycopy | 540cfcc52d17667a5f6b2a176427cc031029b78f | [
"MIT"
] | 663 | 2018-12-30T00:17:59.000Z | 2022-03-14T05:03:41.000Z | tests/io/file_close.py | Euromance/pycopy | 540cfcc52d17667a5f6b2a176427cc031029b78f | [
"MIT"
] | 41 | 2019-06-06T08:31:19.000Z | 2022-02-13T16:53:41.000Z | tests/io/file_close.py | Euromance/pycopy | 540cfcc52d17667a5f6b2a176427cc031029b78f | [
"MIT"
] | 60 | 2019-06-01T04:25:00.000Z | 2022-02-25T01:47:31.000Z | f = open("io/data/file1")
f.close()
# Should be possible to close again without error.
f.close()
| 19.4 | 50 | 0.701031 |
484c31a9eb20f196a06d1b004d2d233220e9669e | 939 | py | Python | awx/main/migrations/0056_v350_custom_venv_history.py | DamoR25/awxnew | 03ed6e97558ae090ea52703caf6ed1b196557981 | [
"Apache-2.0"
] | 11,396 | 2017-09-07T04:56:02.000Z | 2022-03-31T13:56:17.000Z | awx/main/migrations/0056_v350_custom_venv_history.py | DamoR25/awxnew | 03ed6e97558ae090ea52703caf6ed1b196557981 | [
"Apache-2.0"
] | 11,046 | 2017-09-07T09:30:46.000Z | 2022-03-31T20:28:01.000Z | awx/main/migrations/0056_v350_custom_venv_history.py | DamoR25/awxnew | 03ed6e97558ae090ea52703caf6ed1b196557981 | [
"Apache-2.0"
] | 3,592 | 2017-09-07T04:14:31.000Z | 2022-03-31T23:53:09.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2019-01-22 22:20
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0055_v340_add_grafana_notification'),
]
operations = [
migrations.... | 31.3 | 150 | 0.620873 |
02d5414a8a046ddef8a33b6b5f07a3b51f609ffb | 6,384 | py | Python | worker/LinkedIn/service1/Extractor.py | LamriAli/remote-extraction-proxy-and-worker | 6e402efbd94298b015797183934fc10744ea0ded | [
"MIT"
] | null | null | null | worker/LinkedIn/service1/Extractor.py | LamriAli/remote-extraction-proxy-and-worker | 6e402efbd94298b015797183934fc10744ea0ded | [
"MIT"
] | null | null | null | worker/LinkedIn/service1/Extractor.py | LamriAli/remote-extraction-proxy-and-worker | 6e402efbd94298b015797183934fc10744ea0ded | [
"MIT"
] | null | null | null |
from asyncio.windows_events import NULL
from selenium import webdriver
from bs4 import BeautifulSoup
import time
import pandas as pd
from bot_studio import *
import re as re
from selenium.webdriver.common.by import By
import win32clipboard
import os
from bs4 import BeautifulSoup as bs
from connect import connect
fro... | 30.84058 | 273 | 0.509085 |
2068c1721d3e8596dfeea10e64a4a7ae531587c7 | 2,539 | py | Python | MiDaS/run.py | shatgupt/3d-photo-inpainting | 08e9bf70e39bf9f1d5a187bee9e70ea81d35fd48 | [
"MIT"
] | null | null | null | MiDaS/run.py | shatgupt/3d-photo-inpainting | 08e9bf70e39bf9f1d5a187bee9e70ea81d35fd48 | [
"MIT"
] | null | null | null | MiDaS/run.py | shatgupt/3d-photo-inpainting | 08e9bf70e39bf9f1d5a187bee9e70ea81d35fd48 | [
"MIT"
] | null | null | null | """Compute depth maps for images in the input folder.
"""
import os
import glob
import torch
# from monodepth_net import MonoDepthNet
# import utils
import matplotlib.pyplot as plt
import numpy as np
import cv2
import imageio
def run_depth(img_names, input_path, output_path, model_path, Net, utils, target_w=None):
... | 28.852273 | 115 | 0.632532 |
97a28d3e4a5fd3b20ef1db4e64b1406b012dd69e | 962 | py | Python | py/02_home/backward_string_by_word.py | myConsciousness/CheckIO | fb5336a5d0e1d7c5c6ecc4bba25805547425afe7 | [
"Apache-2.0"
] | 2 | 2020-09-14T16:02:54.000Z | 2022-01-24T19:55:05.000Z | py/02_home/backward_string_by_word.py | myConsciousness/checkio-history | fb5336a5d0e1d7c5c6ecc4bba25805547425afe7 | [
"Apache-2.0"
] | null | null | null | py/02_home/backward_string_by_word.py | myConsciousness/checkio-history | fb5336a5d0e1d7c5c6ecc4bba25805547425afe7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
In a given string you should reverse every word, but the words should stay in their places.
Input: A string.
Output: A string.
'''
import re
def backward_string_by_word(text):
# your code here
splittedText = re.split("( )", text)
reversedWords = []
for word in splittedTe... | 28.294118 | 91 | 0.680873 |
50a40ed26b485bd03cc4b59057cb170e67537cac | 306 | py | Python | S3_to_Local.py | MoSaidi/Real-Time-Data-Streaming-Analytics-System-for-tracking-Pedestrians | 5fed44509422a169d614da2694c9b3e64900fc4c | [
"MIT"
] | 1 | 2021-11-21T22:42:48.000Z | 2021-11-21T22:42:48.000Z | S3_to_Local.py | MoSaidi/Real-Time-Data-Streaming-Analytics-System-for-tracking-Pedestrians | 5fed44509422a169d614da2694c9b3e64900fc4c | [
"MIT"
] | 12 | 2021-11-21T11:05:48.000Z | 2022-01-10T20:41:05.000Z | S3_to_Local.py | MoSaidi/Real-Time-Data-Streaming-Analytics-System-for-tracking-Pedestrians | 5fed44509422a169d614da2694c9b3e64900fc4c | [
"MIT"
] | 6 | 2021-11-24T18:41:46.000Z | 2022-01-09T10:17:46.000Z | import boto3
import os
s3 = boto3.client('s3', aws_access_key_id='&YOUR_ACCESS_KEY' , aws_secret_access_key='&YOUR_SECRET_KEY')
s3.download_file('projectbigdata2022', 'positions.csv', os.path.join('.','positions.csv'))
s3.download_file('projectbigdata2022', 'devices.csv', os.path.join('.','devices.csv'))
| 51 | 104 | 0.75817 |
8a131f288c13f2e43687299aea4eb9aec71c817d | 2,201 | py | Python | tests/models/symbol/scsi_target_port_id_test.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 5 | 2016-08-23T17:52:22.000Z | 2019-05-16T08:45:30.000Z | tests/models/symbol/scsi_target_port_id_test.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 2 | 2016-11-10T05:30:21.000Z | 2019-04-05T15:03:37.000Z | tests/models/symbol/scsi_target_port_id_test.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 7 | 2016-08-25T16:11:44.000Z | 2021-02-22T05:31:25.000Z | #!/usr/bin/env python
# coding: utf-8
"""
The Clear BSD License
Copyright (c) – 2016, NetApp, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions... | 57.921053 | 845 | 0.775557 |
561dab8baf1eb15f6a57803e2067df6c3db4008d | 1,169 | py | Python | data_converter/drf_yasg_inspectors.py | Hedgehog18/Data_converter | 2672910d605ca77662a629b587f6ae792c393204 | [
"MIT"
] | null | null | null | data_converter/drf_yasg_inspectors.py | Hedgehog18/Data_converter | 2672910d605ca77662a629b587f6ae792c393204 | [
"MIT"
] | null | null | null | data_converter/drf_yasg_inspectors.py | Hedgehog18/Data_converter | 2672910d605ca77662a629b587f6ae792c393204 | [
"MIT"
] | null | null | null | from django_filters.rest_framework import DjangoFilterBackend
from drf_yasg.inspectors import DjangoRestResponsePagination, CoreAPICompatInspector
from rest_framework.filters import SearchFilter
class DODjangoRestResponsePagination(DjangoRestResponsePagination):
def get_paginator_parameters(self, paginator):
... | 41.75 | 84 | 0.731394 |
e8b5883079c528e6884888d6cf76df3c8a6537c1 | 453 | py | Python | video/rooms/participants/kick-remove-participant/remove-participant.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | null | null | null | video/rooms/participants/kick-remove-participant/remove-participant.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | null | null | null | video/rooms/participants/kick-remove-participant/remove-participant.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | null | null | null | # Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
api_key_sid = "SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
api_key_secret = "your_api_key_secret"
client = Client(api_key_sid, api_key_secret)
participant = client.... | 37.75 | 96 | 0.825607 |
ccd5ab42b286e9d8c02d8ba3d44e10736be46fd6 | 486 | py | Python | hubblestack/extmods/modules/sysexit.py | arshiyaaggarwal/hubble | 5bea686df72f2b101546e20467ab2c9b5f536730 | [
"Apache-2.0"
] | null | null | null | hubblestack/extmods/modules/sysexit.py | arshiyaaggarwal/hubble | 5bea686df72f2b101546e20467ab2c9b5f536730 | [
"Apache-2.0"
] | null | null | null | hubblestack/extmods/modules/sysexit.py | arshiyaaggarwal/hubble | 5bea686df72f2b101546e20467ab2c9b5f536730 | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
""" intended for testing, this module's sole purpose is to cause the running
daemon to exit gracefully within a scheduled timeframe """
from __future__ import absolute_import
import logging
import sys
LOG = logging.getLogger(__name__)
def sysexit(code=0):
"""
This function closes ... | 22.090909 | 76 | 0.705761 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.