hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f04f7654b91c9acdf1a8a28e56bd96cb7d669b63 | 688 | py | Python | python-annotator/meta_converter.py | bubble-07/AnimeReal | b12193f10d231ee85a2a86ec2defeca0b5a4e240 | [
"BSD-2-Clause"
] | null | null | null | python-annotator/meta_converter.py | bubble-07/AnimeReal | b12193f10d231ee85a2a86ec2defeca0b5a4e240 | [
"BSD-2-Clause"
] | null | null | null | python-annotator/meta_converter.py | bubble-07/AnimeReal | b12193f10d231ee85a2a86ec2defeca0b5a4e240 | [
"BSD-2-Clause"
] | null | null | null | import sys
import os
import tensorflow as tf
in_dir = sys.argv[1]
out_dir = sys.argv[2]
meta_path = os.path.join(in_dir, "RGBToCoord.meta")
output_node_names = ['RGBToCoordOut'] # Output nodes
with tf.Session() as sess:
# Restore the graph
saver = tf.train.import_meta_graph(meta_path)
# Load weight... | 23.724138 | 68 | 0.700581 |
c7861870e268764722a9d52c83629e314af90c51 | 2,695 | py | Python | plugins/action/enterprise_ssid.py | robertcsapo/dnacenter-ansible | 33f776f8c0bc7113da73191c301dd1807e6b4a43 | [
"MIT"
] | null | null | null | plugins/action/enterprise_ssid.py | robertcsapo/dnacenter-ansible | 33f776f8c0bc7113da73191c301dd1807e6b4a43 | [
"MIT"
] | null | null | null | plugins/action/enterprise_ssid.py | robertcsapo/dnacenter-ansible | 33f776f8c0bc7113da73191c301dd1807e6b4a43 | [
"MIT"
] | null | null | null | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.action import ActionBase
try:
from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import (
AnsibleArgSpecValidator,
)
except ImportError:
ANSIBLE_UTILS_IS_INST... | 33.271605 | 128 | 0.69128 |
aaf1883a3f4a98c5ad35b186fc6df2c29b3bca5f | 64,971 | py | Python | holoviews/operation/datashader.py | Jacob-Barhak/holoviews | 5df0269595ca7befca202f9d05522c68983dc974 | [
"BSD-3-Clause"
] | null | null | null | holoviews/operation/datashader.py | Jacob-Barhak/holoviews | 5df0269595ca7befca202f9d05522c68983dc974 | [
"BSD-3-Clause"
] | null | null | null | holoviews/operation/datashader.py | Jacob-Barhak/holoviews | 5df0269595ca7befca202f9d05522c68983dc974 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, division
from collections import Callable, Iterable
import warnings
import param
import numpy as np
import pandas as pd
import xarray as xr
import datashader as ds
import datashader.reductions as rd
import datashader.transfer_functions as tf
import dask.dataframe as dd
from pa... | 41.781994 | 117 | 0.587801 |
565a9635535ed7a4f195e5a435dd8b1eae076cc3 | 2,146 | py | Python | rdkit/Dbase/DbModule.py | kazuyaujihara/rdkit | 06027dcd05674787b61f27ba46ec0d42a6037540 | [
"BSD-3-Clause"
] | 1,609 | 2015-01-05T02:41:13.000Z | 2022-03-30T21:57:24.000Z | rdkit/Dbase/DbModule.py | kazuyaujihara/rdkit | 06027dcd05674787b61f27ba46ec0d42a6037540 | [
"BSD-3-Clause"
] | 3,412 | 2015-01-06T12:13:33.000Z | 2022-03-31T17:25:41.000Z | rdkit/Dbase/DbModule.py | bp-kelley/rdkit | e0de7c9622ce73894b1e7d9568532f6d5638058a | [
"BSD-3-Clause"
] | 811 | 2015-01-11T03:33:48.000Z | 2022-03-28T11:57:49.000Z | # $Id$
#
# Copyright (C) 2003-2006 Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
from rdkit import RDConfig
if hasattr(R... | 34.612903 | 94 | 0.693383 |
e6bf4ccdc8ca755e4e309e102d25e5c3dd7f72f4 | 1,069 | py | Python | backend/src/migrations/__init__.py | wooshifu/Blog | a8ad6a7e1e1bb312b64f54414e5d945b73df5e1d | [
"MIT"
] | null | null | null | backend/src/migrations/__init__.py | wooshifu/Blog | a8ad6a7e1e1bb312b64f54414e5d945b73df5e1d | [
"MIT"
] | 3 | 2021-05-07T11:38:25.000Z | 2022-02-26T10:26:47.000Z | backend/src/migrations/__init__.py | wooshifu/Blog | a8ad6a7e1e1bb312b64f54414e5d945b73df5e1d | [
"MIT"
] | null | null | null | """
this directory is used for upgrade database schemas, if you changed the database DDL,
you should add a file named 'mxxxxxxxx.py' to define the upgrading process.
"""
import re
from pathlib import Path
from models.migration import Migration as MigrationModel
from .migration import Migration
__current_dir = Path(_... | 36.862069 | 101 | 0.738073 |
99baad001f9527c324aad5d74a710fcf9f75769a | 221 | py | Python | sqlite_dissect/file/__init__.py | Defense-Cyber-Crime-Center/sqlite-dissect | e1a6c19928bc092bf7aeaff71072634f77a452ea | [
"MIT"
] | 12 | 2021-10-21T21:23:51.000Z | 2022-03-13T03:01:53.000Z | sqlite_dissect/file/__init__.py | hartescout/sqlite-dissect | c4cd1047837a8bc6bbfa69f448149d046a7cc703 | [
"MIT"
] | 21 | 2021-09-13T17:00:33.000Z | 2022-03-31T12:56:56.000Z | sqlite_dissect/file/__init__.py | hartescout/sqlite-dissect | c4cd1047837a8bc6bbfa69f448149d046a7cc703 | [
"MIT"
] | 1 | 2021-10-21T22:00:07.000Z | 2021-10-21T22:00:07.000Z |
"""
__init__.py
This init script will initialize any needed logic for this package.
This package will control parsing and access to all (supported) sqlite files including the
database, rollback journal, and wal.
"""
| 18.416667 | 90 | 0.769231 |
f07d5d42b4b42b1b3eeaeb2f852b60ac52c6fadb | 688 | py | Python | RoboticsLanguage/Inputs/FaultToleranceSystem/Tests/test_FaultToleranceSystem.py | robotcaresystems/roboticslanguage | 3bb7a2bf64ab8e9068889713fbeb18a45cd5a3ed | [
"Apache-2.0"
] | 64 | 2018-05-15T14:36:44.000Z | 2022-03-09T05:00:31.000Z | RoboticsLanguage/Inputs/FaultToleranceSystem/Tests/test_FaultToleranceSystem.py | robotcaresystems/roboticslanguage | 3bb7a2bf64ab8e9068889713fbeb18a45cd5a3ed | [
"Apache-2.0"
] | 9 | 2018-04-17T21:12:27.000Z | 2019-11-08T20:53:32.000Z | RoboticsLanguage/Inputs/FaultToleranceSystem/Tests/test_FaultToleranceSystem.py | robotcaresystems/roboticslanguage | 3bb7a2bf64ab8e9068889713fbeb18a45cd5a3ed | [
"Apache-2.0"
] | 10 | 2018-03-27T12:09:12.000Z | 2021-02-16T08:07:26.000Z | #
# This is the Robotics Language compiler
#
# test_fault_tolerance_system.py: Unit testing file
#
# Created on: 08 March, 2019
# Author: Gabriel Lopes
# Licence: license
# Copyright: copyright
#
import unittest
from RoboticsLanguage.Inputs.FaultToleranceSystem import Parse
class TestFaultToleranc... | 25.481481 | 101 | 0.515988 |
7b79d1c27d728ef74a847c49e1332eeb7d316505 | 804 | py | Python | examples/settings.py | seankmartin/brainrender | c845fc33b9936aa193feb1d750464114d3bdcdb7 | [
"BSD-3-Clause"
] | null | null | null | examples/settings.py | seankmartin/brainrender | c845fc33b9936aa193feb1d750464114d3bdcdb7 | [
"BSD-3-Clause"
] | null | null | null | examples/settings.py | seankmartin/brainrender | c845fc33b9936aa193feb1d750464114d3bdcdb7 | [
"BSD-3-Clause"
] | null | null | null | """
Brainrender provides several default settins (e.g. for shader style)
which can be changed to personalize your rendering.
This example shows you how
"""
import brainrender
from brainrender import Scene
from rich import print
from myterial import orange
from pathlib import Path
print(f"[{orange}]Running example: ... | 22.971429 | 68 | 0.738806 |
e523c7d017a09d14d197b814c5b8818a019d97fd | 5,434 | py | Python | exercise2/exercise2.py | ricardolopes86/nvm-exercises | e913d53d7d1298a29c856c94495d54a0d0c0cdea | [
"Apache-2.0"
] | null | null | null | exercise2/exercise2.py | ricardolopes86/nvm-exercises | e913d53d7d1298a29c856c94495d54a0d0c0cdea | [
"Apache-2.0"
] | null | null | null | exercise2/exercise2.py | ricardolopes86/nvm-exercises | e913d53d7d1298a29c856c94495d54a0d0c0cdea | [
"Apache-2.0"
] | null | null | null | """
Playing with numbers.
This awesome program will perform some operations to a list of numbers.
You should input *exactly* 6 numbers right after the command.
"""
import sys
import json
import datetime
import random
from functools import reduce
import operator
def format_filename():
"""
Just a simple method t... | 33.54321 | 175 | 0.640228 |
ef24d5296ce009c73f9f1266ec0dda0671283ed6 | 1,352 | py | Python | python/AnalysisLaunchers/delete_analysis.py | FabricGenomics/omicia_api_examples | b761d40744032720bdf1a4f59877e16b8b1dfcf0 | [
"MIT"
] | 2 | 2017-06-13T13:59:17.000Z | 2021-12-17T18:52:08.000Z | python/AnalysisLaunchers/delete_analysis.py | FabricGenomics/omicia_api_examples | b761d40744032720bdf1a4f59877e16b8b1dfcf0 | [
"MIT"
] | 1 | 2017-11-22T00:20:19.000Z | 2017-11-22T00:41:05.000Z | python/AnalysisLaunchers/delete_analysis.py | FabricGenomics/omicia_api_examples | b761d40744032720bdf1a4f59877e16b8b1dfcf0 | [
"MIT"
] | 3 | 2020-03-05T18:41:36.000Z | 2021-01-14T08:31:30.000Z | """
Delete analysis by id
Example usages:
python delete_analysis.py --id 1802
"""
import os
import requests
from requests.auth import HTTPBasicAuth
import sys
import simplejson as json
import argparse
# Load environment variables for request authentication parameters
if "FABRIC_API_PASSWORD" not in os... | 26.509804 | 83 | 0.727811 |
c23c5f4d2676303d1d583c76a15b6d9a78ec89da | 4,111 | py | Python | loca_navi_demo.py | XiaoLiSean/Cognitive-Map | 6b2019e5b3a46902b06c8d5d1e86b39425042de9 | [
"MIT"
] | null | null | null | loca_navi_demo.py | XiaoLiSean/Cognitive-Map | 6b2019e5b3a46902b06c8d5d1e86b39425042de9 | [
"MIT"
] | null | null | null | loca_navi_demo.py | XiaoLiSean/Cognitive-Map | 6b2019e5b3a46902b06c8d5d1e86b39425042de9 | [
"MIT"
] | 1 | 2021-11-04T06:25:31.000Z | 2021-11-04T06:25:31.000Z | import argparse, copy
import multiprocessing, time
from lib.navigation import Navigation
from Map.map_plotter import Plotter
from distutils.util import strtobool
parser = argparse.ArgumentParser()
parser.add_argument("--scene_type", type=int, default=1, help="Choose scene type for simulation, 1 for Kitchens, 2 for Li... | 60.455882 | 188 | 0.793238 |
8cd738a48d07eba7892449bedcd882980b561d53 | 42,424 | py | Python | src/robotide/ui/treeplugin.py | cbeytas/RIDE | 183747c66b80fcc8e5b79139278f928858944c5b | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-11-30T21:24:19.000Z | 2021-11-30T21:24:19.000Z | src/robotide/ui/treeplugin.py | cbeytas/RIDE | 183747c66b80fcc8e5b79139278f928858944c5b | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/robotide/ui/treeplugin.py | cbeytas/RIDE | 183747c66b80fcc8e5b79139278f928858944c5b | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework 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
... | 39.390901 | 101 | 0.656138 |
d9e348fcb464f510f3cae88ca287ea89386c7f17 | 11,870 | py | Python | test/mutable_edge_test.py | zli117/Evolution | b5be1552338fa57b9a3e4743c8e917e30d2caada | [
"MIT"
] | 4 | 2019-07-02T21:52:30.000Z | 2021-10-31T19:39:21.000Z | test/mutable_edge_test.py | zli117/Evolution | b5be1552338fa57b9a3e4743c8e917e30d2caada | [
"MIT"
] | null | null | null | test/mutable_edge_test.py | zli117/Evolution | b5be1552338fa57b9a3e4743c8e917e30d2caada | [
"MIT"
] | 1 | 2020-01-25T22:29:49.000Z | 2020-01-25T22:29:49.000Z | from typing import cast
import tensorflow as tf
from evolution.encoding.base import Edge
from evolution.encoding.base import IdentityOperation
from evolution.encoding.base import MaxPool2D
from evolution.encoding.base import PointConv2D
from evolution.encoding.base import Vertex
from evolution.encoding.mutable_edge i... | 34.306358 | 79 | 0.71904 |
545a5fee7760a84ab2c40761aa0655d0bbcc471b | 1,356 | py | Python | AnalizeBonusViagem/Mundo3/aula17listas.py | D-Wolter/Pycharm-Projects | aeb3a2464cf6c6578e5b47b13b54ff3ebd6e52dd | [
"MIT"
] | null | null | null | AnalizeBonusViagem/Mundo3/aula17listas.py | D-Wolter/Pycharm-Projects | aeb3a2464cf6c6578e5b47b13b54ff3ebd6e52dd | [
"MIT"
] | null | null | null | AnalizeBonusViagem/Mundo3/aula17listas.py | D-Wolter/Pycharm-Projects | aeb3a2464cf6c6578e5b47b13b54ff3ebd6e52dd | [
"MIT"
] | null | null | null |
#adicionar
lanche = ['batata','coca','hamburger']
lanche.append('nugets')#adiciona ao fim
print(lanche)#['batata', 'coca', 'hamburger', 'nugets']
lanche.insert(0,'bigMAc')#adiciona no numero do index desejado
print(lanche)#['bigMAc', 'batata', 'coca', 'hamburger', 'nugets']
#apagar remover
del lanche[3]#indica numer... | 23.789474 | 65 | 0.667404 |
e6555fb3c7703dba771283562f37c0d6e2a391ae | 1,610 | py | Python | mplwidget.py | ryanjphelan/ENGG4801_RyanPhelan | 473c5e834cfee8c921722c4d78292b34c76c6514 | [
"MIT"
] | null | null | null | mplwidget.py | ryanjphelan/ENGG4801_RyanPhelan | 473c5e834cfee8c921722c4d78292b34c76c6514 | [
"MIT"
] | null | null | null | mplwidget.py | ryanjphelan/ENGG4801_RyanPhelan | 473c5e834cfee8c921722c4d78292b34c76c6514 | [
"MIT"
] | null | null | null | # ------------------------------------------------- -----
# -------------------- mplwidget.py --------------------
# -------------------------------------------------- ----
from PyQt5.QtWidgets import *
from PyQt5 import QtCore, QtGui, QtWidgets, uic
from PyQt5.QtWidgets import QInputDialog, QLineEdit, QFileDialog... | 35 | 97 | 0.684472 |
86fd11b7a034e819057deb3cd0d3d0f1e1bd538e | 4,278 | py | Python | test/functional/interface_wescoin_cli.py | ahamium/WESCOIN | a15d64caa24dec050f997fe2031d518ee1d76836 | [
"MIT"
] | null | null | null | test/functional/interface_wescoin_cli.py | ahamium/WESCOIN | a15d64caa24dec050f997fe2031d518ee1d76836 | [
"MIT"
] | null | null | null | test/functional/interface_wescoin_cli.py | ahamium/WESCOIN | a15d64caa24dec050f997fe2031d518ee1d76836 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test wescoin-cli"""
from test_framework.test_framework import WescoinTestFramework
from test_framework.... | 54.846154 | 160 | 0.705704 |
1d6f9a823384d2ce692cf5cbd6a5ecd95a429ecd | 34,955 | py | Python | haproxy/datadog_checks/haproxy/haproxy.py | remicalixte/integrations-core | b115e18c52820fe1a92495f538fdc14ddf83cfe1 | [
"BSD-3-Clause"
] | null | null | null | haproxy/datadog_checks/haproxy/haproxy.py | remicalixte/integrations-core | b115e18c52820fe1a92495f538fdc14ddf83cfe1 | [
"BSD-3-Clause"
] | null | null | null | haproxy/datadog_checks/haproxy/haproxy.py | remicalixte/integrations-core | b115e18c52820fe1a92495f538fdc14ddf83cfe1 | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2012-present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
from __future__ import division
import copy
import re
import socket
import time
from collections import defaultdict, namedtuple
from six import PY2, iteritems
from six.moves.urllib.parse import urlparse
from... | 39.857469 | 119 | 0.604577 |
e5c910d883d4bb3e6a644df8220432f5d1f01b8d | 473 | py | Python | logger.py | sjsafranek/mtg_price_tracker | 058c77cda241712d7a44c980ae64f325e5905230 | [
"MIT"
] | null | null | null | logger.py | sjsafranek/mtg_price_tracker | 058c77cda241712d7a44c980ae64f325e5905230 | [
"MIT"
] | null | null | null | logger.py | sjsafranek/mtg_price_tracker | 058c77cda241712d7a44c980ae64f325e5905230 | [
"MIT"
] | null | null | null |
import logging
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter(
"%(asctime)s [%(levelname)s] [%(threadName)s] %(filename)s %(funcName)s:%(lineno)d %(message)s",
datefmt='%Y-%m-%d %H:%M:%S')
streamhandler = logging.StreamHandler()
streamhandler.setFormatter(form... | 26.277778 | 103 | 0.742072 |
0a515115ee0c557df7ea1481a6d4a3e603f552ec | 9,403 | py | Python | SALib/tests/test_optimal_trajectories.py | stijnvanhoey/SALib | e0c3bdf2fe5acbcb0524b083b158db7c635fe023 | [
"MIT"
] | null | null | null | SALib/tests/test_optimal_trajectories.py | stijnvanhoey/SALib | e0c3bdf2fe5acbcb0524b083b158db7c635fe023 | [
"MIT"
] | null | null | null | SALib/tests/test_optimal_trajectories.py | stijnvanhoey/SALib | e0c3bdf2fe5acbcb0524b083b158db7c635fe023 | [
"MIT"
] | 1 | 2020-05-21T13:15:18.000Z | 2020-05-21T13:15:18.000Z | from unittest import skipUnless
import numpy as np
from nose.tools import raises, with_setup
from numpy.testing import assert_equal
from SALib.sample.morris import sample_oat, \
find_optimum_combination, \
compute_optimised_trajectories, \
... | 32.992982 | 84 | 0.535255 |
fb7dde954da591f58849c9250387184af70578bd | 2,553 | py | Python | extensions/rules/graph.py | VictoriaRoux/oppia | 5ae2a7f0b5c85d6e28222844d22ebdbfb81923c6 | [
"Apache-2.0"
] | 3 | 2015-03-17T01:34:14.000Z | 2015-04-11T10:35:53.000Z | extensions/rules/graph.py | VictoriaRoux/oppia | 5ae2a7f0b5c85d6e28222844d22ebdbfb81923c6 | [
"Apache-2.0"
] | null | null | null | extensions/rules/graph.py | VictoriaRoux/oppia | 5ae2a7f0b5c85d6e28222844d22ebdbfb81923c6 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 37.544118 | 80 | 0.601253 |
7e34dbc4e6a0da3481d978b314a0b21135aeafcd | 813 | py | Python | python/event_convert.py | jassey/event_detail | 7584eb3371a2e43b2b2a6f656c27885d8802af98 | [
"Apache-2.0"
] | 1 | 2015-09-28T06:27:27.000Z | 2015-09-28T06:27:27.000Z | python/event_convert.py | jassey/event_detail | 7584eb3371a2e43b2b2a6f656c27885d8802af98 | [
"Apache-2.0"
] | null | null | null | python/event_convert.py | jassey/event_detail | 7584eb3371a2e43b2b2a6f656c27885d8802af98 | [
"Apache-2.0"
] | null | null | null | #
# 行数据拆分
#
# 输入:
# ID,日期,名称,创建者,参与者列表
# 1,2015-09-01,"设计师面试",HR,"小李,小王,小严"
#
# 输出:
# ID,日期,名称,创建者,参与者
# 1,2015-09-01,设计师面试,HR,小李
# 1,2015-09-01,设计师面试,HR,小王
# 1,2015-09-01,设计师面试,HR,小严
import csv
source = 'event.csv'
dest = 'event_detail.csv'
def get_detail():
content = []
with open(source, 'r', encoding='... | 21.972973 | 64 | 0.553506 |
70f6555e23c64229f6e3852bb33fcdc67bf8998f | 6,939 | py | Python | scvi/models/distributions.py | gokceneraslan/scVI | afab47cf3b4b76acf41555e99665a3bd86f8320a | [
"MIT"
] | 1 | 2022-03-17T17:19:10.000Z | 2022-03-17T17:19:10.000Z | scvi/models/distributions.py | gokceneraslan/scVI | afab47cf3b4b76acf41555e99665a3bd86f8320a | [
"MIT"
] | null | null | null | scvi/models/distributions.py | gokceneraslan/scVI | afab47cf3b4b76acf41555e99665a3bd86f8320a | [
"MIT"
] | null | null | null | from typing import Union, Tuple
import warnings
import torch
from torch.distributions import (
constraints,
Distribution,
Gamma,
Poisson,
)
from torch.distributions.utils import (
broadcast_all,
probs_to_logits,
lazy_property,
logits_to_probs,
)
from scvi.models.log_likelihood import l... | 34.695 | 120 | 0.645482 |
9b63dd3ed50830f4606adb3979421a8e21c30bbf | 2,978 | py | Python | tests/unit/facts/test_iri_mapping.py | pgajdos/py-junos-eznc | a13e49a3bc1ceaf681940f593d190f5d02d47369 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/unit/facts/test_iri_mapping.py | pgajdos/py-junos-eznc | a13e49a3bc1ceaf681940f593d190f5d02d47369 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/unit/facts/test_iri_mapping.py | pgajdos/py-junos-eznc | a13e49a3bc1ceaf681940f593d190f5d02d47369 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | __author__ = "Stacy Smith"
__credits__ = "Jeremy Schulman, Nitin Kumar"
import unittest
import pytest
from mock import patch, MagicMock
import os
from jnpr.junos import Device
from ncclient.manager import Manager, make_device_handler
from ncclient.transport import SSHSession
@pytest.mark.unit
class TestIriMapping(... | 36.317073 | 88 | 0.670248 |
978749bad74e58610e9aeb47a9ad48fd20a5c2bb | 532 | py | Python | gevent_tasks/errors.py | blakev/gevent-tasks | 3cf5204e8587a0d7ea9ec7c86006173330b7d744 | [
"MIT"
] | 17 | 2017-10-18T00:01:42.000Z | 2021-08-10T10:17:59.000Z | gevent_tasks/errors.py | blakev/gevent-tasks | 3cf5204e8587a0d7ea9ec7c86006173330b7d744 | [
"MIT"
] | null | null | null | gevent_tasks/errors.py | blakev/gevent-tasks | 3cf5204e8587a0d7ea9ec7c86006173330b7d744 | [
"MIT"
] | 2 | 2017-10-18T10:32:59.000Z | 2021-01-25T20:15:08.000Z | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# >>
# gevent-tasks, 2019
# <<
class GeventTasksError(Exception):
"""Base exception class."""
class TaskKeyError(GeventTasksError, KeyError):
"""Thrown inside task execution when namespacing has an issue."""
class TaskRuntimeError(GeventTasksError, Runt... | 19.703704 | 71 | 0.710526 |
c53f602c8932e90a31712dc578e7bd389237f336 | 3,568 | py | Python | ERP/estoque/lista_view.py | CSAAtibaia/Listas | 36ad6ffb01d17184d10727e1945bb738b5c199e8 | [
"MIT"
] | null | null | null | ERP/estoque/lista_view.py | CSAAtibaia/Listas | 36ad6ffb01d17184d10727e1945bb738b5c199e8 | [
"MIT"
] | 7 | 2019-12-05T02:27:57.000Z | 2021-09-22T17:57:30.000Z | ERP/estoque/lista_view.py | CSAAtibaia/Listas | 36ad6ffb01d17184d10727e1945bb738b5c199e8 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from ERP.estoque.models import Estoque, EstoqueItens
from ERP.core.models import Item
from django.db.models import Sum, F, CharField, IntegerField, Case, When, Value #, Q
from django.db.models.functions import Coalesce, Cast, Concat
# Create your views here.
def lista_itens(request)... | 39.644444 | 99 | 0.609305 |
e3bca6561a49502f2e787ea387700820a8506120 | 736 | py | Python | LeetCode/0081. Search in Rotated Sorted Array II/solution.py | InnoFang/oh-my-algorithms | f559dba371ce725a926725ad28d5e1c2facd0ab2 | [
"Apache-2.0"
] | 19 | 2018-08-26T03:10:58.000Z | 2022-03-07T18:12:52.000Z | LeetCode/0081. Search in Rotated Sorted Array II/solution.py | InnoFang/Algorithm-Library | 1896b9d8b1fa4cd73879aaecf97bc32d13ae0169 | [
"Apache-2.0"
] | null | null | null | LeetCode/0081. Search in Rotated Sorted Array II/solution.py | InnoFang/Algorithm-Library | 1896b9d8b1fa4cd73879aaecf97bc32d13ae0169 | [
"Apache-2.0"
] | 6 | 2020-03-16T23:00:06.000Z | 2022-01-13T07:02:08.000Z | """
279 / 279 test cases passed.
Runtime: 36 ms
Memory Usage: 15 MB
"""
class Solution:
def search(self, nums: List[int], target: int) -> bool:
l, r = 0, len(nums) - 1
while l <= r:
mid = l + ((r - l) >> 1)
if nums[mid] == target:
return True
if nu... | 27.259259 | 59 | 0.36413 |
9b64afd6e50899f2e049661816b9d0d204a6475a | 17,760 | py | Python | pyvo/nameresolver/tests/test_SesameNoNet.py | kernsuite-debian/pyvo | ee85c50c5c520ac7bede2d6f18de225c57dedc33 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | pyvo/nameresolver/tests/test_SesameNoNet.py | kernsuite-debian/pyvo | ee85c50c5c520ac7bede2d6f18de225c57dedc33 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | pyvo/nameresolver/tests/test_SesameNoNet.py | kernsuite-debian/pyvo | ee85c50c5c520ac7bede2d6f18de225c57dedc33 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for pyvo.nameresolver.sesame
"""
from __future__ import print_function, division
import os, sys, shutil, re, imp
import unittest
from .. import sesame
import xml.etree.ElementTree as ET
from astropy.utils.data import get_p... | 37 | 99 | 0.605743 |
2e843c038ea389a03d6943a6720d06efe3c834c8 | 230 | py | Python | pyvisa_py/protocols/__init__.py | Handfeger/pyvisa-py | fcfb45895cd44dd922985c3a9d8f3372c8318d63 | [
"MIT"
] | 157 | 2017-08-01T07:46:59.000Z | 2022-03-06T04:44:11.000Z | pyvisa_py/protocols/__init__.py | Handfeger/pyvisa-py | fcfb45895cd44dd922985c3a9d8f3372c8318d63 | [
"MIT"
] | 251 | 2017-05-31T00:48:56.000Z | 2022-03-22T06:12:37.000Z | pyvisa_py/protocols/__init__.py | Handfeger/pyvisa-py | fcfb45895cd44dd922985c3a9d8f3372c8318d63 | [
"MIT"
] | 77 | 2017-05-31T14:32:52.000Z | 2022-02-19T20:58:06.000Z | # -*- coding: utf-8 -*-
"""Implements protocols on top of lower level libraries to talk to instruments.
:copyright: 2014-2020 by PyVISA-py Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
| 25.555556 | 79 | 0.721739 |
c01517b1f5042ce3a58ddb794915d97f5981af66 | 14,718 | py | Python | source/utctx/unittest/runtests.py | cablelabs/Utopia | 1f8654b3dc91fe78941c4a67d507747bc14fca57 | [
"Apache-2.0"
] | null | null | null | source/utctx/unittest/runtests.py | cablelabs/Utopia | 1f8654b3dc91fe78941c4a67d507747bc14fca57 | [
"Apache-2.0"
] | null | null | null | source/utctx/unittest/runtests.py | cablelabs/Utopia | 1f8654b3dc91fe78941c4a67d507747bc14fca57 | [
"Apache-2.0"
] | 1 | 2020-12-10T07:34:30.000Z | 2020-12-10T07:34:30.000Z | ##########################################################################
# If not stated otherwise in this file or this component's Licenses.txt
# file the following copyright and licenses apply:
#
# Copyright 2015 RDK Management
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use th... | 33.912442 | 126 | 0.605381 |
3335f36d0f250a3cd551f342f5d4b6327b2cb5c9 | 38,752 | py | Python | Blender/scripts/MOD_Opti_PSK_Dump/MOD5_Opti_PSK_Dump_animation_might_be_stable_work_on_head_not_tail_align_for_offset.py | ECToo/unrealtacticalmod | f78c77587d8a706697703be064fb854ffc31ea4c | [
"Unlicense"
] | null | null | null | Blender/scripts/MOD_Opti_PSK_Dump/MOD5_Opti_PSK_Dump_animation_might_be_stable_work_on_head_not_tail_align_for_offset.py | ECToo/unrealtacticalmod | f78c77587d8a706697703be064fb854ffc31ea4c | [
"Unlicense"
] | null | null | null | Blender/scripts/MOD_Opti_PSK_Dump/MOD5_Opti_PSK_Dump_animation_might_be_stable_work_on_head_not_tail_align_for_offset.py | ECToo/unrealtacticalmod | f78c77587d8a706697703be064fb854ffc31ea4c | [
"Unlicense"
] | null | null | null | #!BPY
"""
Name: 'Unreal Skeletal Mesh/Animation (.psk and .psa) Mod05'
Blender: 240
Group: 'Export'
Tooltip: 'Unreal Skeletal Mesh and Animation Export (*.psk, *.psa)'
"""
__author__ = "Optimus_P-Fat/Active_Trash"
__version__ = "0.0.4"
__bpydoc__ = """\
-- Unreal Skeletal Mesh and Animation Export ... | 32.537364 | 252 | 0.658366 |
69b311ca9a1b3953aef25c2499ce05cca83047bc | 18,835 | py | Python | nova/openstack/common/gettextutils.py | bopopescu/nova-28 | add7f5625ba49c0575328294a796428c443cd988 | [
"Apache-2.0"
] | null | null | null | nova/openstack/common/gettextutils.py | bopopescu/nova-28 | add7f5625ba49c0575328294a796428c443cd988 | [
"Apache-2.0"
] | 5 | 2020-06-05T17:58:28.000Z | 2022-02-11T03:39:35.000Z | nova/openstack/common/gettextutils.py | bopopescu/nova-28 | add7f5625ba49c0575328294a796428c443cd988 | [
"Apache-2.0"
] | 1 | 2020-07-24T06:47:54.000Z | 2020-07-24T06:47:54.000Z | # Copyright 2012 Red Hat, Inc.
# Copyright 2013 IBM Corp.
# 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.... | 37.745491 | 79 | 0.650279 |
add096f5a04be3b79076a7a9e072443c1a05ada2 | 1,932 | py | Python | sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/_configuration.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/_configuration.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/_configuration.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.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 ... | 38.64 | 86 | 0.671843 |
6535c2ad7e83778c230674c0525da591801933c2 | 2,608 | py | Python | selfdrive/tombstoned.py | iambluefred/Test_3 | 31e888342ef86591bdd311be17e00f4f5036122b | [
"MIT"
] | null | null | null | selfdrive/tombstoned.py | iambluefred/Test_3 | 31e888342ef86591bdd311be17e00f4f5036122b | [
"MIT"
] | null | null | null | selfdrive/tombstoned.py | iambluefred/Test_3 | 31e888342ef86591bdd311be17e00f4f5036122b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import time
from raven import Client
from raven.transport.http import HTTPTransport
from selfdrive.version import version, dirty
from selfdrive.swaglog import cloudlog
MAX_SIZE = 100000 * 10 # Normal size is 40-100k, allow up to 1M
def get_tombstones():
"""Returns list of (filen... | 27.166667 | 131 | 0.659126 |
f3162f8945a86c4d6e119975fbec0048161155f4 | 5,567 | py | Python | data_loading.py | zikegcwk/aicamp_food | 038d3a18830e6f5b9fdaf9d91a5df7fd8c7a5140 | [
"MIT"
] | null | null | null | data_loading.py | zikegcwk/aicamp_food | 038d3a18830e6f5b9fdaf9d91a5df7fd8c7a5140 | [
"MIT"
] | 8 | 2020-03-04T08:25:25.000Z | 2020-03-04T08:25:37.000Z | data_loading.py | zikegcwk/aicamp_food | 038d3a18830e6f5b9fdaf9d91a5df7fd8c7a5140 | [
"MIT"
] | 3 | 2020-03-28T12:54:58.000Z | 2021-02-16T21:42:31.000Z | import os, csv, random, pickle
'''
because this is a demo app, we just load everything into memory.
The data needs to:
1. Display candies information
2. Display ingredients information
candies = {
'Candy Corn': {
'score': -0.5,
'ingredients': [...],
'good_ingredients': [1, 2, 3],
... | 31.630682 | 123 | 0.540866 |
c18baa35d9e93dec6cae0eae6975ed9e74b40dcf | 2,251 | py | Python | src/cnn/transforms/transforms.py | portelaraian/tuberculosis-runmila-minoHealth | 03f7f146e913053399ec31bc0aeda018df9b2eff | [
"MIT"
] | null | null | null | src/cnn/transforms/transforms.py | portelaraian/tuberculosis-runmila-minoHealth | 03f7f146e913053399ec31bc0aeda018df9b2eff | [
"MIT"
] | null | null | null | src/cnn/transforms/transforms.py | portelaraian/tuberculosis-runmila-minoHealth | 03f7f146e913053399ec31bc0aeda018df9b2eff | [
"MIT"
] | null | null | null | import random
import math
import cv2
from albumentations.augmentations import functional as F
from albumentations.core.transforms_interface import ImageOnlyTransform
'''def resized_crop(image, height, width, x_min, y_min, x_max, y_max):
image = F.crop(image, x_min, y_min, x_max, y_max)
image = cv2.resize(ima... | 33.597015 | 105 | 0.615282 |
c4b2ca49abc55a05647560a86bb01f7e5e52d3b3 | 2,088 | py | Python | order_fulfillment/iterate_multi_item_pickfailprob_highlow.py | srinathsridhar/simulation-data | fac912c7cfa365d9b7264d4cd58c3a8a866729df | [
"MIT"
] | null | null | null | order_fulfillment/iterate_multi_item_pickfailprob_highlow.py | srinathsridhar/simulation-data | fac912c7cfa365d9b7264d4cd58c3a8a866729df | [
"MIT"
] | null | null | null | order_fulfillment/iterate_multi_item_pickfailprob_highlow.py | srinathsridhar/simulation-data | fac912c7cfa365d9b7264d4cd58c3a8a866729df | [
"MIT"
] | null | null | null | import json
import order_fulfillment_multi_item as ofmi
import random
def read_data(dataFile, ship_cost):
file = open(dataFile, 'r')
inst = json.load(file)
file.close()
if ship_cost == 'H':
for _store in inst[0]:
for _item in range(len(_store['p'])):
if _store['p'][... | 34.8 | 103 | 0.523467 |
ec6602dfc5c53064e87a79ca29afa958f42e5785 | 2,573 | py | Python | openGaussBase/testcase/SECURITY/PERMISSIONS/Opengauss_Function_Security_Policy_Case0037.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/SECURITY/PERMISSIONS/Opengauss_Function_Security_Policy_Case0037.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/SECURITY/PERMISSIONS/Opengauss_Function_Security_Policy_Case0037.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 37.289855 | 84 | 0.699184 |
d2cdabdab25c201d99d6c1f01cc011887c7b9c54 | 8,468 | py | Python | bin/translate_server.py | zhengzx-nlp/NJUNMT-tf-server | d931021a39ebcd9b036fa612d69cf3876378e198 | [
"Apache-2.0"
] | null | null | null | bin/translate_server.py | zhengzx-nlp/NJUNMT-tf-server | d931021a39ebcd9b036fa612d69cf3876378e198 | [
"Apache-2.0"
] | null | null | null | bin/translate_server.py | zhengzx-nlp/NJUNMT-tf-server | d931021a39ebcd9b036fa612d69cf3876378e198 | [
"Apache-2.0"
] | 2 | 2018-11-02T07:52:04.000Z | 2019-04-25T09:06:06.000Z | # -*- coding: UTF-8 -*-
# Copyright 2018, Natural Language Processing Group, Nanjing University,
#
# Author: Zheng Zaixiang
# Contact: zhengzx@nlp.nju.edu.cn
# or zhengzx.142857@gmail.com
#
from __future__ import absolute_import
from __future__ import division
from __future__ import print_fun... | 36.188034 | 113 | 0.583727 |
a3c7897172d61d22fb47eeae4c41991514b26cd9 | 5,785 | py | Python | data/p3BR/R2/benchmark/startQiskit_noisy137.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R2/benchmark/startQiskit_noisy137.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R2/benchmark/startQiskit_noisy137.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=3
# total number=24
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from... | 29.666667 | 140 | 0.630078 |
b7962ff71e44b0f302dda3ec54203ec817d7707d | 25,185 | py | Python | python/ray/tests/test_advanced.py | linyiyue/ray | 90d2456ec70270a1f894ec3ef6f3004533859e03 | [
"Apache-2.0"
] | 1 | 2021-02-14T01:53:37.000Z | 2021-02-14T01:53:37.000Z | python/ray/tests/test_advanced.py | linyiyue/ray | 90d2456ec70270a1f894ec3ef6f3004533859e03 | [
"Apache-2.0"
] | 77 | 2021-06-05T07:04:56.000Z | 2022-03-26T07:04:33.000Z | python/ray/tests/test_advanced.py | linyiyue/ray | 90d2456ec70270a1f894ec3ef6f3004533859e03 | [
"Apache-2.0"
] | 1 | 2019-07-25T23:01:38.000Z | 2019-07-25T23:01:38.000Z | # coding: utf-8
from concurrent.futures import ThreadPoolExecutor
import json
import logging
import random
import sys
import threading
import time
import os
import numpy as np
import pytest
import ray.cluster_utils
import ray._private.profiling as profiling
from ray._private.test_utils import (client_test_enabled,
... | 30.56432 | 79 | 0.630891 |
a9bf0799fac9d5a0caf25cd752e4ab6ea674218b | 6,389 | py | Python | tests/test_wal_transfer.py | ArtemZ/wal-e | c1fc33b2f9f8e2c6d51cbb7607fdaf7eb16e87a1 | [
"BSD-3-Clause"
] | 1 | 2021-04-10T09:30:28.000Z | 2021-04-10T09:30:28.000Z | tests/test_wal_transfer.py | heroku/wal-e-archived | 0b7c363abc1a1dfafbe2defbf753893f35824318 | [
"BSD-3-Clause"
] | null | null | null | tests/test_wal_transfer.py | heroku/wal-e-archived | 0b7c363abc1a1dfafbe2defbf753893f35824318 | [
"BSD-3-Clause"
] | null | null | null | import gevent
import pytest
from fast_wait import fast_wait
from wal_e import worker
from wal_e.exception import UserCritical
assert fast_wait
class Explosion(Exception):
"""Marker type for fault injection."""
pass
class FakeWalSegment(object):
def __init__(self, seg_path, explicit=False,
... | 26.077551 | 74 | 0.653154 |
590503421f48c179e03dc339595a1b076192234d | 5,521 | py | Python | src/unicon/plugins/sros/service_implementation.py | TestingBytes/unicon.plugins | 0600956d805deb4fd790aa3ef591c5d659e85de1 | [
"Apache-2.0"
] | 1 | 2021-02-25T19:36:56.000Z | 2021-02-25T19:36:56.000Z | src/unicon/plugins/sros/service_implementation.py | TestingBytes/unicon.plugins | 0600956d805deb4fd790aa3ef591c5d659e85de1 | [
"Apache-2.0"
] | null | null | null | src/unicon/plugins/sros/service_implementation.py | TestingBytes/unicon.plugins | 0600956d805deb4fd790aa3ef591c5d659e85de1 | [
"Apache-2.0"
] | null | null | null | __author__ = 'Difu Hu <pyats-support@cisco.com;pyats-support-ext@cisco.com>'
from unicon.bases.routers.services import BaseService
from unicon.core.errors import SubCommandFailure
from unicon.eal.dialogs import Dialog, Statement
from unicon.plugins.generic.service_implementation import Configure, Execute
from .statem... | 31.548571 | 78 | 0.629958 |
abda2917553bde53f81af523c6139724dd84cd73 | 873 | py | Python | app/user/views.py | mzwamshandu/recipe-app-api | cc7da9c7e72da318ca3f36bd4a3fcf173ef1a929 | [
"MIT"
] | null | null | null | app/user/views.py | mzwamshandu/recipe-app-api | cc7da9c7e72da318ca3f36bd4a3fcf173ef1a929 | [
"MIT"
] | null | null | null | app/user/views.py | mzwamshandu/recipe-app-api | cc7da9c7e72da318ca3f36bd4a3fcf173ef1a929 | [
"MIT"
] | null | null | null | from rest_framework import generics, authentication, permissions
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.settings import api_settings
from user.serializers import UserSerializer, AuthTokenSerializer
class CreateUserView(generics.CreateAPIView):
# Create a new user in the sys... | 33.576923 | 67 | 0.80756 |
02b25039bcca245f303523d0bee33ddaab3db065 | 11,959 | py | Python | google/cloud/scheduler/v1beta1/scheduler-v1beta1-py/google/cloud/scheduler_v1beta1/services/cloud_scheduler/transports/base.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/cloud/scheduler/v1beta1/scheduler-v1beta1-py/google/cloud/scheduler_v1beta1/services/cloud_scheduler/transports/base.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/cloud/scheduler/v1beta1/scheduler-v1beta1-py/google/cloud/scheduler_v1beta1/services/cloud_scheduler/transports/base.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 38.085987 | 161 | 0.598378 |
d723d647e0eb43b64c90edfe9eb2be9ca36e7e0f | 3,422 | py | Python | lib/aging_vec.py | calico/2019_murine_cell_aging | 11ab15b82df886c4a51f73b25c061a9360862c2e | [
"Apache-2.0"
] | 1 | 2020-12-03T21:28:05.000Z | 2020-12-03T21:28:05.000Z | lib/aging_vec.py | calico/2019_murine_cell_aging | 11ab15b82df886c4a51f73b25c061a9360862c2e | [
"Apache-2.0"
] | null | null | null | lib/aging_vec.py | calico/2019_murine_cell_aging | 11ab15b82df886c4a51f73b25c061a9360862c2e | [
"Apache-2.0"
] | 1 | 2021-04-16T12:01:16.000Z | 2021-04-16T12:01:16.000Z | '''Compute vectors of difference across a contrast'''
import anndata
import numpy as np
import tqdm
def compute_displacement_vector(adata: anndata.AnnData,
contrast: str = 'age',
groupby: str = 'cell_type',
embedding: str ... | 34.918367 | 92 | 0.591175 |
b1df5780446f1f41b5b73502680ee6bd1e2ccd30 | 3,136 | py | Python | HiProc/anneal.py | a-moin/hi-opt | 9fe9d86b8968e15e378ebf782ec6b5f971858c8b | [
"BSD-2-Clause"
] | null | null | null | HiProc/anneal.py | a-moin/hi-opt | 9fe9d86b8968e15e378ebf782ec6b5f971858c8b | [
"BSD-2-Clause"
] | null | null | null | HiProc/anneal.py | a-moin/hi-opt | 9fe9d86b8968e15e378ebf782ec6b5f971858c8b | [
"BSD-2-Clause"
] | null | null | null | #***************************************************************************#
# Copyright (c) 2016 - 2017, University of California, Berkeley. #
# #
# Author(s): Ali Moin, EECS Department, UC Berkeley. #
# ... | 27.269565 | 77 | 0.442921 |
542b4f622276259ca9900b77a4539149273ea7ad | 2,000 | py | Python | discovery-infra/update_assisted_service_cm.py | yuvalk/assisted-test-infra | 0f933a39f8ecb3dcb38de5ea289d44f3daef69fd | [
"Apache-2.0"
] | null | null | null | discovery-infra/update_assisted_service_cm.py | yuvalk/assisted-test-infra | 0f933a39f8ecb3dcb38de5ea289d44f3daef69fd | [
"Apache-2.0"
] | null | null | null | discovery-infra/update_assisted_service_cm.py | yuvalk/assisted-test-infra | 0f933a39f8ecb3dcb38de5ea289d44f3daef69fd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Idea is to pass os environments to assisted-service config map, to make an easy way to configure assisted-service
#
# Note: defaulting an env var to "" in Makefile, will result in an empty string value in the configmap.
# E.g.
# Makefile:
# MY_VAR := $(or $(MY_VAR), "")
#... | 27.777778 | 115 | 0.634 |
7db32ab35063bba437a27c010de6f77d99c55432 | 1,970 | py | Python | designate/sqlalchemy/expressions.py | melodous/designate | c0da0c464c07d34a9855ab704302d7662beb7c1d | [
"Apache-2.0"
] | 1 | 2015-02-26T03:23:13.000Z | 2015-02-26T03:23:13.000Z | designate/sqlalchemy/expressions.py | NeCTAR-RC/designate | 99874f5c608954df9c988740e3cbf0d3b6b7a269 | [
"Apache-2.0"
] | null | null | null | designate/sqlalchemy/expressions.py | NeCTAR-RC/designate | 99874f5c608954df9c988740e3cbf0d3b6b7a269 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# Author: Kiall Mac Innes <kiall@hp.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/L... | 33.389831 | 79 | 0.680711 |
7e413909c7c7279f314a8ac90901f77f55c6d5bc | 6,873 | py | Python | tst/schedulers/test_hyperband_sychronous.py | awslabs/syne-tune | 1dd8e157477b86db01047a9a7821780ea04389bc | [
"ECL-2.0",
"Apache-2.0"
] | 97 | 2021-11-18T17:14:30.000Z | 2022-03-29T00:33:12.000Z | tst/schedulers/test_hyperband_sychronous.py | awslabs/syne-tune | 1dd8e157477b86db01047a9a7821780ea04389bc | [
"ECL-2.0",
"Apache-2.0"
] | 54 | 2021-11-18T17:14:12.000Z | 2022-03-22T08:11:48.000Z | tst/schedulers/test_hyperband_sychronous.py | awslabs/syne-tune | 1dd8e157477b86db01047a9a7821780ea04389bc | [
"ECL-2.0",
"Apache-2.0"
] | 9 | 2021-11-29T11:47:32.000Z | 2022-02-24T15:28:11.000Z | # Copyright 2021 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | 34.365 | 88 | 0.654299 |
69101bb89750086af43a08346a175a1694a65524 | 1,735 | py | Python | demos/component.py | nickderobertis/nick-derobertis-site | 386061dc258921eed41f2d3965ef69e02adde7ba | [
"MIT"
] | 1 | 2022-03-31T10:55:40.000Z | 2022-03-31T10:55:40.000Z | demos/component.py | nickderobertis/nick-derobertis-site | 386061dc258921eed41f2d3965ef69e02adde7ba | [
"MIT"
] | 8 | 2020-08-28T11:44:37.000Z | 2020-08-31T09:19:19.000Z | demos/component.py | nickderobertis/nick-derobertis-site | 386061dc258921eed41f2d3965ef69e02adde7ba | [
"MIT"
] | null | null | null | import pathlib
import sys
ROOT_PATH = pathlib.Path(__file__).parent.parent
sys.path.insert(0, str(ROOT_PATH))
import param
from nick_derobertis_site.common.component import HTMLComponent
import panel as pn
sub_component_template = """
<p>subcomponent begin</p>
<div id="should-contain-the-subcomponent-items" style... | 25.895522 | 90 | 0.724496 |
f8ee9da58964daf11a08fb45da024ef255c6af05 | 378 | py | Python | Guanabara/aula12.py | manuellaAlvesVarella/python | eedb8362f0ebc8074f87d15c9e629e319ff29394 | [
"MIT"
] | 1 | 2022-03-25T20:42:20.000Z | 2022-03-25T20:42:20.000Z | Guanabara/aula12.py | manuellaAlvesVarella/python | eedb8362f0ebc8074f87d15c9e629e319ff29394 | [
"MIT"
] | null | null | null | Guanabara/aula12.py | manuellaAlvesVarella/python | eedb8362f0ebc8074f87d15c9e629e319ff29394 | [
"MIT"
] | null | null | null | nome = str(input('Qual é o seu nome ?')).strip()
if nome == 'Gustavo':
print ('Que nome bonito!')
elif nome == 'Pedro' or nome == 'Maria' or nome == 'Paulo':
print ('Seu nome é bem popular no Brasil')
elif nome in 'Ana Claudia Jéssica Juliana':
print ('Belo nome Feminino')
else:
print ('Seu nome... | 37.8 | 60 | 0.616402 |
b4939590391a64e8659c12151c0a43a6c3965f8a | 1,110 | py | Python | install/app_store/tk-desktop/v2.4.2/python/tk_desktop/wait_screen.py | JoanAzpeitia/lp_sg | e0ee79555e419dd2ae3a5f31e5515b3f40b22a62 | [
"MIT"
] | null | null | null | install/app_store/tk-desktop/v2.4.2/python/tk_desktop/wait_screen.py | JoanAzpeitia/lp_sg | e0ee79555e419dd2ae3a5f31e5515b3f40b22a62 | [
"MIT"
] | null | null | null | install/app_store/tk-desktop/v2.4.2/python/tk_desktop/wait_screen.py | JoanAzpeitia/lp_sg | e0ee79555e419dd2ae3a5f31e5515b3f40b22a62 | [
"MIT"
] | 1 | 2020-02-15T10:42:56.000Z | 2020-02-15T10:42:56.000Z | # Copyright (c) 2013 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to the S... | 32.647059 | 75 | 0.721622 |
6cf9f8c943d4d8850785276788d78a90a7ddaa62 | 6,389 | py | Python | utils/models.py | NitishPuri/MLNDCapstone | f96e3f304fcce93559826a8c554e5d4410c0585b | [
"MIT"
] | null | null | null | utils/models.py | NitishPuri/MLNDCapstone | f96e3f304fcce93559826a8c554e5d4410c0585b | [
"MIT"
] | null | null | null | utils/models.py | NitishPuri/MLNDCapstone | f96e3f304fcce93559826a8c554e5d4410c0585b | [
"MIT"
] | null | null | null | from keras.layers import (Activation, BatchNormalization, Conv2D, Input,
MaxPooling2D, UpSampling2D, concatenate)
from keras.layers import MaxPool2D, GlobalAveragePooling2D, Dense
from keras.optimizers import Adam, RMSprop
from keras.models import Model, Sequential
from... | 38.721212 | 133 | 0.637345 |
4740b7f79d18c7490290b025477dacf128a94124 | 20,674 | py | Python | examples/language-modeling/run_mlm.py | JadeMaveric/transformers | fb2b89840bf2ab9f74702bf83af8ddf92b61efb3 | [
"Apache-2.0"
] | 2 | 2021-04-18T07:58:07.000Z | 2021-07-14T01:50:45.000Z | examples/language-modeling/run_mlm.py | JadeMaveric/transformers | fb2b89840bf2ab9f74702bf83af8ddf92b61efb3 | [
"Apache-2.0"
] | 2 | 2021-06-22T23:35:09.000Z | 2022-02-22T21:40:11.000Z | examples/language-modeling/run_mlm.py | JadeMaveric/transformers | fb2b89840bf2ab9f74702bf83af8ddf92b61efb3 | [
"Apache-2.0"
] | 1 | 2020-11-02T06:37:04.000Z | 2020-11-02T06:37:04.000Z | #!/usr/bin/env python
# coding=utf-8
# Copyright 2020 The HuggingFace Team 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-... | 43.070833 | 119 | 0.672536 |
5b52ac519855ddc461ea4706864ee41c786a3ffc | 834 | py | Python | Recursion ana Comninatorial Problems/school_teams .py | borislavstoychev/Algorithms | 629f9d8df00399af85acf8893db1599e46db6013 | [
"MIT"
] | null | null | null | Recursion ana Comninatorial Problems/school_teams .py | borislavstoychev/Algorithms | 629f9d8df00399af85acf8893db1599e46db6013 | [
"MIT"
] | null | null | null | Recursion ana Comninatorial Problems/school_teams .py | borislavstoychev/Algorithms | 629f9d8df00399af85acf8893db1599e46db6013 | [
"MIT"
] | null | null | null | class Combinations:
def __init__(self, elements, num):
self.elements = elements
self.slots = elements[:num]
self.all = []
def solve(self, index=0, start=0):
if index >= len(self.slots):
self.all.append(self.slots[::])
else:
for i in range(start, ... | 23.828571 | 54 | 0.553957 |
701dffb3c6bae19815ddef6a3b981dc13bad0a3c | 113 | py | Python | to-doApp/todo/tasks/admin.py | patrickikhidero/todo-app | 58df1abbd7195685606c7261f828807cee565091 | [
"MIT"
] | null | null | null | to-doApp/todo/tasks/admin.py | patrickikhidero/todo-app | 58df1abbd7195685606c7261f828807cee565091 | [
"MIT"
] | null | null | null | to-doApp/todo/tasks/admin.py | patrickikhidero/todo-app | 58df1abbd7195685606c7261f828807cee565091 | [
"MIT"
] | null | null | null | from django.contrib import admin
# Register your models here.
from .models import *
admin.site.register(Task) | 16.142857 | 32 | 0.769912 |
7a58c3f40015bab1f5a653a0698e7e6e740fb2ce | 650 | py | Python | assignments/A3/sampleXMLReader.py | jajayongjia/366 | 6389723638cef07adbe28a9c7116bc4f71b0e29c | [
"MIT"
] | null | null | null | assignments/A3/sampleXMLReader.py | jajayongjia/366 | 6389723638cef07adbe28a9c7116bc4f71b0e29c | [
"MIT"
] | null | null | null | assignments/A3/sampleXMLReader.py | jajayongjia/366 | 6389723638cef07adbe28a9c7116bc4f71b0e29c | [
"MIT"
] | null | null | null | import xml.etree.ElementTree as ET
tree = ET.parse('items.xml')
root = tree.getroot()
# one specific item attribute
print('Item #2 attribute:')
print(root[0][1].attrib)
# all item attributes
print('\nAll attributes:')
for elem in root:
for subelem in elem:
print(subelem.attrib)
# one specific i... | 17.105263 | 36 | 0.667692 |
418c4e7f29294a840c55f6cc5b6ee071d770b1c1 | 160 | py | Python | packs/kubernetes/actions/lib/action.py | userlocalhost2000/st2contrib | 1a5f759e76401743ed9023d298a3d767e3885db1 | [
"Apache-2.0"
] | 164 | 2015-01-17T16:08:33.000Z | 2021-08-03T02:34:07.000Z | packs/kubernetes/actions/lib/action.py | userlocalhost2000/st2contrib | 1a5f759e76401743ed9023d298a3d767e3885db1 | [
"Apache-2.0"
] | 442 | 2015-01-01T11:19:01.000Z | 2017-09-06T23:26:17.000Z | packs/kubernetes/actions/lib/action.py | userlocalhost2000/st2contrib | 1a5f759e76401743ed9023d298a3d767e3885db1 | [
"Apache-2.0"
] | 202 | 2015-01-13T00:37:40.000Z | 2020-11-07T11:30:10.000Z | from st2actions.runners.pythonrunner import Action
class BaseAction(Action):
def __init__(self, config):
super(BaseAction, self).__init__(config)
| 22.857143 | 50 | 0.75 |
1155efef9a424b4d8df87af86b1be2e2fe20197b | 2,332 | py | Python | nicos_mlz/sans1/setups/sample_table_2.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | nicos_mlz/sans1/setups/sample_table_2.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 1 | 2021-08-18T10:55:42.000Z | 2021-08-18T10:55:42.000Z | nicos_mlz/sans1/setups/sample_table_2.py | ISISComputingGroup/nicos | 94cb4d172815919481f8c6ee686f21ebb76f2068 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | description = 'top sample table devices'
includes = ['sample_table_1']
group = 'optional'
tango_base = 'tango://sans1hw.sans1.frm2:10000/sans1/table/'
devices = dict(
st2_z = device('nicos.devices.generic.Axis',
description = 'table 2 z axis',
pollinterval = 15,
maxage = 60,
fmts... | 29.15 | 60 | 0.540309 |
3cea607055b39d04c3c65d4bf19911316b73029e | 219 | py | Python | pipenv/__version__.py | gzzo/pipenv | 5ba7d7d168af3be99b14adeaac5b488bbacc7b68 | [
"MIT"
] | null | null | null | pipenv/__version__.py | gzzo/pipenv | 5ba7d7d168af3be99b14adeaac5b488bbacc7b68 | [
"MIT"
] | null | null | null | pipenv/__version__.py | gzzo/pipenv | 5ba7d7d168af3be99b14adeaac5b488bbacc7b68 | [
"MIT"
] | null | null | null |
# ___ ( ) ___ ___ __
# // ) ) / / // ) ) //___) ) // ) ) || / /
# //___/ / / / //___/ / // // / / || / /
# // / / // ((____ // / / ||/ /
__version__ = '11.0.2'
| 27.375 | 51 | 0.178082 |
fead937c561fee138cb13156a3e0c81a2343b9c8 | 10,251 | py | Python | ee/clickhouse/views/test/test_clickhouse_retention.py | lharress/posthog | 73809d54b14ffc1b6ad6f600e0e4f06ab3090cb1 | [
"MIT"
] | null | null | null | ee/clickhouse/views/test/test_clickhouse_retention.py | lharress/posthog | 73809d54b14ffc1b6ad6f600e0e4f06ab3090cb1 | [
"MIT"
] | null | null | null | ee/clickhouse/views/test/test_clickhouse_retention.py | lharress/posthog | 73809d54b14ffc1b6ad6f600e0e4f06ab3090cb1 | [
"MIT"
] | null | null | null | from dataclasses import asdict, dataclass
from typing import List, Literal, Optional, TypedDict, Union
from django.test import TestCase
from django.test.client import Client
from ee.clickhouse.test.test_journeys import _create_all_events, update_or_create_person
from ee.clickhouse.util import ClickhouseTestMixin
from... | 41.004 | 113 | 0.605697 |
f27a7d996908d4ec208b981a0efb74158f38928f | 2,226 | py | Python | autotest/gdrivers/lan.py | rcoup/gdal | 31240deb7b71d990a2abbad1bebedd0918989ca0 | [
"MIT"
] | null | null | null | autotest/gdrivers/lan.py | rcoup/gdal | 31240deb7b71d990a2abbad1bebedd0918989ca0 | [
"MIT"
] | null | null | null | autotest/gdrivers/lan.py | rcoup/gdal | 31240deb7b71d990a2abbad1bebedd0918989ca0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test LAN driver
# Author: Even Rouault, <even dot rouault at mines dash paris dot org>
#
##########################################################################... | 33.223881 | 79 | 0.60018 |
48bfe580870846c9a1c53b048d23c10f1821335b | 251 | py | Python | example/demo/scripts/__init__.py | iwwxiong/flask_restapi | 57fca3bf07d913b31b6b7ef877328b0e07056c39 | [
"MIT"
] | 6 | 2019-04-23T02:18:55.000Z | 2019-12-10T13:16:21.000Z | example/demo/scripts/__init__.py | dracarysX/flask_scaffold | 57fca3bf07d913b31b6b7ef877328b0e07056c39 | [
"MIT"
] | null | null | null | example/demo/scripts/__init__.py | dracarysX/flask_scaffold | 57fca3bf07d913b31b6b7ef877328b0e07056c39 | [
"MIT"
] | 3 | 2019-05-22T06:00:17.000Z | 2020-01-14T17:02:35.000Z | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from demo.author.models import Author
from demo.book.models import Book
def create_tables():
"""
创建数据库table
:return:
"""
Author.create_table()
Book.create_table()
return
| 13.210526 | 37 | 0.625498 |
300205b96b83908b58c5852c6cc22a259bddcd03 | 2,333 | py | Python | tests/configuration.py | KarthikKothareddy/AirFlow | faaf0b8b4467bcf5bff4a5b49086a9e02cb9c112 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2018-03-07T12:25:05.000Z | 2018-03-19T01:00:10.000Z | tests/configuration.py | KarthikKothareddy/AirFlow | faaf0b8b4467bcf5bff4a5b49086a9e02cb9c112 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | tests/configuration.py | KarthikKothareddy/AirFlow | faaf0b8b4467bcf5bff4a5b49086a9e02cb9c112 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 3 | 2020-11-25T15:01:28.000Z | 2021-04-12T04:09:41.000Z | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | 34.820896 | 88 | 0.696528 |
7cbfda823aed130382fc862d7d4dd28f4f00d6bd | 465 | py | Python | ARFshock_label/config.py | MLD3/MLHC2019_Relaxed_Parameter_Sharing | 152fe3e5069eee91b88a144912eb31ac2fd809cd | [
"MIT"
] | 1 | 2021-05-05T02:06:08.000Z | 2021-05-05T02:06:08.000Z | ARFshock_label/config.py | MLD3/MLHC2019_Relaxed_Parameter_Sharing | 152fe3e5069eee91b88a144912eb31ac2fd809cd | [
"MIT"
] | null | null | null | ARFshock_label/config.py | MLD3/MLHC2019_Relaxed_Parameter_Sharing | 152fe3e5069eee91b88a144912eb31ac2fd809cd | [
"MIT"
] | null | null | null | import os, yaml
with open(os.path.join(os.path.dirname(__file__), 'config.yaml')) as f:
config = yaml.full_load(f)
data_path = os.path.join(os.path.dirname(__file__), config['data_path'])
mimic3_path = os.path.join(os.path.dirname(__file__), config['mimic3_path'])
ID_col = config['column_names']['ID']
t_col = con... | 31 | 76 | 0.72043 |
fcaefa092df2280fcdb3f11a5301bc1cf8473809 | 1,496 | py | Python | setup.py | JosueDLA/ShapeDetection | caf79ddc97888f69d829d84d2ee0a6599a7a5f2c | [
"MIT"
] | null | null | null | setup.py | JosueDLA/ShapeDetection | caf79ddc97888f69d829d84d2ee0a6599a7a5f2c | [
"MIT"
] | null | null | null | setup.py | JosueDLA/ShapeDetection | caf79ddc97888f69d829d84d2ee0a6599a7a5f2c | [
"MIT"
] | null | null | null | """
# Color Thief
A module for detecting shapes using OpenCV.
Installation
```bash
pip install shape-detection-jdla
```
# Overview
Square detection rules:
- There must be four corners
- All four lines must be the same length
- All four corners must be 90°
- Lines AB and CD must be horizontal lines
- Lines AC and ... | 20.493151 | 54 | 0.659091 |
62499a8380249a4f60cc4ffa77aafbe26530f172 | 548 | py | Python | newbeginning/opensource/correction/correctedstate.py | arnavkapoor/fsmresults | 96daf7e86ed58fea2d7cbbe9364a866c7a548a3e | [
"Apache-2.0"
] | null | null | null | newbeginning/opensource/correction/correctedstate.py | arnavkapoor/fsmresults | 96daf7e86ed58fea2d7cbbe9364a866c7a548a3e | [
"Apache-2.0"
] | null | null | null | newbeginning/opensource/correction/correctedstate.py | arnavkapoor/fsmresults | 96daf7e86ed58fea2d7cbbe9364a866c7a548a3e | [
"Apache-2.0"
] | null | null | null | import os
path = '/home/arnav/fsmresults/newbeginning/opensource/opensrcexpanded'
for folder, sub_folders, files in os.walk(path):
for special_file in files:
file_path = os.path.join(folder, special_file)
filename=file_path.rsplit('/')[-1]
with open(file_path, 'r+') as read_file:
... | 42.153846 | 71 | 0.583942 |
a3d34ef5ee377ed29607508d27ceceeb63edbe9c | 3,888 | py | Python | utils/utils.py | Jintao-Huang/EfficientNet_PyTorch | 4682c49b60d77f104b021b9c555e804bac8a5bbf | [
"Apache-2.0"
] | 8 | 2020-10-26T03:31:05.000Z | 2021-11-12T07:02:59.000Z | utils/utils.py | Jintao-Huang/efficientnet_pytorch | 4682c49b60d77f104b021b9c555e804bac8a5bbf | [
"Apache-2.0"
] | 2 | 2020-06-01T07:38:10.000Z | 2021-04-11T15:39:16.000Z | utils/utils.py | Jintao-Huang/efficientnet_pytorch | 4682c49b60d77f104b021b9c555e804bac8a5bbf | [
"Apache-2.0"
] | 2 | 2020-11-15T14:38:56.000Z | 2021-05-29T08:29:20.000Z | # Author: Jintao Huang
# Time: 2020-5-24
import pickle
import hashlib
import torch
import numpy as np
from torch.backends import cudnn
import os
def save_to_pickle(data, filepath):
"""$"""
with open(filepath, "wb") as f:
pickle.dump(data, f)
def load_from_pickle(filepath):
"""$"""
with ope... | 30.375 | 118 | 0.627058 |
83468c5f5e0147717f0d0e1cdda84661be58b8f2 | 5,920 | py | Python | minemeld/flask/config.py | zul126/minemeld-core | 2eb9b9bfd7654aee57aabd5fb280d4e89a438daf | [
"Apache-2.0"
] | 147 | 2016-07-22T18:15:49.000Z | 2022-03-26T23:32:44.000Z | minemeld/flask/config.py | zul126/minemeld-core | 2eb9b9bfd7654aee57aabd5fb280d4e89a438daf | [
"Apache-2.0"
] | 167 | 2016-07-27T07:02:25.000Z | 2021-12-16T16:26:52.000Z | minemeld/flask/config.py | zul126/minemeld-core | 2eb9b9bfd7654aee57aabd5fb280d4e89a438daf | [
"Apache-2.0"
] | 112 | 2016-07-22T07:14:29.000Z | 2022-03-24T18:43:12.000Z | # Copyright 2015-2016 Palo Alto Networks, 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... | 27.663551 | 82 | 0.595439 |
3ca11c5b9dea1d2a3b7f3f26776e22f1642f2849 | 1,191 | py | Python | examples/sitemapindex_and_generator.py | isabella232/resync | 6e9ddfa83087a0c122f72a6cc375c490f758b016 | [
"Apache-2.0"
] | 1 | 2016-11-30T18:08:02.000Z | 2016-11-30T18:08:02.000Z | examples/sitemapindex_and_generator.py | EHRI/resync | 6e9ddfa83087a0c122f72a6cc375c490f758b016 | [
"Apache-2.0"
] | 1 | 2021-06-22T08:24:40.000Z | 2021-06-22T08:24:40.000Z | examples/sitemapindex_and_generator.py | isabella232/resync | 6e9ddfa83087a0c122f72a6cc375c490f758b016 | [
"Apache-2.0"
] | 1 | 2021-06-22T08:22:25.000Z | 2021-06-22T08:22:25.000Z | #!/usr/bin/env python
from resync.resource import Resource
from resync.resource_list import ResourceList
from resync.list_base_with_index import ListBaseIndexError
import sys
try:
max_sitemap_entries = int(sys.argv[1])
except:
max_sitemap_entries = 2
print("### max_sitemap_entries=%d" % max_sitemap_entries)
b... | 28.357143 | 78 | 0.72628 |
d64a8bebf5d8656a86b858cc847e82484a662966 | 914 | py | Python | sd_range_slider/__init__.py | mjclawar/sd-range-slider | 9c6f28d58c0d136826b8c91644b3759948a67af0 | [
"MIT"
] | 2 | 2018-11-22T08:14:17.000Z | 2020-10-21T22:34:19.000Z | sd_range_slider/__init__.py | mjclawar/sd-range-slider | 9c6f28d58c0d136826b8c91644b3759948a67af0 | [
"MIT"
] | 6 | 2017-12-04T14:47:19.000Z | 2019-07-12T14:56:49.000Z | sd_range_slider/__init__.py | mjclawar/sd-range-slider | 9c6f28d58c0d136826b8c91644b3759948a67af0 | [
"MIT"
] | 1 | 2020-10-21T22:34:30.000Z | 2020-10-21T22:34:30.000Z | import os as _os
import dash as _dash
import sys as _sys
from .version import __version__
_current_path = _os.path.dirname(_os.path.abspath(__file__))
_components = _dash.development.component_loader.load_components(
_os.path.join(_current_path, 'metadata.json'),
'sd_range_slider'
)
_this_module = _sys.modul... | 22.85 | 65 | 0.657549 |
22cc1857f2aa0aad436de60e6a9dcea9365abce9 | 3,268 | py | Python | x_tef/flux_qe_salt_budget.py | parkermac/LiveOcean | bef3e1e729ada1069853dd4f57f79f452b54f4fa | [
"MIT"
] | 4 | 2015-06-09T18:53:11.000Z | 2021-08-19T01:39:38.000Z | x_tef/flux_qe_salt_budget.py | parkermac/LiveOcean | bef3e1e729ada1069853dd4f57f79f452b54f4fa | [
"MIT"
] | null | null | null | x_tef/flux_qe_salt_budget.py | parkermac/LiveOcean | bef3e1e729ada1069853dd4f57f79f452b54f4fa | [
"MIT"
] | 1 | 2017-03-07T01:28:49.000Z | 2017-03-07T01:28:49.000Z | """
Calculates an exchange-flow oriented salt budget from TEF terms, and
explores dynamical scaling:
does Qe behave as expected relative to dSbar_dx and K?
"""
# imports
import matplotlib.pyplot as plt
import numpy as np
import pickle
import pandas as pd
from datetime import datetime, timedelta
import os; import sy... | 30.830189 | 112 | 0.69492 |
8adff3eaf2e607b45a4a743bdd891f7efa583ac3 | 1,430 | py | Python | gviewer/controller.py | chhsiao90/gviewer | ae34b13236635356b7a7c68448a3c2529e700c8c | [
"MIT"
] | 11 | 2018-12-20T12:00:25.000Z | 2021-09-22T16:14:45.000Z | gviewer/controller.py | chhsiao90/gviewer | ae34b13236635356b7a7c68448a3c2529e700c8c | [
"MIT"
] | 39 | 2016-06-28T14:40:09.000Z | 2016-09-13T09:20:25.000Z | gviewer/controller.py | chhsiao90/gviewer | ae34b13236635356b7a7c68448a3c2529e700c8c | [
"MIT"
] | 1 | 2018-09-07T11:37:20.000Z | 2018-09-07T11:37:20.000Z | class Controller(object):
"""Controller provide UI interaction API
Attributes:
parent: ParentFrame instance
"""
def __init__(self, parent):
self.parent = parent
def open_view(self, widget, push_prev=True):
"""Open view
Args:
widget: a urwid Widget imple... | 25.535714 | 68 | 0.605594 |
32ea684c8ee8af2713776693d7f8a51b2a94127f | 3,831 | py | Python | experiments/compare_epsilon.py | sio13/turtleNet | 02195eb33a28d238a769a3f34d6f1b24255ab40f | [
"MIT"
] | 1 | 2021-06-10T08:31:35.000Z | 2021-06-10T08:31:35.000Z | experiments/compare_epsilon.py | sio13/turtleNet | 02195eb33a28d238a769a3f34d6f1b24255ab40f | [
"MIT"
] | 2 | 2020-05-15T11:14:14.000Z | 2020-05-15T11:14:46.000Z | experiments/compare_epsilon.py | sio13/turtleNet | 02195eb33a28d238a769a3f34d6f1b24255ab40f | [
"MIT"
] | null | null | null | import config
from attacks import attack
from defences.train import TurtleNet
from keras.datasets import mnist, cifar10
from keras.models import load_model
from keras.utils import to_categorical
from cleverhans.attacks import *
import cleverhans
import numpy as np
import time
from utils import get_keras_dataset, sa... | 38.31 | 111 | 0.564866 |
d858e38473bda9d2b6d7064fcc3f09826040db4f | 238 | py | Python | tests/eth2/hash-utils/test_hash.py | Gauddel/trinity | 0b12943ac36f4090abc22fc965e9e9a4f42c6f35 | [
"MIT"
] | null | null | null | tests/eth2/hash-utils/test_hash.py | Gauddel/trinity | 0b12943ac36f4090abc22fc965e9e9a4f42c6f35 | [
"MIT"
] | null | null | null | tests/eth2/hash-utils/test_hash.py | Gauddel/trinity | 0b12943ac36f4090abc22fc965e9e9a4f42c6f35 | [
"MIT"
] | null | null | null | from eth_hash.auto import keccak
from eth2._utils.hash import hash_eth2
def test_hash():
output = hash_eth2(b'helloworld')
assert len(output) == 32
def test_hash_is_keccak256():
assert hash_eth2(b'foo') == keccak(b'foo')
| 18.307692 | 46 | 0.714286 |
9d954b83e27eb24661194ecdcf153cdebfb45a3f | 2,419 | py | Python | deepchem/models/tests/test_lcnn.py | deloragaskins/deepchem | 234ab699cdb997e5963966a8b6926cb2cda7c064 | [
"MIT"
] | 3,782 | 2016-02-21T03:53:11.000Z | 2022-03-31T16:10:26.000Z | deepchem/models/tests/test_lcnn.py | deloragaskins/deepchem | 234ab699cdb997e5963966a8b6926cb2cda7c064 | [
"MIT"
] | 2,666 | 2016-02-11T01:54:54.000Z | 2022-03-31T11:14:33.000Z | deepchem/models/tests/test_lcnn.py | deloragaskins/deepchem | 234ab699cdb997e5963966a8b6926cb2cda7c064 | [
"MIT"
] | 1,597 | 2016-02-21T03:10:08.000Z | 2022-03-30T13:21:28.000Z | import pytest
import tempfile
from os import path
import numpy as np
from deepchem.utils import load_dataset_from_disk, download_url, untargz_file
from deepchem.metrics import Metric, mae_score
try:
import dgl
import torch
from deepchem.models import LCNNModel
has_pytorch_and_dgl = True
except:
has_pytorch_a... | 31.828947 | 100 | 0.757751 |
eda51225a5ea5ebba8e46eb42733c9c403774810 | 1,939 | py | Python | scripts/csv_to_parquet.py | ostrokach/uniparc_xml_parser | eb5b4863aaae2a754f67cf60b19dbb5d4f2fedac | [
"Apache-2.0"
] | null | null | null | scripts/csv_to_parquet.py | ostrokach/uniparc_xml_parser | eb5b4863aaae2a754f67cf60b19dbb5d4f2fedac | [
"Apache-2.0"
] | null | null | null | scripts/csv_to_parquet.py | ostrokach/uniparc_xml_parser | eb5b4863aaae2a754f67cf60b19dbb5d4f2fedac | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
from typing import List
import pyarrow as pa
import pyarrow.parquet as pq
from pyarrow import csv
from tqdm import tqdm
def csv_to_parquet(
csv_file: Path,
parquet_file: Path,
*,
delimiter: str,
column_names: List[str],
quiet: bool = False,
) -> None:
block_size =... | 31.786885 | 97 | 0.665807 |
ecdf80045cc08682bbb0364d2220f519410b498c | 1,332 | py | Python | tests/unit/omnibot/services/slack/bot_test.py | isabella232/omnibot | b62ccec1bf77b16a498ce5cd5f16c1812102f75b | [
"Apache-2.0"
] | null | null | null | tests/unit/omnibot/services/slack/bot_test.py | isabella232/omnibot | b62ccec1bf77b16a498ce5cd5f16c1812102f75b | [
"Apache-2.0"
] | 1 | 2021-02-23T23:16:34.000Z | 2021-02-23T23:16:34.000Z | tests/unit/omnibot/services/slack/bot_test.py | mogofinancial/omnibot | b62ccec1bf77b16a498ce5cd5f16c1812102f75b | [
"Apache-2.0"
] | null | null | null | import pytest
from omnibot.services.slack.team import Team
from omnibot.services.slack.bot import Bot, BotInitializationError
def test_team():
_team = Team.get_team_by_name('testteam')
_bot = Bot.get_bot_by_name(_team, 'echobot')
assert _bot.name == 'echobot'
assert _bot.bot_id == 'A12345678'
ass... | 33.3 | 66 | 0.70045 |
ce2be5c67dfeb07cf091f48ae969cb768a225031 | 218 | py | Python | src/alvarium/hash/mock.py | welo10/alvarium-sdk-python | a62aeafc62bd6bc4e11538c357e422e7a51cf825 | [
"Apache-2.0"
] | null | null | null | src/alvarium/hash/mock.py | welo10/alvarium-sdk-python | a62aeafc62bd6bc4e11538c357e422e7a51cf825 | [
"Apache-2.0"
] | null | null | null | src/alvarium/hash/mock.py | welo10/alvarium-sdk-python | a62aeafc62bd6bc4e11538c357e422e7a51cf825 | [
"Apache-2.0"
] | null | null | null | from .interfaces import HashProvider
class NoneHashProvider(HashProvider):
"""A mock implementation for the HashProvider interface"""
def derive(self, data: bytes) -> str:
return data.decode("utf-8") | 31.142857 | 62 | 0.715596 |
341782573a5734103bacee0d54cc3b62e9baad9c | 6,195 | py | Python | mmdet/core/bbox/transforms.py | YLyeliang/mmdetection_notes | e5702b3c15290b825f8d9b92bfa79fcf7a4a6888 | [
"Apache-2.0"
] | null | null | null | mmdet/core/bbox/transforms.py | YLyeliang/mmdetection_notes | e5702b3c15290b825f8d9b92bfa79fcf7a4a6888 | [
"Apache-2.0"
] | null | null | null | mmdet/core/bbox/transforms.py | YLyeliang/mmdetection_notes | e5702b3c15290b825f8d9b92bfa79fcf7a4a6888 | [
"Apache-2.0"
] | null | null | null | import mmcv
import numpy as np
import torch
def bbox2delta(proposals, gt, means=[0, 0, 0, 0], stds=[1, 1, 1, 1]):
assert proposals.size() == gt.size()
proposals = proposals.float()
gt = gt.float()
px = (proposals[..., 0] + proposals[..., 2]) * 0.5
py = (proposals[..., 1] + proposals[..., 3]) * 0.... | 32.605263 | 109 | 0.560452 |
9cd7da42c85197a9810d82d72cba886ca392840a | 8,913 | py | Python | sdk/python/pulumi_azure_nextgen/network/v20170601/get_inbound_nat_rule.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/network/v20170601/get_inbound_nat_rule.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/network/v20170601/get_inbound_nat_rule.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 43.906404 | 284 | 0.686525 |
ffcb2e77cc6122fc7d011df491ee8d7acd1950fb | 2,863 | py | Python | lib-src/lv2/suil/waflib/extras/lv2.py | joshrose/audacity | e2b1a2be6b92661628bbb054f915bc50b211c020 | [
"CC-BY-3.0"
] | 7,892 | 2015-03-31T09:24:05.000Z | 2022-03-31T12:30:32.000Z | lib-src/lv2/suil/waflib/extras/lv2.py | joshrose/audacity | e2b1a2be6b92661628bbb054f915bc50b211c020 | [
"CC-BY-3.0"
] | 2,050 | 2015-04-03T13:27:52.000Z | 2022-03-31T19:14:10.000Z | lib-src/lv2/suil/waflib/extras/lv2.py | joshrose/audacity | e2b1a2be6b92661628bbb054f915bc50b211c020 | [
"CC-BY-3.0"
] | 2,613 | 2015-03-26T11:28:10.000Z | 2022-03-30T13:17:03.000Z | import os
import sys
from waflib import Logs
from waflib import Options
def options(opt):
conf_opts = opt.get_option_group('Configuration options')
conf_opts.add_option('--lv2-user', action='store_true', default=False, dest='lv2_user',
help='install LV2 bundles to user location')
... | 37.671053 | 91 | 0.582606 |
f8ed21fdc7506d832a420a6a38b5411f7b12a288 | 8,824 | py | Python | segmentation_models/models/unet.py | cersar/segmentation_models | 3a4b8e415388965a183fa6e28ee98a82ab497cd9 | [
"MIT"
] | null | null | null | segmentation_models/models/unet.py | cersar/segmentation_models | 3a4b8e415388965a183fa6e28ee98a82ab497cd9 | [
"MIT"
] | null | null | null | segmentation_models/models/unet.py | cersar/segmentation_models | 3a4b8e415388965a183fa6e28ee98a82ab497cd9 | [
"MIT"
] | null | null | null | from keras_applications import get_submodules_from_kwargs
from ._common_blocks import Conv2dBn
from ._utils import freeze_model, filter_keras_submodules
from ..backbones.backbones_factory import Backbones
backend = None
layers = None
models = None
keras_utils = None
# -----------------------------------------------... | 33.551331 | 121 | 0.603921 |
8411bbd9f23296a127cef1d0809d10a413ce3554 | 1,929 | py | Python | src/ssp/spark/udf/spacy_ner_udf.py | gyan42/spark-streaming-playground | 147ef9cbc31b7aed242663dee36143ebf0e8043f | [
"Apache-2.0"
] | 10 | 2020-03-12T11:51:46.000Z | 2022-03-24T04:56:05.000Z | src/ssp/spark/udf/spacy_ner_udf.py | gyan42/spark-streaming-playground | 147ef9cbc31b7aed242663dee36143ebf0e8043f | [
"Apache-2.0"
] | 12 | 2020-04-23T07:28:14.000Z | 2022-03-12T00:20:24.000Z | src/ssp/spark/udf/spacy_ner_udf.py | gyan42/spark-streaming-playground | 147ef9cbc31b7aed242663dee36143ebf0e8043f | [
"Apache-2.0"
] | 1 | 2020-04-20T14:48:38.000Z | 2020-04-20T14:48:38.000Z | from pyspark.sql.functions import udf
import requests
import ast
from pyspark.sql.types import *
# Interesting use case : What if the end point gone for toss and
# Streaming has to recomputed for failed cases ?
from ssp.logger.pretty_print import print_info
from ssp.logger.pretty_print import print_error
def get_ne... | 32.15 | 111 | 0.648523 |
9b20660a9a8d73ad3ffecc9cc9b69a20b25caf2b | 397 | py | Python | Web_django/Web_django/wsgi.py | LikeFrost/homework | b59ef80cccd70579609cc9656a5b0dcf5a742fa1 | [
"Unlicense"
] | null | null | null | Web_django/Web_django/wsgi.py | LikeFrost/homework | b59ef80cccd70579609cc9656a5b0dcf5a742fa1 | [
"Unlicense"
] | null | null | null | Web_django/Web_django/wsgi.py | LikeFrost/homework | b59ef80cccd70579609cc9656a5b0dcf5a742fa1 | [
"Unlicense"
] | null | null | null | """
WSGI config for Web_django project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SE... | 23.352941 | 78 | 0.788413 |
8ea11ded97fd1ec6171f4f04cb262a725fab7c9d | 41,586 | py | Python | src/python/turicreate/toolkits/image_classifier/image_classifier.py | sirahd/turicreate | 386efa4eb5033573ee9120704a8c88a9a6151133 | [
"BSD-3-Clause"
] | null | null | null | src/python/turicreate/toolkits/image_classifier/image_classifier.py | sirahd/turicreate | 386efa4eb5033573ee9120704a8c88a9a6151133 | [
"BSD-3-Clause"
] | 3 | 2022-02-15T04:42:24.000Z | 2022-03-12T01:05:15.000Z | src/python/turicreate/toolkits/image_classifier/image_classifier.py | sirahd/turicreate | 386efa4eb5033573ee9120704a8c88a9a6151133 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright © 2017 Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can
# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
"""
Class definition and utilities for the image classification toolkit.
"""
from __... | 43.913411 | 188 | 0.636777 |
758394b9040e1103b63da7d75b8bf7e738ab7f28 | 8,410 | py | Python | tools/train.py | zhangtingyu11/mmdetection3d | 6e8285b73e42884aff20af123e3499c44e31cfe1 | [
"Apache-2.0"
] | null | null | null | tools/train.py | zhangtingyu11/mmdetection3d | 6e8285b73e42884aff20af123e3499c44e31cfe1 | [
"Apache-2.0"
] | null | null | null | tools/train.py | zhangtingyu11/mmdetection3d | 6e8285b73e42884aff20af123e3499c44e31cfe1 | [
"Apache-2.0"
] | null | null | null | from __future__ import division
import argparse
import copy
import mmcv
import os
import time
import torch
import warnings
from mmcv import Config, DictAction
from mmcv.runner import get_dist_info, init_dist
from os import path as osp
from mmdet import __version__ as mmdet_version
from mmdet3d import __version__ as m... | 37.713004 | 125 | 0.654102 |
9775ba52cdb1a57f2b98beb88d450e980d0a9d8b | 529 | py | Python | python3/sherlock-and-anagrams.py | ahavrylyuk/hackerrank | a8be83c8166a05f6f91bdd86cca3d4c544428b4b | [
"MIT"
] | null | null | null | python3/sherlock-and-anagrams.py | ahavrylyuk/hackerrank | a8be83c8166a05f6f91bdd86cca3d4c544428b4b | [
"MIT"
] | null | null | null | python3/sherlock-and-anagrams.py | ahavrylyuk/hackerrank | a8be83c8166a05f6f91bdd86cca3d4c544428b4b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from collections import defaultdict
from collections import Counter
def count_anagrams(s):
len_s = len(s)
substrs = defaultdict(list)
count = 0
for length in range(1, len_s):
same_len = substrs[length]
for i in range(len_s - length + 1):
substr = Cou... | 23 | 60 | 0.618147 |
827433061e3c24a318f1d8921a3727683f8834ed | 1,918 | py | Python | fake_sudir/app/website/app.py | IlyaVkBot/moscow_deg2021_local_exec | ba6272a5141d83d6a2d2a1e6639b8670c154fea6 | [
"BSD-3-Clause"
] | null | null | null | fake_sudir/app/website/app.py | IlyaVkBot/moscow_deg2021_local_exec | ba6272a5141d83d6a2d2a1e6639b8670c154fea6 | [
"BSD-3-Clause"
] | null | null | null | fake_sudir/app/website/app.py | IlyaVkBot/moscow_deg2021_local_exec | ba6272a5141d83d6a2d2a1e6639b8670c154fea6 | [
"BSD-3-Clause"
] | 1 | 2022-01-24T00:29:19.000Z | 2022-01-24T00:29:19.000Z | import os
import time
from flask import Flask
from .models import db, User, OAuth2Client
from .oauth2 import config_oauth
from .routes import bp
def create_db_elements():
if User.query.count() > 0:
return
admin_user = User(
username='admin',
first_name='admin_first',
... | 26.638889 | 64 | 0.639208 |
9e3b89155d9f1ae640e99f3fd8e71890d2b8f8b6 | 3,253 | py | Python | pinkfish/fetch.py | jimmyhzuk/pinkfish | d9bba22ba19a548b5ac65da63bfee40623c77cda | [
"MIT"
] | 1 | 2020-03-31T04:02:19.000Z | 2020-03-31T04:02:19.000Z | pinkfish/fetch.py | jimmyhzuk/pinkfish | d9bba22ba19a548b5ac65da63bfee40623c77cda | [
"MIT"
] | null | null | null | pinkfish/fetch.py | jimmyhzuk/pinkfish | d9bba22ba19a548b5ac65da63bfee40623c77cda | [
"MIT"
] | null | null | null | """
fetch
---------
Retrive time series data
"""
# Use future imports for python 3.0 forward compatibility
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
# Other imports
import sys
import pandas as pd
import pandas_d... | 29.044643 | 86 | 0.646173 |
08da1eefb34a6f5a6324fc0e8f1156f1f0312d37 | 10,227 | py | Python | pystream/sequential_stream.py | RikiTikkiTavi/PyStream-API | 8a7101fcf5aa0db5e00a0fac3285548497c81145 | [
"MIT"
] | null | null | null | pystream/sequential_stream.py | RikiTikkiTavi/PyStream-API | 8a7101fcf5aa0db5e00a0fac3285548497c81145 | [
"MIT"
] | null | null | null | pystream/sequential_stream.py | RikiTikkiTavi/PyStream-API | 8a7101fcf5aa0db5e00a0fac3285548497c81145 | [
"MIT"
] | null | null | null | from functools import reduce
from itertools import chain, islice, count
from typing import Generic, TypeVar, Callable, Iterable, Any, Tuple, Iterator, List, Union, Generator
from multiprocessing import cpu_count
import pystream.infrastructure.nullable as nullable
import pystream.parallel_stream as parallel_stream
impo... | 40.74502 | 137 | 0.667351 |
66e7e24fe838d1b5eb59dd9162d5d099d3a2865d | 213 | py | Python | adaptive_alerting_detector_build/exceptions.py | brett-miller/adaptive-alerting-detector-build | eec9f514feb4f65586c408fae36176ebcd8989ae | [
"Apache-2.0"
] | null | null | null | adaptive_alerting_detector_build/exceptions.py | brett-miller/adaptive-alerting-detector-build | eec9f514feb4f65586c408fae36176ebcd8989ae | [
"Apache-2.0"
] | null | null | null | adaptive_alerting_detector_build/exceptions.py | brett-miller/adaptive-alerting-detector-build | eec9f514feb4f65586c408fae36176ebcd8989ae | [
"Apache-2.0"
] | null | null | null | # All exceptions in this class should subclass from AdaptiveAlertingDetectorBuildError.
class AdaptiveAlertingDetectorBuildError(Exception):
"""Base class for all Adaptive Alerting Detector Build errors."""
| 35.5 | 87 | 0.816901 |
fa51d913018c86b2dfe9216916ae1886f71dfd5e | 36,711 | py | Python | subcmds/sync.py | sky8336/git-repo | e910f33d64d0608de2d940c512e9ca3f140fb24f | [
"Apache-2.0"
] | null | null | null | subcmds/sync.py | sky8336/git-repo | e910f33d64d0608de2d940c512e9ca3f140fb24f | [
"Apache-2.0"
] | null | null | null | subcmds/sync.py | sky8336/git-repo | e910f33d64d0608de2d940c512e9ca3f140fb24f | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 34.665722 | 93 | 0.627223 |
053e93c3e2442360155d059f3d2e1f2e3adf96f9 | 1,200 | py | Python | molecule/default/tests/test_minio_default.py | Cloud-Temple/ansible-minio | 401e45be33428e6502b9dcf28cbc717ea410f5a5 | [
"MIT"
] | 4 | 2019-06-11T22:10:43.000Z | 2022-01-26T04:55:01.000Z | molecule/default/tests/test_minio_default.py | Cloud-Temple/ansible-minio | 401e45be33428e6502b9dcf28cbc717ea410f5a5 | [
"MIT"
] | 5 | 2020-10-29T22:01:21.000Z | 2021-03-30T15:59:27.000Z | molecule/default/tests/test_minio_default.py | Cloud-Temple/ansible-minio | 401e45be33428e6502b9dcf28cbc717ea410f5a5 | [
"MIT"
] | 5 | 2019-09-10T12:46:17.000Z | 2022-01-14T15:47:11.000Z | import os
import yaml
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.fixture()
def AnsibleDefaults():
dir_path = os.path.dirname(os.path.abspath(__file__))
with open(os.pa... | 26.666667 | 85 | 0.701667 |
1507cd3ffe3d3a55f10b208149cfa96c4b69a10e | 176 | py | Python | Sakura_Infinity/__init__.py | ranyong1997/Sakura_Infinity | 700c3e8497077b266958f1d26525469d1f0cd87f | [
"MIT"
] | 1 | 2022-03-24T05:33:30.000Z | 2022-03-24T05:33:30.000Z | Sakura_Infinity/__init__.py | ranyong1997/Sakura_Infinity | 700c3e8497077b266958f1d26525469d1f0cd87f | [
"MIT"
] | null | null | null | Sakura_Infinity/__init__.py | ranyong1997/Sakura_Infinity | 700c3e8497077b266958f1d26525469d1f0cd87f | [
"MIT"
] | null | null | null | import pymysql
# from .celery import app as celery_app
# 连接mysql 排除版本错误
pymysql.version_info = (1, 4, 14, "final", 0)
pymysql.install_as_MySQLdb()
# __all__ = ('celery_app',) | 22 | 45 | 0.727273 |
306c32aa9d2bcafd22318534c7f68c2eef7eb5c9 | 168,639 | py | Python | eu.modelwriter.smtlib.texteditor/lib/z3-4.8.4/win/python/z3/z3core.py | ModelWriter/smtlib-tool | b075a8b6bf6188134a50f3884aad480d468fe558 | [
"MIT"
] | null | null | null | eu.modelwriter.smtlib.texteditor/lib/z3-4.8.4/win/python/z3/z3core.py | ModelWriter/smtlib-tool | b075a8b6bf6188134a50f3884aad480d468fe558 | [
"MIT"
] | null | null | null | eu.modelwriter.smtlib.texteditor/lib/z3-4.8.4/win/python/z3/z3core.py | ModelWriter/smtlib-tool | b075a8b6bf6188134a50f3884aad480d468fe558 | [
"MIT"
] | null | null | null |
# Automatically generated file
import sys, os
import ctypes
import pkg_resources
from .z3types import *
from .z3consts import *
_ext = 'dll' if sys.platform in ('win32', 'cygwin') else 'dylib' if sys.platform == 'darwin' else 'so'
_lib = None
_default_dirs = ['.',
os.path.dirname(os.path.a... | 36.812705 | 237 | 0.749376 |
fdda024af040e1cb659eefd8fa0170cdadba2a5e | 820 | py | Python | test/unit/applications/lang/python.py | Dean-Coakley/unit | 98c0ce6cc413b174d5a36f92095246a9967b1371 | [
"Apache-2.0"
] | null | null | null | test/unit/applications/lang/python.py | Dean-Coakley/unit | 98c0ce6cc413b174d5a36f92095246a9967b1371 | [
"Apache-2.0"
] | null | null | null | test/unit/applications/lang/python.py | Dean-Coakley/unit | 98c0ce6cc413b174d5a36f92095246a9967b1371 | [
"Apache-2.0"
] | null | null | null | from unit.applications.proto import TestApplicationProto
class TestApplicationPython(TestApplicationProto):
application_type = "python"
def load(self, script, name=None, **kwargs):
if name is None:
name = script
script_path = self.current_dir + '/python/' + script
self._... | 29.285714 | 74 | 0.452439 |
0505560bd639f191f289a70cb2e58e270d74f942 | 294 | py | Python | skills/reddit_ner_skill/test.py | oserikov/dream | 109ba2df799025dcdada1fddbb7380e1c03100eb | [
"Apache-2.0"
] | 34 | 2021-08-18T14:51:44.000Z | 2022-03-10T14:14:48.000Z | skills/reddit_ner_skill/test.py | oserikov/dream | 109ba2df799025dcdada1fddbb7380e1c03100eb | [
"Apache-2.0"
] | 27 | 2021-08-30T14:42:09.000Z | 2022-03-17T22:11:45.000Z | skills/reddit_ner_skill/test.py | oserikov/dream | 109ba2df799025dcdada1fddbb7380e1c03100eb | [
"Apache-2.0"
] | 40 | 2021-08-22T07:13:32.000Z | 2022-03-29T11:45:32.000Z | #!/usr/bin/env python
import requests
import json
def main_test():
url = "http://0.0.0.0:8035/respond"
tests = json.load(open("tests.json"))
for test in tests:
assert requests.post(url=url, json=test).ok
print("Success!")
if __name__ == "__main__":
main_test()
| 17.294118 | 51 | 0.632653 |
c8522b8ac77fbb8adbe9ab9ae0ff9bc7599c86f3 | 9,293 | py | Python | handler.py | jaredbrook/aws-lambda-http-check | c9e85031f0c4ce033f4ff625c50d39f6d65fa1ad | [
"MIT"
] | null | null | null | handler.py | jaredbrook/aws-lambda-http-check | c9e85031f0c4ce033f4ff625c50d39f6d65fa1ad | [
"MIT"
] | null | null | null | handler.py | jaredbrook/aws-lambda-http-check | c9e85031f0c4ce033f4ff625c50d39f6d65fa1ad | [
"MIT"
] | null | null | null | import json
import os
import http.client
import boto3
from time import perf_counter as pc
from urllib.parse import urlparse
import ssl
from io import StringIO
import gzip
import re
import hashlib
class Config:
"""Lambda function runtime configuration"""
ENDPOINT = 'ENDPOINT'
METHOD = 'METHOD'
PAYLOAD ... | 34.040293 | 128 | 0.556763 |
3a0593a233d54c1b0a1eca85534f3f8841f2af7a | 7,298 | py | Python | tests/test_parsing.py | gargii/python-skytools | 8b75647e03809f3ceb98cd614e868393f3262e6a | [
"ISC"
] | 7 | 2019-11-17T01:59:41.000Z | 2021-04-23T15:01:03.000Z | tests/test_parsing.py | gargii/python-skytools | 8b75647e03809f3ceb98cd614e868393f3262e6a | [
"ISC"
] | 2 | 2019-09-15T16:38:02.000Z | 2022-02-07T07:35:28.000Z | tests/test_parsing.py | gargii/python-skytools | 8b75647e03809f3ceb98cd614e868393f3262e6a | [
"ISC"
] | 4 | 2017-11-18T16:49:26.000Z | 2021-11-15T15:19:33.000Z |
import pytest
from skytools.parsing import (
dedent, hsize_to_bytes, merge_connect_string, parse_acl,
parse_connect_string, parse_logtriga_sql, parse_pgarray,
parse_sqltriga_sql, parse_statements, parse_tabbed_table, sql_tokenizer,
)
def test_parse_pgarray():
assert parse_pgarray('{}') == []
ass... | 35.6 | 106 | 0.576596 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.