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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
880d483bcf560536d72ba8e37dad04edeb068baf | 788 | py | Python | project/__init__.py | manoj75/GitHubToAzure | a90bf44aaaea65fc0d8b75bcaaffae9a654e1891 | [
"MIT"
] | null | null | null | project/__init__.py | manoj75/GitHubToAzure | a90bf44aaaea65fc0d8b75bcaaffae9a654e1891 | [
"MIT"
] | null | null | null | project/__init__.py | manoj75/GitHubToAzure | a90bf44aaaea65fc0d8b75bcaaffae9a654e1891 | [
"MIT"
] | null | null | null | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_modus import Modus
from flask_migrate import Migrate
app = Flask(__name__)
modus = Modus(app)
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgres://localhost/flask-blueprints'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['SECR... | 30.307692 | 79 | 0.798223 |
c4a172389cd0e3d7e118c3f533255e7db0b18ee8 | 1,439 | py | Python | docs/getting_started/flask_example.py | TimPansino/opentelemetry-python | 51ed4576c611316bd3f74d213501f5ffa3e2a5ca | [
"Apache-2.0"
] | 1 | 2020-03-17T05:37:21.000Z | 2020-03-17T05:37:21.000Z | docs/getting_started/flask_example.py | TimPansino/opentelemetry-python | 51ed4576c611316bd3f74d213501f5ffa3e2a5ca | [
"Apache-2.0"
] | 3 | 2019-08-26T13:06:36.000Z | 2020-02-21T21:44:02.000Z | docs/getting_started/flask_example.py | TimPansino/opentelemetry-python | 51ed4576c611316bd3f74d213501f5ffa3e2a5ca | [
"Apache-2.0"
] | 1 | 2020-10-22T20:13:37.000Z | 2020-10-22T20:13:37.000Z | # Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 30.617021 | 74 | 0.784573 |
e3b7d04d13f915eecf44739f86a737e9eec60a65 | 1,616 | py | Python | ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HBASE/package/scripts/status_params.py | Syndra/Ambari-source | 717526b2bf3636622212b14de0d3d298a20c7370 | [
"Apache-2.0"
] | 5 | 2017-07-20T11:15:10.000Z | 2020-04-16T15:42:55.000Z | ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HBASE/package/scripts/status_params.py | Syndra/Ambari-source | 717526b2bf3636622212b14de0d3d298a20c7370 | [
"Apache-2.0"
] | 8 | 2020-06-18T17:31:19.000Z | 2022-03-02T08:32:03.000Z | ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HBASE/package/scripts/status_params.py | Syndra/Ambari-source | 717526b2bf3636622212b14de0d3d298a20c7370 | [
"Apache-2.0"
] | 12 | 2017-05-17T09:48:01.000Z | 2021-08-05T19:01:25.000Z | #!/usr/bin/env python
"""
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");... | 35.911111 | 95 | 0.780322 |
5bf1c3bc0438b78fb7e4414fe61844eb38a22f87 | 5,172 | py | Python | tests/test_services/test_set_113.py | ucloud/ucloud-sdk-python2 | 90fb43198df73a78d64bbd98675dc7b302856057 | [
"Apache-2.0"
] | 19 | 2019-05-15T13:41:58.000Z | 2019-11-13T09:09:37.000Z | tests/test_services/test_set_113.py | ucloud/ucloud-sdk-python2 | 90fb43198df73a78d64bbd98675dc7b302856057 | [
"Apache-2.0"
] | 9 | 2019-07-24T08:31:33.000Z | 2020-09-22T04:01:46.000Z | tests/test_services/test_set_113.py | ucloud/ucloud-sdk-python2 | 90fb43198df73a78d64bbd98675dc7b302856057 | [
"Apache-2.0"
] | 3 | 2019-06-18T00:22:07.000Z | 2020-04-24T02:28:06.000Z | # -*- coding: utf-8 -*-
""" Code is generated by ucloud-model, DO NOT EDIT IT. """
import pytest
import logging
from ucloud.core import exc
from ucloud.testing import env, funcs, op, utest
logger = logging.getLogger(__name__)
scenario = utest.Scenario(113)
@pytest.mark.skipif(env.is_ut(), reason=env.get_skip_reason... | 25.352941 | 74 | 0.632637 |
a49bc73d27a775fe05922d06239c919fdb7af787 | 13,471 | py | Python | model/Resource_Rational_Subgoal_Planning_Agent.py | cogtoolslab/tools_block_construction | e573b28b2a53d27268414dab17b9be4dda257230 | [
"MIT"
] | null | null | null | model/Resource_Rational_Subgoal_Planning_Agent.py | cogtoolslab/tools_block_construction | e573b28b2a53d27268414dab17b9be4dda257230 | [
"MIT"
] | 1 | 2022-02-19T00:04:14.000Z | 2022-02-19T00:04:14.000Z | model/Resource_Rational_Subgoal_Planning_Agent.py | cogtoolslab/tools_block_construction | e573b28b2a53d27268414dab17b9be4dda257230 | [
"MIT"
] | null | null | null | import os
import sys
proj_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
sys.path.insert(0,proj_dir)
from random import choice
import utils.blockworld as blockworld
from model.BFS_Lookahead_Agent import *
import model.utils.decomposition_functions
import copy
import numpy as np
BAD_SCORE = -10**... | 56.364017 | 332 | 0.640264 |
e315dda9b801032de69cd57152bebcc968ebd118 | 4,838 | py | Python | scoreboard/tests/validators_test.py | outdex/ctfscoreboard | ab662e26544a49ba2a80cc0ca48924001e14d9d2 | [
"Apache-2.0"
] | 181 | 2016-07-13T17:08:44.000Z | 2021-11-08T10:30:34.000Z | scoreboard/tests/validators_test.py | outdex/ctfscoreboard | ab662e26544a49ba2a80cc0ca48924001e14d9d2 | [
"Apache-2.0"
] | 250 | 2016-06-02T18:11:46.000Z | 2021-06-30T16:34:03.000Z | scoreboard/tests/validators_test.py | outdex/ctfscoreboard | ab662e26544a49ba2a80cc0ca48924001e14d9d2 | [
"Apache-2.0"
] | 78 | 2016-06-18T07:53:27.000Z | 2022-02-15T02:21:45.000Z | # Copyright 2017 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 38.094488 | 74 | 0.678793 |
e4f9d5bc52e49d3f2e971c75ceb67d24905e13fb | 33,180 | py | Python | complaint_search/tests/test_views_search.py | DalavanCloud/ccdb5-api | 9e0c4bc6e0d33bff153c1a205c979b7ecaa847da | [
"CC0-1.0"
] | 1 | 2019-02-25T00:49:18.000Z | 2019-02-25T00:49:18.000Z | complaint_search/tests/test_views_search.py | DalavanCloud/ccdb5-api | 9e0c4bc6e0d33bff153c1a205c979b7ecaa847da | [
"CC0-1.0"
] | null | null | null | complaint_search/tests/test_views_search.py | DalavanCloud/ccdb5-api | 9e0c4bc6e0d33bff153c1a205c979b7ecaa847da | [
"CC0-1.0"
] | null | null | null | from django.core.urlresolvers import reverse
from django.conf import settings
from django.core.cache import cache
from django.http import HttpResponse, StreamingHttpResponse
from rest_framework import status
from rest_framework.test import APITestCase
from unittest import skip
import copy
import mock
from datetime impo... | 48.367347 | 132 | 0.687432 |
a331e3adbe63b4d8df8b0c7742e18b5a1f453c64 | 48,663 | py | Python | superannotate/mixp/utils/parsers.py | dskkato/superannotate-python-sdk | 67eece2d7d06375ad2e502c2282e3b29c9b82631 | [
"MIT"
] | null | null | null | superannotate/mixp/utils/parsers.py | dskkato/superannotate-python-sdk | 67eece2d7d06375ad2e502c2282e3b29c9b82631 | [
"MIT"
] | null | null | null | superannotate/mixp/utils/parsers.py | dskkato/superannotate-python-sdk | 67eece2d7d06375ad2e502c2282e3b29c9b82631 | [
"MIT"
] | null | null | null | def get_project_name(project):
project_name = ""
if isinstance(project, dict):
project_name = project['name']
if isinstance(project, str):
if '/' in project:
project_name = project.split('/')[0]
else:
project_name = project
return project_name
def get_te... | 28.441262 | 89 | 0.548219 |
5421a06ac37ae4a02d53cac0c7665a1cb2c2345b | 1,789 | py | Python | tests/test_callable_object_proxy.py | mgorny/wrapt | 264c06fd3850bd0cda6917ca3e87417b573e023f | [
"BSD-2-Clause"
] | 1,579 | 2015-01-01T09:30:58.000Z | 2022-03-31T18:58:00.000Z | tests/test_callable_object_proxy.py | mgorny/wrapt | 264c06fd3850bd0cda6917ca3e87417b573e023f | [
"BSD-2-Clause"
] | 174 | 2015-02-18T05:13:54.000Z | 2022-03-30T22:09:07.000Z | tests/test_callable_object_proxy.py | mgorny/wrapt | 264c06fd3850bd0cda6917ca3e87417b573e023f | [
"BSD-2-Clause"
] | 264 | 2015-01-23T07:46:46.000Z | 2022-03-10T22:53:48.000Z | from __future__ import print_function
import unittest
import wrapt
class TestPartialCallableObjectProxy(unittest.TestCase):
def test_no_arguments(self):
def func0():
return ((), {})
partial0 = wrapt.PartialCallableObjectProxy(func0)
args, kwargs = (), {}
self.asser... | 25.197183 | 75 | 0.606484 |
123f25ab7099ee5022edf9663aa10798da4a9aa8 | 6,265 | py | Python | midas.py | ShengCN/MiDaS | 49072369de6f7ae6e95ac15cf7ca71de225d1983 | [
"MIT"
] | null | null | null | midas.py | ShengCN/MiDaS | 49072369de6f7ae6e95ac15cf7ca71de225d1983 | [
"MIT"
] | null | null | null | midas.py | ShengCN/MiDaS | 49072369de6f7ae6e95ac15cf7ca71de225d1983 | [
"MIT"
] | null | null | null | """Compute depth maps for images in the input folder.
"""
import os
from os.path import join
import glob
import torch
import utils
import cv2
import argparse
from tqdm import tqdm
import pandas as pd
from torchvision.transforms import Compose
from midas.dpt_depth import DPTDepthModel
from midas.midas_net import MidasN... | 31.80203 | 147 | 0.602873 |
4118f7b82e488212c3f466b796cbf44fc0e0bea8 | 1,370 | py | Python | hydra/main.py | machineko/hydra | 4ba24129fff5ad274611ccd63a07532ff8d44585 | [
"MIT"
] | 1 | 2021-09-29T06:24:36.000Z | 2021-09-29T06:24:36.000Z | hydra/main.py | machineko/hydra | 4ba24129fff5ad274611ccd63a07532ff8d44585 | [
"MIT"
] | null | null | null | hydra/main.py | machineko/hydra | 4ba24129fff5ad274611ccd63a07532ff8d44585 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import functools
from typing import Any, Callable, Optional
from omegaconf import DictConfig
from ._internal.utils import _run_hydra, get_args_parser
from .types import TaskFunction
def main(
config_path: Optional[str] = None,
config_nam... | 35.128205 | 100 | 0.643796 |
d3a4abfcf331f2228adb653c26f1fa62be2aa774 | 760 | py | Python | apps/tests/test_utilities.py | Zadigo/scrappers | eb5219c8363ac6d0229c0579de9b9e55cfa9fe3d | [
"MIT"
] | null | null | null | apps/tests/test_utilities.py | Zadigo/scrappers | eb5219c8363ac6d0229c0579de9b9e55cfa9fe3d | [
"MIT"
] | 114 | 2020-09-21T06:15:01.000Z | 2022-03-28T14:02:44.000Z | apps/tests/test_utilities.py | Zadigo/scrappers | eb5219c8363ac6d0229c0579de9b9e55cfa9fe3d | [
"MIT"
] | null | null | null | import unittest
from scrappers.scrappers.config.utilities import new_filename, prepare_values
class TestUtilities(unittest.TestCase):
def test_new_filename(self):
# ex. eugenie_bouchard_2019_7_1356e0.json
result = new_filename('eugenie_bouchard')
self.assertRegex(result, r'\w+\_\w+\_\d{4}... | 30.4 | 82 | 0.610526 |
a5d1db331d07c7b97c77a0929526bceaab6c372b | 655 | py | Python | main.py | andreas-bylund/thesis_generate_graphs | e6ebabba5269c163a531c140fb11fdaf27fb34c1 | [
"MIT"
] | null | null | null | main.py | andreas-bylund/thesis_generate_graphs | e6ebabba5269c163a531c140fb11fdaf27fb34c1 | [
"MIT"
] | null | null | null | main.py | andreas-bylund/thesis_generate_graphs | e6ebabba5269c163a531c140fb11fdaf27fb34c1 | [
"MIT"
] | null | null | null | from graphics import Graphics as gh
from gather_data_helper import Gather_data_helper
from t_test import T_test as T_test
import time
if __name__ == "__main__":
start_time = time.time()
dh = Gather_data_helper()
# Where is Custom_logs folder located?
custom_logs_folder_path = r"C:\Users\Andreas Bylu... | 27.291667 | 111 | 0.735878 |
95cd914025dc5a48a1db1225b115daf845723b63 | 52,017 | py | Python | scapy/layers/tls/handshake.py | kosciolek/J-Tracert | 89ed802f700e02600138ad7132e6a856463620dd | [
"MIT"
] | 3 | 2019-04-09T22:59:33.000Z | 2019-06-14T09:23:24.000Z | scapy/layers/tls/handshake.py | kosciolek/J-Tracert | 89ed802f700e02600138ad7132e6a856463620dd | [
"MIT"
] | null | null | null | scapy/layers/tls/handshake.py | kosciolek/J-Tracert | 89ed802f700e02600138ad7132e6a856463620dd | [
"MIT"
] | 1 | 2018-11-15T12:37:04.000Z | 2018-11-15T12:37:04.000Z | ## This file is part of Scapy
## Copyright (C) 2007, 2008, 2009 Arnaud Ebalard
## 2015, 2016, 2017 Maxence Tury
## This program is published under a GPLv2 license
"""
TLS handshake fields & logic.
This module covers the handshake TLS subprotocol, except for the key exchange
mechanisms which are addresse... | 42.25589 | 95 | 0.503739 |
af77dbcd1db49c1299cf54d2a17a85919806e715 | 493 | py | Python | packages/python/plotly/plotly/validators/histogram2dcontour/contours/_type.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/histogram2dcontour/contours/_type.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/histogram2dcontour/contours/_type.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class TypeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="type", parent_name="histogram2dcontour.contours", **kwargs
):
super(TypeValidator, self).__init__(
plotly_name=plotly_name,
parent... | 32.866667 | 85 | 0.64503 |
08e78f7db525b0b2e56cac96c283c182bd39875d | 1,315 | py | Python | build/dart/label_to_package_name.py | dahlia-os/fuchsia-pine64-pinephone | 57aace6f0b0bd75306426c98ab9eb3ff4524a61d | [
"BSD-3-Clause"
] | 14 | 2020-10-25T05:48:36.000Z | 2021-09-20T02:46:20.000Z | build/dart/label_to_package_name.py | DamieFC/fuchsia | f78a4a1326f4a4bb5834500918756173c01bab4f | [
"BSD-2-Clause"
] | 1 | 2022-01-14T23:38:40.000Z | 2022-01-14T23:38:40.000Z | build/dart/label_to_package_name.py | DamieFC/fuchsia | f78a4a1326f4a4bb5834500918756173c01bab4f | [
"BSD-2-Clause"
] | 4 | 2020-12-28T17:04:45.000Z | 2022-03-12T03:20:44.000Z | #!/usr/bin/env python3.8
# Copyright 2016 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
# TODO(abarth): Base these paths on the sdk_dirs variable in gn.
_SDK_DIRS = [
"garnet/public/",
"topaz/public/",... | 27.395833 | 77 | 0.642586 |
9e37393eee26fe8eebf92b54b78ba193cac7d484 | 510 | py | Python | graphics/lines_graphic.py | marcioaug/mutants-dm | 7c241f6c9073b557769906055ee61efb05363c8b | [
"MIT"
] | null | null | null | graphics/lines_graphic.py | marcioaug/mutants-dm | 7c241f6c9073b557769906055ee61efb05363c8b | [
"MIT"
] | null | null | null | graphics/lines_graphic.py | marcioaug/mutants-dm | 7c241f6c9073b557769906055ee61efb05363c8b | [
"MIT"
] | null | null | null | from matplotlib import pyplot
variance = [1, 2, 4, 8, 16, 32, 64, 128, 256]
bias_squared = [256, 128, 64, 32, 16, 8, 4, 2, 1]
total_error = [x + y for x, y in zip(variance, bias_squared)]
xs = range(len(variance))
pyplot.plot(xs, variance, 'g-', label='variance')
pyplot.plot(xs, bias_squared, 'r-.', label='bias^2')
... | 30 | 61 | 0.692157 |
e163d4601d8050c9b9bb02a37341ef7b7d849acc | 4,071 | py | Python | project/assets_cartographer/parser.py | 4383/recalbox-manager | 4da0f10d6b7c47d40b6550b3e9f96c6ee90a53bb | [
"MIT"
] | 61 | 2016-11-07T02:16:48.000Z | 2021-09-22T19:32:14.000Z | project/assets_cartographer/parser.py | DOCK-PI3/MasOS-Manager | ea5e2e6a20dc7853b5c1eeeb7f5dd358bff6d4b7 | [
"MIT"
] | 36 | 2015-12-05T10:24:27.000Z | 2019-06-25T10:50:29.000Z | project/assets_cartographer/parser.py | DOCK-PI3/MasOS-Manager | ea5e2e6a20dc7853b5c1eeeb7f5dd358bff6d4b7 | [
"MIT"
] | 33 | 2017-01-02T16:07:25.000Z | 2022-02-08T05:09:02.000Z | """
Manifest parsers
The assets manifest is a JSON file like this : ::
{
"stylesheets": {
"css/recalbox.min.css": [
"css/app.css"
]
},
"javascripts": {
"js/modernizr.min.js": [
"js/foundation5/vendor/modernizr.js"
... | 31.315385 | 121 | 0.633505 |
86ebacc47652992ecf7a326b77b60b8e9787fdc1 | 3,447 | py | Python | src/production_cost.py | Smeaol22/usda_market_data | 9743c352642643b80c1a7513e3a115e6b1b22f01 | [
"BSD-2-Clause"
] | null | null | null | src/production_cost.py | Smeaol22/usda_market_data | 9743c352642643b80c1a7513e3a115e6b1b22f01 | [
"BSD-2-Clause"
] | null | null | null | src/production_cost.py | Smeaol22/usda_market_data | 9743c352642643b80c1a7513e3a115e6b1b22f01 | [
"BSD-2-Clause"
] | null | null | null | import pandas as pd
import requests
from src.conf import ReportType, USDA_MARKET_BASE_URL
from src.error import ErrorCode, UsdaMarketRequestError
from src.main import retrieve_published_reports_by_criteria
from src.utils import extract_element_from_inline_bytes
class ProductionCostStates(enumerate):
illinois = '... | 43.0875 | 107 | 0.67537 |
afd6506029c8f1b8325c4d3628550175e7558f5b | 1,560 | py | Python | src/sol/handle_metaplex.py | dting/staketaxcsv | f25005c0c732dd6e19d2e46c6d602ab78db65868 | [
"MIT"
] | 1 | 2022-02-05T05:37:08.000Z | 2022-02-05T05:37:08.000Z | src/sol/handle_metaplex.py | dting/staketaxcsv | f25005c0c732dd6e19d2e46c6d602ab78db65868 | [
"MIT"
] | null | null | null | src/sol/handle_metaplex.py | dting/staketaxcsv | f25005c0c732dd6e19d2e46c6d602ab78db65868 | [
"MIT"
] | 1 | 2022-02-05T05:37:11.000Z | 2022-02-05T05:37:11.000Z | from common.make_tx import make_swap_tx
from sol.handle_simple import handle_unknown_detect_transfers
def handle_metaplex(exporter, txinfo):
transfers_in, transfers_out, transfers_unknown = txinfo.transfers_net
if len(transfers_in) == 1 and len(transfers_out) == 1:
sent_amount, sent_currency, _, _ = ... | 34.666667 | 98 | 0.712821 |
8befd25821c196d0483a5d630838de46109d5ac0 | 254 | py | Python | gcloud_notebook_training/notebook_utils.py | gclouduniverse/notebook_training | 40dbffb970925ebc0528d5042dbd4fda1c26bf3d | [
"MIT"
] | 7 | 2020-03-18T01:17:29.000Z | 2021-11-11T00:35:09.000Z | gcloud_notebook_training/notebook_utils.py | gclouduniverse/notebook_training | 40dbffb970925ebc0528d5042dbd4fda1c26bf3d | [
"MIT"
] | 5 | 2020-11-17T07:05:16.000Z | 2021-04-30T21:05:01.000Z | gcloud_notebook_training/notebook_utils.py | gclouduniverse/notebook_training | 40dbffb970925ebc0528d5042dbd4fda1c26bf3d | [
"MIT"
] | 1 | 2021-02-25T17:28:49.000Z | 2021-02-25T17:28:49.000Z | import json
def get_container_uri(notebook_path):
with open(notebook_path, "r") as read_file:
data = json.load(read_file)
try:
uri = data["metadata"]["environment"]["uri"]
except KeyError:
return None
return uri; | 23.090909 | 52 | 0.637795 |
7ff337ef05d92cfb69dbf4d6cf775f9f61fd0f44 | 4,493 | py | Python | tempest/api/object_storage/test_container_quotas.py | azorge/tempest | 549dfc93fb7e3d6d8566064a60a6069deae5c8eb | [
"Apache-2.0"
] | 1 | 2021-05-21T08:24:02.000Z | 2021-05-21T08:24:02.000Z | tempest/api/object_storage/test_container_quotas.py | azorge/tempest | 549dfc93fb7e3d6d8566064a60a6069deae5c8eb | [
"Apache-2.0"
] | null | null | null | tempest/api/object_storage/test_container_quotas.py | azorge/tempest | 549dfc93fb7e3d6d8566064a60a6069deae5c8eb | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Cloudwatt
# 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 app... | 38.732759 | 78 | 0.674828 |
821f95673b14b42b3262bcb651b1d66d62f52858 | 9,079 | py | Python | convolutional_attention/conv_attentional_learner.py | s1530129650/convolutional-attention | 8839da8146962879bb419a61253e7cf1b684fb22 | [
"BSD-3-Clause"
] | null | null | null | convolutional_attention/conv_attentional_learner.py | s1530129650/convolutional-attention | 8839da8146962879bb419a61253e7cf1b684fb22 | [
"BSD-3-Clause"
] | null | null | null | convolutional_attention/conv_attentional_learner.py | s1530129650/convolutional-attention | 8839da8146962879bb419a61253e7cf1b684fb22 | [
"BSD-3-Clause"
] | null | null | null | import cPickle
import logging
from math import ceil
import sys
import os
import time
import numpy as np
# from experimenter import ExperimentLogger
from convolutional_attention.conv_attentional_model import ConvolutionalAttentionalModel
from convolutional_attention.f1_evaluator import F1Evaluator
from convolutional_a... | 45.853535 | 177 | 0.666814 |
09b4422cd126c943b564f95775aff0b850731054 | 196 | py | Python | Language Proficiency/Python/Itertools/itertools.product()/cartesian_product.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Language Proficiency/Python/Itertools/itertools.product()/cartesian_product.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Language Proficiency/Python/Itertools/itertools.product()/cartesian_product.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from itertools import product
if __name__ == "__main__":
A = list(map(int, input().split()))
B = list(map(int, input().split()))
print(*list(product(A, B)))
| 17.818182 | 39 | 0.612245 |
bdc011026c5f52049bb33f5ae96599e2af6abeec | 21,295 | py | Python | aes.py | DanijelStrbad/Python_AES | 27ab34967d4ca9512da8f1e13c01589263c42860 | [
"MIT"
] | null | null | null | aes.py | DanijelStrbad/Python_AES | 27ab34967d4ca9512da8f1e13c01589263c42860 | [
"MIT"
] | null | null | null | aes.py | DanijelStrbad/Python_AES | 27ab34967d4ca9512da8f1e13c01589263c42860 | [
"MIT"
] | null | null | null | # CBC
import numpy as np
gflt2 = [0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e,
0x20, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2c, 0x2e, 0x30, 0x32, 0x34, 0x36, 0x38, 0x3a, 0x3c, 0x3e,
0x40, 0x42, 0x44, 0x46, 0x48, 0x4a, 0x4c, 0x4e, 0x50, 0x52, 0x54, 0x56, 0x58... | 44.272349 | 120 | 0.592956 |
28360eb6d137ac5700f8833f52700151d61c4daa | 101,026 | py | Python | tests/jobs/test_scheduler_job.py | YouZhengChuan/airflow | 064a66a7dcd5e0f064b3ac1138f07cbcf932abbc | [
"Apache-2.0"
] | 1 | 2021-01-06T21:22:13.000Z | 2021-01-06T21:22:13.000Z | tests/jobs/test_scheduler_job.py | YouZhengChuan/airflow | 064a66a7dcd5e0f064b3ac1138f07cbcf932abbc | [
"Apache-2.0"
] | null | null | null | tests/jobs/test_scheduler_job.py | YouZhengChuan/airflow | 064a66a7dcd5e0f064b3ac1138f07cbcf932abbc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# 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
#... | 36.32722 | 110 | 0.617514 |
712e3b5464b089391e0b26556fc1a1870a9020f1 | 1,094 | py | Python | kubernetes/test/test_v1beta1_pod_disruption_budget_status.py | reymont/python | 02a3a31c630c305527b328af49724f348fbdae15 | [
"Apache-2.0"
] | 1 | 2018-10-20T19:37:57.000Z | 2018-10-20T19:37:57.000Z | kubernetes/test/test_v1beta1_pod_disruption_budget_status.py | reymont/python | 02a3a31c630c305527b328af49724f348fbdae15 | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1beta1_pod_disruption_budget_status.py | reymont/python | 02a3a31c630c305527b328af49724f348fbdae15 | [
"Apache-2.0"
] | 2 | 2018-07-27T19:39:34.000Z | 2020-12-25T02:48:27.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.11.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
i... | 24.311111 | 113 | 0.744059 |
71a2256c4d0b640e9ab968c0661d77c55ce4ccd6 | 135 | py | Python | tensorbuilder/patches/__init__.py | cgarciae/tensorbuilder | f8e0b19c09deaaea67611d9df51218e4a9cd705a | [
"MIT"
] | 109 | 2016-06-05T21:51:53.000Z | 2021-09-06T07:00:26.000Z | tensorbuilder/patches/__init__.py | cgarciae/tensorbuilder | f8e0b19c09deaaea67611d9df51218e4a9cd705a | [
"MIT"
] | 6 | 2016-06-06T01:05:40.000Z | 2016-09-19T19:30:49.000Z | tensorbuilder/patches/__init__.py | cgarciae/tensorbuilder | f8e0b19c09deaaea67611d9df51218e4a9cd705a | [
"MIT"
] | 13 | 2016-06-06T14:15:31.000Z | 2019-11-04T23:33:56.000Z | #import layers_patch
import tensorflow_patch
import summaries_patch
import layers_patch
import rnn_utilities_patch
import custom_patch
| 19.285714 | 26 | 0.903704 |
38caa85849805251c022ca7672501e95fe5f98d6 | 11,640 | py | Python | MetamorphicTests/all_mutants/sales_forecasting_file/172.py | anuragbms/Sales-forecasting-with-RNNs | 22b4639ecbb48381af53326ace94a3538201b586 | [
"Apache-2.0"
] | null | null | null | MetamorphicTests/all_mutants/sales_forecasting_file/172.py | anuragbms/Sales-forecasting-with-RNNs | 22b4639ecbb48381af53326ace94a3538201b586 | [
"Apache-2.0"
] | null | null | null | MetamorphicTests/all_mutants/sales_forecasting_file/172.py | anuragbms/Sales-forecasting-with-RNNs | 22b4639ecbb48381af53326ace94a3538201b586 | [
"Apache-2.0"
] | 1 | 2022-02-06T14:59:43.000Z | 2022-02-06T14:59:43.000Z | def gen_mutants():
import tensorflow as tf
import pandas
import numpy as np
DATAFILE_TRAIN = 'mock_kaggle_edit_train.csv'
DATAFILE_VALIDATE = 'mock_kaggle_edit_... | 31.206434 | 232 | 0.629725 |
37360ec7bdfb6626f80397e83b1d863bc1bb75b2 | 1,699 | py | Python | train_bilstm_crf.py | Qibie/project001 | df9d03d438b5cdfa652f1fa51846aa50b203c1b6 | [
"Apache-2.0"
] | null | null | null | train_bilstm_crf.py | Qibie/project001 | df9d03d438b5cdfa652f1fa51846aa50b203c1b6 | [
"Apache-2.0"
] | null | null | null | train_bilstm_crf.py | Qibie/project001 | df9d03d438b5cdfa652f1fa51846aa50b203c1b6 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
import numpy as np
from bilstm_crf import BiLSTM_CRF
from keras.callbacks import ModelCheckpoint, EarlyStopping, ReduceLROnPlateau,\
TensorBoard
import os
# os.environ["CUDA_VISIBLE_DEVICES"] = "1"
char_embedding_mat = np.load('data/char_embedding_matrix.npy')
X_train = np.... | 44.710526 | 90 | 0.666274 |
b9ec7cce20fefabc534e6df6ca989c3c42cca8f1 | 3,576 | py | Python | pmp/rules/weakly_separable.py | Koozco/pmp | 3ad96b01afb2ce6644eb1917ae88ee6d72adc8cf | [
"MIT"
] | 1 | 2020-03-30T18:56:02.000Z | 2020-03-30T18:56:02.000Z | pmp/rules/weakly_separable.py | Koozco/pmp | 3ad96b01afb2ce6644eb1917ae88ee6d72adc8cf | [
"MIT"
] | 9 | 2018-11-19T00:04:52.000Z | 2022-03-11T23:51:18.000Z | pmp/rules/weakly_separable.py | Koozco/pmp | 3ad96b01afb2ce6644eb1917ae88ee6d72adc8cf | [
"MIT"
] | 2 | 2018-12-02T10:43:34.000Z | 2020-03-30T10:15:50.000Z | from itertools import combinations
from .tie_breaking import any_winner
from .rule import Rule
class WeaklySeparable(Rule):
"""
Weakly Separable scoring rule
This is base class for all weakly separable scoring rules
"""
def __init__(self, weights=None, tie_break=any_winner):
"""
... | 35.76 | 99 | 0.600391 |
9b61b2128871f128c69332162d8238da2f9d7812 | 7,274 | py | Python | venus/misc/observable.py | nagylzs/python-venus-lib | 336d20532c32e874ab0a43cf866092b9e55dded5 | [
"Apache-2.0"
] | null | null | null | venus/misc/observable.py | nagylzs/python-venus-lib | 336d20532c32e874ab0a43cf866092b9e55dded5 | [
"Apache-2.0"
] | 1 | 2019-02-15T13:40:49.000Z | 2019-02-15T13:40:49.000Z | venus/misc/observable.py | nagylzs/python-venus-lib | 336d20532c32e874ab0a43cf866092b9e55dded5 | [
"Apache-2.0"
] | null | null | null | """The observable/observer pattern.
Sightly modified version of Michael Kent's observer.
See: http://radio-weblogs.com/0124960/2004/06/15.html
Changes:
# Remove the "Observer" class
Formally, you must use addObserver and removeObserver.
Reasons:
a.) "There should be only one obvious way to do it."
... | 38.486772 | 120 | 0.651636 |
666c5ee89c15350c8094d733cb689e4935bf86eb | 1,902 | py | Python | app/ui/ui_set_gas_price.py | snitron/EVM-Simulator | 0569f907eb0a597e45378d0a155d9bb0a656359a | [
"MIT"
] | 28 | 2019-10-19T20:01:27.000Z | 2022-03-25T09:05:50.000Z | app/ui/ui_set_gas_price.py | snitron/EVM-Simulator | 0569f907eb0a597e45378d0a155d9bb0a656359a | [
"MIT"
] | 9 | 2020-07-16T19:00:01.000Z | 2020-07-17T18:14:01.000Z | app/ui/ui_set_gas_price.py | snitron/EVM-Simulator | 0569f907eb0a597e45378d0a155d9bb0a656359a | [
"MIT"
] | 7 | 2021-01-05T12:42:36.000Z | 2022-03-27T14:26:34.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'qt_templates/ui_set_gas_price.ui'
#
# Created by: PyQt5 UI code generator 5.13.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_SetGasPriceDialog(object):
def setupUi(self... | 39.625 | 106 | 0.731335 |
e3039f2771ce56e05fe940df09bd926aa0eeef98 | 5,445 | py | Python | Projects/Ensembling/CIFAR100/models/sdenet.py | AkibMashrur/Research | a981e3410917216e03e09431c837607543905d83 | [
"Apache-2.0"
] | null | null | null | Projects/Ensembling/CIFAR100/models/sdenet.py | AkibMashrur/Research | a981e3410917216e03e09431c837607543905d83 | [
"Apache-2.0"
] | null | null | null | Projects/Ensembling/CIFAR100/models/sdenet.py | AkibMashrur/Research | a981e3410917216e03e09431c837607543905d83 | [
"Apache-2.0"
] | null | null | null | # Copied from https://github.com/Lingkai-Kong/SDE-Net/blob/master/SVHN/models/sdenet.py
"""
Created on Mon Mar 11 16:42:11 2019
@author: lingkaikong
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
import math
__all__ = ['SDENet']
def init_params(net):
'''Init ... | 31.656977 | 147 | 0.595041 |
934d55cab0f4fe65121120a091896d64ce49a6d5 | 3,719 | py | Python | tests/test_block_until_url.py | aniruddha2000/init | fe2a32d2736c359a6911cc22bc42007ac97c5b10 | [
"BSD-3-Clause"
] | 3 | 2017-10-13T18:40:37.000Z | 2020-02-05T07:36:04.000Z | tests/test_block_until_url.py | aniruddha2000/init | fe2a32d2736c359a6911cc22bc42007ac97c5b10 | [
"BSD-3-Clause"
] | null | null | null | tests/test_block_until_url.py | aniruddha2000/init | fe2a32d2736c359a6911cc22bc42007ac97c5b10 | [
"BSD-3-Clause"
] | 5 | 2017-03-07T03:53:55.000Z | 2020-08-12T13:11:17.000Z | #!/usr/bin/python2.7
# Copyright (c) 2013 The CoreOS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import BaseHTTPServer
import os
import select
import signal
import subprocess
import threading
import time
import unittest
script_pat... | 32.622807 | 76 | 0.579726 |
6842b4a6dde0698cf31ee68ad9c56f6d94197251 | 2,903 | py | Python | tests/test_resource_constraints.py | HPI-Information-Systems/TimeEval | 9b2717b89decd57dd09e04ad94c120f13132d7b8 | [
"MIT"
] | 2 | 2022-01-29T03:46:31.000Z | 2022-02-14T14:06:35.000Z | tests/test_resource_constraints.py | HPI-Information-Systems/TimeEval | 9b2717b89decd57dd09e04ad94c120f13132d7b8 | [
"MIT"
] | null | null | null | tests/test_resource_constraints.py | HPI-Information-Systems/TimeEval | 9b2717b89decd57dd09e04ad94c120f13132d7b8 | [
"MIT"
] | null | null | null | import unittest
import psutil
from durations import Duration
from tests.fixtures.algorithms import DeviatingFromMean
from timeeval import TimeEval, DatasetManager, ResourceConstraints, Algorithm
from timeeval.resource_constraints import GB, DEFAULT_TIMEOUT
class TestResourceConstraints(unittest.TestCase):
def s... | 38.197368 | 123 | 0.703066 |
335b2a381a93bcbae337b96905c9315643cb5f84 | 4,891 | py | Python | run_second.py | b04901014/FT-w2v2-ser | e70175c2620b786269105ab0301cc0caab2911d0 | [
"MIT"
] | 32 | 2021-10-30T00:52:24.000Z | 2022-03-21T00:10:46.000Z | run_second.py | b04901014/FT-w2v2-ser | e70175c2620b786269105ab0301cc0caab2911d0 | [
"MIT"
] | 7 | 2021-11-05T11:12:46.000Z | 2022-02-07T15:21:42.000Z | run_second.py | b04901014/FT-w2v2-ser | e70175c2620b786269105ab0301cc0caab2911d0 | [
"MIT"
] | 6 | 2021-11-02T07:21:10.000Z | 2022-03-17T11:07:53.000Z | from pytorch_lightning import Trainer
from pytorch_lightning.callbacks import ModelCheckpoint
from pretrain.trainer import SecondPassEmoClassifier
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--saving_path', type=str, default='pretrain/checkpoints_second')
parser.add_argument('--lr', type=fl... | 53.163043 | 100 | 0.570844 |
5c1782d0ebc598599a860d268fe061e06cc639fa | 795 | py | Python | monitor/core/settings.py | laozhudetui/wam | 3101dae034344ec255c9f3dd165d2aae6b3bea95 | [
"MIT"
] | 227 | 2018-08-25T12:50:30.000Z | 2022-03-31T11:18:33.000Z | monitor/core/settings.py | laozhudetui/wam | 3101dae034344ec255c9f3dd165d2aae6b3bea95 | [
"MIT"
] | 1 | 2018-09-02T07:51:32.000Z | 2018-09-03T00:29:45.000Z | monitor/core/settings.py | laozhudetui/wam | 3101dae034344ec255c9f3dd165d2aae6b3bea95 | [
"MIT"
] | 48 | 2018-08-25T13:57:52.000Z | 2022-01-10T15:59:27.000Z | #!/usr/bin/env python
# coding: utf-8
# __buildin__ modules
import os
# 监控程序循环间隔(秒)
MONITOR_CHECK_INTERVAL = 3600
# 下载大小限制(字节)
DOWNLOAD_MAX_BYTES = 104857600 # 1024*1024*100 = 100MB
# 应用包存储路径
PACKAGE_SOTRE_DIR = os.path.join(os.path.dirname(os.path.dirname(__file__)), '../wam/packages/')
FILE_STORE_DIR = os.path.... | 27.413793 | 96 | 0.730818 |
2b3f69c9481cd2cc235adf711a25d6668754190a | 22,428 | py | Python | airflow/providers/google/marketing_platform/operators/display_video.py | odavid/airflow | 7269d15adfb74188359757b1705485f5d368486a | [
"Apache-2.0"
] | 1 | 2021-04-16T12:40:40.000Z | 2021-04-16T12:40:40.000Z | airflow/providers/google/marketing_platform/operators/display_video.py | odavid/airflow | 7269d15adfb74188359757b1705485f5d368486a | [
"Apache-2.0"
] | null | null | null | airflow/providers/google/marketing_platform/operators/display_video.py | odavid/airflow | 7269d15adfb74188359757b1705485f5d368486a | [
"Apache-2.0"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 36.232633 | 108 | 0.655029 |
0358b1489bcd6817381968f23b41ac7d406c12f7 | 1,198 | py | Python | deafwave/types/generator_types.py | SparXalt/deafwave-blockchain | 579eac55d55285f750c622bf66a1aa30ed6d949d | [
"Apache-2.0"
] | null | null | null | deafwave/types/generator_types.py | SparXalt/deafwave-blockchain | 579eac55d55285f750c622bf66a1aa30ed6d949d | [
"Apache-2.0"
] | null | null | null | deafwave/types/generator_types.py | SparXalt/deafwave-blockchain | 579eac55d55285f750c622bf66a1aa30ed6d949d | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
from typing import List
from deafwave.types.blockchain_format.program import SerializedProgram
from deafwave.util.ints import uint32
from deafwave.util.streamable import Streamable, streamable
class GeneratorBlockCacheInterface:
def get_generator_for_block_height(self, height: ui... | 27.227273 | 83 | 0.761269 |
4843212bcd000cdc7faab789686c5e6c53eb1636 | 3,824 | bzl | Python | kotlin/internal/jvm/android.bzl | eiiches/rules_kotlin | 89a082c69ce3bc7b0a996aea12cb2d118ab0bbc7 | [
"Apache-2.0"
] | null | null | null | kotlin/internal/jvm/android.bzl | eiiches/rules_kotlin | 89a082c69ce3bc7b0a996aea12cb2d118ab0bbc7 | [
"Apache-2.0"
] | null | null | null | kotlin/internal/jvm/android.bzl | eiiches/rules_kotlin | 89a082c69ce3bc7b0a996aea12cb2d118ab0bbc7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 34.142857 | 117 | 0.637814 |
c9a3a1c17a895153a80889bbb5b2b9d5c90cb823 | 7,730 | py | Python | venv/lib/python2.7/site-packages/ansible/modules/cloud/rackspace/rax_cdb.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | 17 | 2017-06-07T23:15:01.000Z | 2021-08-30T14:32:36.000Z | ansible/ansible/modules/cloud/rackspace/rax_cdb.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 9 | 2017-06-25T03:31:52.000Z | 2021-05-17T23:43:12.000Z | ansible/ansible/modules/cloud/rackspace/rax_cdb.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 3 | 2018-05-26T21:31:22.000Z | 2019-09-28T17:00:45.000Z | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | 30.077821 | 108 | 0.602846 |
b4cbba8afbc0264448a6736fa1ce99912a641f4f | 998 | py | Python | tests/test_http_input.py | hknust/cwltool | 2978c8bff88be2ad357554c9291cc992d3e74a47 | [
"Apache-2.0"
] | null | null | null | tests/test_http_input.py | hknust/cwltool | 2978c8bff88be2ad357554c9291cc992d3e74a47 | [
"Apache-2.0"
] | null | null | null | tests/test_http_input.py | hknust/cwltool | 2978c8bff88be2ad357554c9291cc992d3e74a47 | [
"Apache-2.0"
] | null | null | null | import os
import tempfile
from cwltool.pathmapper import PathMapper
def test_http_path_mapping():
class SubPathMapper(PathMapper):
def __init__(self, referenced_files, basedir, stagedir):
super(SubPathMapper, self).__init__(referenced_files, basedir, stagedir)
input_file_path = "https://... | 33.266667 | 114 | 0.686373 |
95fbd9eab6cc3f2c56825ab31cac0886369b8225 | 710 | py | Python | scrapy_proj/openrecipes/spiders/steamykitchen_feedspider.py | fictivekin/openrecipes | 82b5c080168439b328f76a115aa2011fa4601384 | [
"Apache-2.0"
] | 300 | 2015-01-05T05:37:34.000Z | 2022-03-05T16:24:37.000Z | scrapy_proj/openrecipes/spiders/steamykitchen_feedspider.py | fictivekin/openrecipes | 82b5c080168439b328f76a115aa2011fa4601384 | [
"Apache-2.0"
] | 11 | 2015-05-14T04:15:22.000Z | 2018-01-27T17:22:32.000Z | scrapy_proj/openrecipes/spiders/steamykitchen_feedspider.py | fictivekin/openrecipes | 82b5c080168439b328f76a115aa2011fa4601384 | [
"Apache-2.0"
] | 100 | 2015-01-11T23:14:29.000Z | 2022-03-25T06:03:48.000Z | from scrapy.spider import BaseSpider
from scrapy.http import Request
from scrapy.selector import XmlXPathSelector
from openrecipes.spiders.steamykitchen_spider import SteamykitchenMixin
class SteamykitchenfeedSpider(BaseSpider, SteamykitchenMixin):
name = "steamykitchen.feed"
allowed_domains = [
"st... | 27.307692 | 80 | 0.695775 |
407f470903fcac46df435e71aab4b0943e8e1b7b | 2,105 | py | Python | pylimit/redis_helper.py | biplap-sarkar/pylim | 9f649334e325d032b27555665521dff44aa6cdfc | [
"Apache-2.0"
] | 17 | 2016-10-28T06:58:41.000Z | 2021-07-29T06:40:55.000Z | pylimit/redis_helper.py | biplap-sarkar/pylim | 9f649334e325d032b27555665521dff44aa6cdfc | [
"Apache-2.0"
] | 5 | 2016-11-15T02:42:27.000Z | 2021-04-20T09:00:14.000Z | pylimit/redis_helper.py | biplap-sarkar/pylim | 9f649334e325d032b27555665521dff44aa6cdfc | [
"Apache-2.0"
] | 10 | 2016-08-09T11:33:41.000Z | 2021-04-08T01:51:12.000Z | import redis
from redis.sentinel import Sentinel
from redis.client import Pipeline
import redis.client
class RedisHelper(object):
def __init__(self, host: str, port: int, is_sentinel=False,
sentinel_service=None, password=None):
self.host = host
self.port = port
self.is_se... | 35.677966 | 77 | 0.587648 |
bc4bfbf3acd45a5504167921f95b0fc458410473 | 6,445 | py | Python | setup.py | cheshire/numpy | e31727075c0fc2a115c83e41e14a4600b7a4bf28 | [
"BSD-3-Clause"
] | null | null | null | setup.py | cheshire/numpy | e31727075c0fc2a115c83e41e14a4600b7a4bf28 | [
"BSD-3-Clause"
] | null | null | null | setup.py | cheshire/numpy | e31727075c0fc2a115c83e41e14a4600b7a4bf28 | [
"BSD-3-Clause"
] | 8 | 2015-12-27T21:28:21.000Z | 2019-06-17T20:39:35.000Z | #!/usr/bin/env python
"""NumPy: array processing for numbers, strings, records, and objects.
NumPy is a general-purpose array-processing package designed to
efficiently manipulate large multi-dimensional arrays of arbitrary
records without sacrificing too much speed for small multi-dimensional
arrays. NumPy is built ... | 31.135266 | 100 | 0.635531 |
18ae5da59450d3e15499d10da9a30dbcda0350fd | 890 | py | Python | flTile/utils.py | rpwagner/tiled-display | 52d135bc163360fe55ce5521784b0ef48a8c82c9 | [
"Apache-2.0"
] | 1 | 2020-12-11T17:11:45.000Z | 2020-12-11T17:11:45.000Z | flTile/utils.py | rpwagner/tiled-display | 52d135bc163360fe55ce5521784b0ef48a8c82c9 | [
"Apache-2.0"
] | null | null | null | flTile/utils.py | rpwagner/tiled-display | 52d135bc163360fe55ce5521784b0ef48a8c82c9 | [
"Apache-2.0"
] | null | null | null | class CursorAutoMover:
def __init__(self, target, xrange=(0,5000), yrange=(0,3000), xvel=100, yvel=100):
self.target = target
self.xvel = xvel
self.yvel = yvel
self.xrange = xrange
self.yrange = yrange
self.visible = False
def draw(self):
pass
def ... | 29.666667 | 85 | 0.531461 |
fbf525fa9ad00fa59dd1dcfa78a5a4a22a295312 | 10,691 | py | Python | simplerestler/element.py | svilborg/simplerestler | b6e36f318bd3c6b34264e382ce814afa53c8ca12 | [
"MIT"
] | 1 | 2015-01-26T21:30:03.000Z | 2015-01-26T21:30:03.000Z | simplerestler/element.py | svilborg/simplerestler | b6e36f318bd3c6b34264e382ce814afa53c8ca12 | [
"MIT"
] | null | null | null | simplerestler/element.py | svilborg/simplerestler | b6e36f318bd3c6b34264e382ce814afa53c8ca12 | [
"MIT"
] | null | null | null | """ Elements """
import errors
from utils import Utils
NL = "\n"
class Element:
"""Element."""
def __init__( self, name, parent=None):
self.name = name
self.params = []
self.parent = parent
self.content = []
def __call__( self, *args, **kwargs ):
self.p... | 21.003929 | 103 | 0.486484 |
498a60220b89c9a44073f44b772e75d2037f4b30 | 25,994 | py | Python | test/utils_spec_runner.py | blink1073/mongo-python-driver | 98d393336411b7cd5ad4e184ca45192f76fb48e8 | [
"Apache-2.0"
] | null | null | null | test/utils_spec_runner.py | blink1073/mongo-python-driver | 98d393336411b7cd5ad4e184ca45192f76fb48e8 | [
"Apache-2.0"
] | null | null | null | test/utils_spec_runner.py | blink1073/mongo-python-driver | 98d393336411b7cd5ad4e184ca45192f76fb48e8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019-present MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 38.739195 | 100 | 0.616527 |
0010498eb0df81455022d6e3c08e4d15ac3d9906 | 312 | py | Python | actionslog/forms.py | nolifeinsense/django-actions-logger | 59a8bf7a866ec78f44ea2d8f3bea7f2d9a2d533b | [
"MIT"
] | 27 | 2016-01-27T21:30:08.000Z | 2021-04-18T18:24:22.000Z | actionslog/forms.py | nolifeinsense/django-actions-logger | 59a8bf7a866ec78f44ea2d8f3bea7f2d9a2d533b | [
"MIT"
] | 6 | 2016-02-04T16:05:45.000Z | 2021-04-14T11:00:00.000Z | actionslog/forms.py | nolifeinsense/django-actions-logger | 59a8bf7a866ec78f44ea2d8f3bea7f2d9a2d533b | [
"MIT"
] | 10 | 2016-02-16T05:32:06.000Z | 2022-03-09T01:28:24.000Z |
from django import forms
from django.utils.functional import lazy
from . import settings as app_conf
def get_action_choices():
return app_conf.LOG_ACTION_CHOICES
class LogActionForm(forms.ModelForm):
# lots of fields like this
action = forms.ChoiceField(choices=lazy(get_action_choices, list)())
| 24 | 72 | 0.782051 |
6e66c82856fc4a887b28499eb6a337cab7c40a72 | 189 | py | Python | test/tests/str_default.py | kevinxucs/pyston | bdb87c1706ac74a0d15d9bc2bae53798678a5f14 | [
"Apache-2.0"
] | 1 | 2020-02-06T14:28:45.000Z | 2020-02-06T14:28:45.000Z | test/tests/str_default.py | kevinxucs/pyston | bdb87c1706ac74a0d15d9bc2bae53798678a5f14 | [
"Apache-2.0"
] | null | null | null | test/tests/str_default.py | kevinxucs/pyston | bdb87c1706ac74a0d15d9bc2bae53798678a5f14 | [
"Apache-2.0"
] | 1 | 2020-02-06T14:29:00.000Z | 2020-02-06T14:29:00.000Z | class C(object):
def __repr__(self):
print "repr"
return 1
c = C()
print "C object" in object.__repr__(c)
print object.__str__(c)
print c.__repr__()
print c.__str__()
| 15.75 | 38 | 0.634921 |
b4f87b2a342718c8f697f987f5cc02f01d06268e | 9,777 | py | Python | openmdao/surrogate_models/kriging.py | OwenMcDonnell/OpenMDAO | 72695acd3ff9ab2086c4f9dd87688b803e773899 | [
"Apache-2.0"
] | 1 | 2016-05-10T17:01:17.000Z | 2016-05-10T17:01:17.000Z | openmdao/surrogate_models/kriging.py | gsoxley/OpenMDAO | 709401e535cf6933215abd942d4b4d49dbf61b2b | [
"Apache-2.0"
] | 3 | 2016-05-10T16:55:46.000Z | 2018-10-22T23:28:52.000Z | openmdao/surrogate_models/kriging.py | gsoxley/OpenMDAO | 709401e535cf6933215abd942d4b4d49dbf61b2b | [
"Apache-2.0"
] | 2 | 2018-04-05T15:53:54.000Z | 2018-10-22T22:48:00.000Z | """Surrogate model based on Kriging."""
import numpy as np
import scipy.linalg as linalg
from scipy.optimize import minimize
from six.moves import zip, range
from openmdao.surrogate_models.surrogate_model import SurrogateModel
MACHINE_EPSILON = np.finfo(np.double).eps
class KrigingSurrogate(SurrogateModel):
""... | 31.743506 | 94 | 0.571955 |
f84da9caa36e8ed9911ad32d7da30f5b90092d59 | 2,967 | py | Python | paddlenlp/datasets/cail2019_scm.py | JunnYu/ConvBERT-Prod | a1351e1e7f9400cb8c71d0a15d23629b4cb055d4 | [
"Apache-2.0"
] | 11 | 2022-01-06T07:39:47.000Z | 2022-03-22T06:18:40.000Z | paddlenlp/datasets/cail2019_scm.py | JunnYu/ConvBERT-Prod | a1351e1e7f9400cb8c71d0a15d23629b4cb055d4 | [
"Apache-2.0"
] | null | null | null | paddlenlp/datasets/cail2019_scm.py | JunnYu/ConvBERT-Prod | a1351e1e7f9400cb8c71d0a15d23629b4cb055d4 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 36.62963 | 91 | 0.634985 |
a01539f1c8dcb18d0cd809f438c890f07adb5efc | 4,604 | py | Python | src/python/peanoclaw/callbacks/solvercallback.py | unterweg/peanoclaw | 2d8b45727e3b26d824f8afc6a8772736176083af | [
"BSD-3-Clause"
] | 1 | 2015-07-14T10:05:52.000Z | 2015-07-14T10:05:52.000Z | src/python/peanoclaw/callbacks/solvercallback.py | unterweg/peanoclaw | 2d8b45727e3b26d824f8afc6a8772736176083af | [
"BSD-3-Clause"
] | null | null | null | src/python/peanoclaw/callbacks/solvercallback.py | unterweg/peanoclaw | 2d8b45727e3b26d824f8afc6a8772736176083af | [
"BSD-3-Clause"
] | 1 | 2019-12-03T15:58:53.000Z | 2019-12-03T15:58:53.000Z | '''
Created on Jan 29, 2013
@author: kristof
'''
import time
from ctypes import c_bool
from ctypes import c_double
from ctypes import c_int
from ctypes import CFUNCTYPE
from ctypes import py_object
from ctypes import POINTER
class SolverCallback(object):
'''
This class encapsulates the callback for solving one t... | 39.016949 | 336 | 0.672024 |
6a1df7ae9fb5b5e4562bbcadb568495d3f26eba2 | 1,330 | py | Python | tests/standalone_apps/namespace_pkg_config_source_test/namespace_test/test_namespace.py | samuelstanton/hydra | 9bf7800157692795090f3695efe136bbbd6fef1d | [
"MIT"
] | 1 | 2021-09-29T06:24:36.000Z | 2021-09-29T06:24:36.000Z | tests/standalone_apps/namespace_pkg_config_source_test/namespace_test/test_namespace.py | pkassotis/hydra | 2d859b664e5ba69d2ad74427f7362406cdd7e170 | [
"MIT"
] | null | null | null | tests/standalone_apps/namespace_pkg_config_source_test/namespace_test/test_namespace.py | pkassotis/hydra | 2d859b664e5ba69d2ad74427f7362406cdd7e170 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from pytest import mark, param
from hydra._internal.core_plugins.importlib_resources_config_source import (
ImportlibResourcesConfigSource,
)
from hydra.core.global_hydra import GlobalHydra
from hydra.experimental import initialize
from hydra.t... | 35 | 77 | 0.742105 |
ebb00fc436874cf61365f3b682946c8f3a03f001 | 1,074 | py | Python | tests/runtime/columntest.py | dcramer/jinja1-djangosupport | 755287f155c18ccabe69f1318bacdaca14f55da3 | [
"BSD-3-Clause"
] | 2 | 2015-09-24T19:53:35.000Z | 2015-11-06T10:47:02.000Z | tests/runtime/columntest.py | dcramer/jinja1-djangosupport | 755287f155c18ccabe69f1318bacdaca14f55da3 | [
"BSD-3-Clause"
] | null | null | null | tests/runtime/columntest.py | dcramer/jinja1-djangosupport | 755287f155c18ccabe69f1318bacdaca14f55da3 | [
"BSD-3-Clause"
] | null | null | null | import jdebug
from jinja import from_string
template = from_string(u'''\
<h1>Unfilled</h1>
<div class="index">
{%- for column in items|slice(3) %}
<div class="col-{{ loop.index }}">
<ul>
{%- for item in column %}
<li>{{ item }}</li>
{%- endfor %}
</ul>
</div>
{%- endfor %}
</div>
<h1>Fi... | 18.517241 | 52 | 0.497207 |
888c33dfa7f44fa8d4ddb0d9a465ed3e092de931 | 227 | py | Python | pfstratsim/solvers/__init__.py | aarondorffeld/portfolio-strategy-simulation | 8c4771df24e3c45865c7df2a68e51ef018f7be1b | [
"MIT"
] | null | null | null | pfstratsim/solvers/__init__.py | aarondorffeld/portfolio-strategy-simulation | 8c4771df24e3c45865c7df2a68e51ef018f7be1b | [
"MIT"
] | 42 | 2021-11-06T15:19:49.000Z | 2022-01-23T16:38:21.000Z | pfstratsim/solvers/__init__.py | aarondorffeld/portfolio-strategy-simulation | 8c4771df24e3c45865c7df2a68e51ef018f7be1b | [
"MIT"
] | null | null | null | from .solver import Solver
from .equal_proportion import EqualProportion
from .mathematical_programming import MathematicalProgramming
__all__ = [
"Solver",
"EqualProportion",
"MathematicalProgramming",
]
| 22.7 | 62 | 0.753304 |
a0b4f39621b7c1854d52758c011018758d1339c3 | 561 | py | Python | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyNumber/auto_rest_number_test_service/operations/__init__.py | ljhljh235/AutoRest | b9ab4000e9b93d16925db84d08bafc225b098f8e | [
"MIT"
] | 3 | 2018-03-20T22:36:32.000Z | 2021-07-15T02:36:51.000Z | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyNumber/auto_rest_number_test_service/operations/__init__.py | ljhljh235/AutoRest | b9ab4000e9b93d16925db84d08bafc225b098f8e | [
"MIT"
] | null | null | null | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyNumber/auto_rest_number_test_service/operations/__init__.py | ljhljh235/AutoRest | b9ab4000e9b93d16925db84d08bafc225b098f8e | [
"MIT"
] | 1 | 2019-07-20T12:20:03.000Z | 2019-07-20T12:20:03.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 33 | 76 | 0.55615 |
9a0b3df570b86b784bcdaada06c7946dbbb32fec | 18,686 | py | Python | nested_inline/admin.py | bui3itf0ky00/django-nested-inline | aa0a5263ece7340ea5d5b7a3fdea8f8135bc4fa0 | [
"MIT"
] | null | null | null | nested_inline/admin.py | bui3itf0ky00/django-nested-inline | aa0a5263ece7340ea5d5b7a3fdea8f8135bc4fa0 | [
"MIT"
] | null | null | null | nested_inline/admin.py | bui3itf0ky00/django-nested-inline | aa0a5263ece7340ea5d5b7a3fdea8f8135bc4fa0 | [
"MIT"
] | null | null | null | from django import VERSION, forms
from django.conf import settings
from django.contrib import admin
from django.contrib.admin import helpers
from django.contrib.admin.options import InlineModelAdmin, reverse
from django.contrib.admin.utils import unquote
from django.core.exceptions import PermissionDenied
from django.d... | 46.024631 | 114 | 0.583324 |
af056cdb2df2dd347643ca9e4058ff17b7acbefb | 675 | py | Python | Pima-indians-diabetics/test.py | jyothiprakashpanaik/ML-4-e | dfaa0bc21ae6309bca95d7ef8c5db0274ed3038a | [
"MIT"
] | 1 | 2021-10-01T18:12:05.000Z | 2021-10-01T18:12:05.000Z | Pima-indians-diabetics/test.py | jyothiprakashpanaik/ML-4-e | dfaa0bc21ae6309bca95d7ef8c5db0274ed3038a | [
"MIT"
] | null | null | null | Pima-indians-diabetics/test.py | jyothiprakashpanaik/ML-4-e | dfaa0bc21ae6309bca95d7ef8c5db0274ed3038a | [
"MIT"
] | 1 | 2021-10-01T18:17:45.000Z | 2021-10-01T18:17:45.000Z | from keras.models import model_from_json
import numpy as np
from keras.preprocessing import image
from numpy import loadtxt
from sklearn.metrics import confusion_matrix
json_file = open('model.json','r')
load_model_json = json_file.read()
json_file.close()
model = model_from_json(load_model_json)
model.load_weights('... | 22.5 | 60 | 0.737778 |
ad52a559c0c3d618d8b3df285ee605d1fe5e6f4f | 113 | py | Python | game/gamesrc/world/worldbuild.py | abbacode/avaloria | 02e1805ac6e74543c96408b7951429f94bc140ca | [
"ClArtistic"
] | null | null | null | game/gamesrc/world/worldbuild.py | abbacode/avaloria | 02e1805ac6e74543c96408b7951429f94bc140ca | [
"ClArtistic"
] | null | null | null | game/gamesrc/world/worldbuild.py | abbacode/avaloria | 02e1805ac6e74543c96408b7951429f94bc140ca | [
"ClArtistic"
] | null | null | null | #INSERT backend_weapons
#INSERT backend_items
#INSERT backend_npcs
#INSERT quests
#INSERT zones
#INSERT globals
| 16.142857 | 23 | 0.831858 |
fda6b9702c081a834a01c87b665110aec3fde5cc | 11,739 | py | Python | src/sagemaker/pipeline.py | dlragha/sagemaker-python-sdk | 04a2e75c236752256729e84ccd8eb6163d8daab8 | [
"Apache-2.0"
] | 1 | 2019-12-28T00:47:41.000Z | 2019-12-28T00:47:41.000Z | src/sagemaker/pipeline.py | dlragha/sagemaker-python-sdk | 04a2e75c236752256729e84ccd8eb6163d8daab8 | [
"Apache-2.0"
] | null | null | null | src/sagemaker/pipeline.py | dlragha/sagemaker-python-sdk | 04a2e75c236752256729e84ccd8eb6163d8daab8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017-2018 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://aws.amazon.com/apache2.0/
#
# or in the "license" fil... | 43.639405 | 98 | 0.634466 |
8b090621155235bd693b17424b257b545055f9c8 | 218 | py | Python | tests/test_meta_schemas_compilation.py | ocavue/jsonschemax | e9a2cd10d9610c6222f1a83869da929fe0ff2f2d | [
"MIT"
] | 1 | 2021-03-21T10:41:47.000Z | 2021-03-21T10:41:47.000Z | tests/test_meta_schemas_compilation.py | ocavue/jsonschemax | e9a2cd10d9610c6222f1a83869da929fe0ff2f2d | [
"MIT"
] | 3 | 2020-03-24T16:37:38.000Z | 2021-02-02T22:02:18.000Z | tests/test_meta_schemas_compilation.py | ocavue/jsonschemax | e9a2cd10d9610c6222f1a83869da929fe0ff2f2d | [
"MIT"
] | 1 | 2019-01-22T12:47:30.000Z | 2019-01-22T12:47:30.000Z | import jsonschemax
# jsonschemax.compile(
# {"properties": {"propertyNames": {"$ref": "#"}, "enum": {"items": True}}},
# jsonschemax.draft7_keyword_map,
# )
jsonschemax.compile(jsonschemax.draft7_meta_schema)
| 27.25 | 80 | 0.688073 |
4f0cc8d45913dc0f56f2e4e39015876b9e3e2488 | 11,056 | py | Python | tests/utils_tests/test_html.py | jmcdono362/django | 2014db50f4522243dba3190c640f64cf124d5b68 | [
"PSF-2.0",
"BSD-3-Clause"
] | 2 | 2021-03-13T21:16:42.000Z | 2022-01-12T00:29:14.000Z | tests/utils_tests/test_html.py | jmcdono362/django | 2014db50f4522243dba3190c640f64cf124d5b68 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/utils_tests/test_html.py | jmcdono362/django | 2014db50f4522243dba3190c640f64cf124d5b68 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2019-02-24T03:48:14.000Z | 2019-02-24T03:48:14.000Z | import os
from datetime import datetime
from django.test import SimpleTestCase
from django.utils.functional import lazystr
from django.utils.html import (
conditional_escape, escape, escapejs, format_html, html_safe, json_script,
linebreaks, smart_urlquote, strip_spaces_between_tags, strip_tags, urlize,
)
from... | 43.1875 | 117 | 0.529667 |
dcd50a097142ab91f02225d8385855a0dd3132ce | 2,706 | py | Python | octavia/opts.py | BoTranVan/octavia | 70665664b2130f276291cefac0ed3bc0878d6cd9 | [
"Apache-2.0"
] | null | null | null | octavia/opts.py | BoTranVan/octavia | 70665664b2130f276291cefac0ed3bc0878d6cd9 | [
"Apache-2.0"
] | null | null | null | octavia/opts.py | BoTranVan/octavia | 70665664b2130f276291cefac0ed3bc0878d6cd9 | [
"Apache-2.0"
] | 1 | 2021-12-27T13:18:38.000Z | 2021-12-27T13:18:38.000Z | # 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, software
# distributed under the... | 42.28125 | 77 | 0.717295 |
1770451e345f2c35de092550501488ad9380fabd | 1,133 | py | Python | observatory/dashboard/models/__init__.py | natestedman/Observatory | 6e810b22d844416b2a3057e99ef23baa0d122ab4 | [
"0BSD"
] | 1 | 2015-01-16T04:17:54.000Z | 2015-01-16T04:17:54.000Z | observatory/dashboard/models/__init__.py | natestedman/Observatory | 6e810b22d844416b2a3057e99ef23baa0d122ab4 | [
"0BSD"
] | null | null | null | observatory/dashboard/models/__init__.py | natestedman/Observatory | 6e810b22d844416b2a3057e99ef23baa0d122ab4 | [
"0BSD"
] | null | null | null | # Copyright (c) 2010, individual contributors (see AUTHORS file)
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" ... | 41.962963 | 74 | 0.812004 |
5f1da5d3acd90c0ffeb395d09964ae68d2f6fd69 | 701 | py | Python | gxf/formatting.py | Talanor/gxf | 4dd2f3a123e646fcbf0f44b43f2004b04acba9be | [
"MIT"
] | 41 | 2015-02-16T02:30:19.000Z | 2019-11-03T06:39:52.000Z | gxf/formatting.py | Talanor/gxf | 4dd2f3a123e646fcbf0f44b43f2004b04acba9be | [
"MIT"
] | 4 | 2015-02-02T10:51:00.000Z | 2019-03-02T15:48:57.000Z | gxf/formatting.py | Talanor/gxf | 4dd2f3a123e646fcbf0f44b43f2004b04acba9be | [
"MIT"
] | 8 | 2015-01-21T20:48:21.000Z | 2019-01-28T12:53:56.000Z | # -*- coding: utf-8 -*-
import pygments
from pygments.formatters import TerminalFormatter
from pygments.token import Token # NOQA
formatter = TerminalFormatter(bg="dark")
class Formattable(object):
def __init__(self, tokens=None):
if tokens is not None:
self._tokens = tokens
def fmtto... | 23.366667 | 74 | 0.650499 |
07e89f3c97eef5faa211d90083c75758fd3214d4 | 3,216 | py | Python | homeassistant/components/stookalert/binary_sensor.py | lkempf/core | 8d7744a74f6f28657941dc095fb5a197e726ffff | [
"Apache-2.0"
] | null | null | null | homeassistant/components/stookalert/binary_sensor.py | lkempf/core | 8d7744a74f6f28657941dc095fb5a197e726ffff | [
"Apache-2.0"
] | null | null | null | homeassistant/components/stookalert/binary_sensor.py | lkempf/core | 8d7744a74f6f28657941dc095fb5a197e726ffff | [
"Apache-2.0"
] | null | null | null | """This integration provides support for Stookalert Binary Sensor."""
from __future__ import annotations
from datetime import timedelta
import stookalert
import voluptuous as vol
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_SAFETY,
PLATFORM_SCHEMA,
BinarySensorEntity,
)
from homeassi... | 30.628571 | 87 | 0.70398 |
998afa8e887b49a29425e3c2b3650ead6e136ec1 | 1,597 | py | Python | atcoderpiechart.py | Vicfred/rankingdistribution | 72374afee2b503c62921edefb438e51cff5eadcd | [
"MIT"
] | 1 | 2021-06-16T14:33:25.000Z | 2021-06-16T14:33:25.000Z | atcoderpiechart.py | Vicfred/rankingdistribution | 72374afee2b503c62921edefb438e51cff5eadcd | [
"MIT"
] | null | null | null | atcoderpiechart.py | Vicfred/rankingdistribution | 72374afee2b503c62921edefb438e51cff5eadcd | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
# Pie chart, where the slices will be ordered and plotted counter-clockwise:
labels = 'red', 'orange', 'yellow', 'blue', 'cyan', 'green', 'brown', 'gray'
colors = ('#ff0000', '#ffb331', '#fef53a', '#2667f2', '#3afeee', '#00c911', '#5e4838', '#afafaf')
sizes = [147-1+1... | 53.233333 | 110 | 0.631183 |
7cb20842311931067e1aa48e1f3d23e6fb540075 | 9,133 | py | Python | plugins/modules/oci_apm_control_plane_apm_domain_facts.py | sohwaje/oci-ansible-collection | 9e6b8cf55e596a96560710a457a7df05886fc59c | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_apm_control_plane_apm_domain_facts.py | sohwaje/oci-ansible-collection | 9e6b8cf55e596a96560710a457a7df05886fc59c | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_apm_control_plane_apm_domain_facts.py | sohwaje/oci-ansible-collection | 9e6b8cf55e596a96560710a457a7df05886fc59c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 32.852518 | 150 | 0.616446 |
5cdc9998a36152c54ccf13a070ec30d19c480ffc | 27,119 | py | Python | zoom_meeting.py | mrcromulent/ZoomBot | 7b613fab954e54989e5bca79aae229c5c5f6872d | [
"MIT"
] | 3 | 2020-07-26T13:53:28.000Z | 2021-02-07T23:32:58.000Z | zoom_meeting.py | mrcromulent/ZoomBot | 7b613fab954e54989e5bca79aae229c5c5f6872d | [
"MIT"
] | 1 | 2020-09-26T02:55:01.000Z | 2020-09-27T02:15:08.000Z | zoom_meeting.py | mrcromulent/ZoomBot | 7b613fab954e54989e5bca79aae229c5c5f6872d | [
"MIT"
] | 3 | 2020-07-22T04:16:06.000Z | 2021-02-07T23:33:00.000Z | import re
import time
import pickle as pk
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support im... | 37.098495 | 120 | 0.631587 |
6b36d42e26452d30d8d8922ba5b0b162349c593c | 13,789 | py | Python | tests/test_database_cache_clearer.py | enterstudio/the-blue-alliance | b53f752fe1f059b4b6f91c841e1865a6c6b81268 | [
"MIT"
] | null | null | null | tests/test_database_cache_clearer.py | enterstudio/the-blue-alliance | b53f752fe1f059b4b6f91c841e1865a6c6b81268 | [
"MIT"
] | null | null | null | tests/test_database_cache_clearer.py | enterstudio/the-blue-alliance | b53f752fe1f059b4b6f91c841e1865a6c6b81268 | [
"MIT"
] | null | null | null | import unittest2
from google.appengine.ext import ndb
from google.appengine.ext import testbed
from database import get_affected_queries
from database.award_query import EventAwardsQuery, TeamAwardsQuery, TeamYearAwardsQuery, TeamEventAwardsQuery
from database.district_query import DistrictsInYearQuery, DistrictHisto... | 50.694853 | 156 | 0.702299 |
28a1b7c810f623ff978873a3aa91a8f66c3267dd | 5,791 | py | Python | lib/galaxy/datatypes/triples.py | uio-bmi/galaxy-graph-peak-caller | 0e0e8e9bd6d461a4e25b49cea2e6753043f747e0 | [
"CC-BY-3.0"
] | 2 | 2017-10-23T14:44:12.000Z | 2018-01-14T10:37:28.000Z | lib/galaxy/datatypes/triples.py | uio-bmi/galaxy-graph-peak-caller | 0e0e8e9bd6d461a4e25b49cea2e6753043f747e0 | [
"CC-BY-3.0"
] | 30 | 2016-10-20T15:35:12.000Z | 2018-10-02T15:59:54.000Z | lib/galaxy/datatypes/triples.py | uio-bmi/galaxy-graph-peak-caller | 0e0e8e9bd6d461a4e25b49cea2e6753043f747e0 | [
"CC-BY-3.0"
] | 4 | 2017-06-12T09:54:31.000Z | 2019-03-15T12:02:39.000Z | """
Triple format classes
"""
import logging
import re
from . import (
binary,
data,
text,
xml
)
log = logging.getLogger(__name__)
class Triples(data.Data):
"""
The abstract base class for the file format that can contain triples
"""
edam_data = "data_0582"
edam_format = "format_... | 30.640212 | 124 | 0.577448 |
8c9db84a5aed42e867e35335d1a9a03937ce2247 | 19,795 | py | Python | google/ads/googleads/v9/services/services/accessible_bidding_strategy_service/client.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v9/services/services/accessible_bidding_strategy_service/client.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v9/services/services/accessible_bidding_strategy_service/client.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | # -*- 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... | 41.239583 | 176 | 0.64294 |
c7846bbe4e9c7ba2f971b4e222ef907d7f55b1c4 | 22,547 | py | Python | utils/lit/lit/llvm/config.py | kkeita/llvm_autofdo | 9ecd435b55a3e58e1e3f71d478ff02c57840a900 | [
"Apache-2.0"
] | 34 | 2019-05-29T03:15:48.000Z | 2022-03-24T03:14:58.000Z | utils/lit/lit/llvm/config.py | kkeita/llvm_autofdo | 9ecd435b55a3e58e1e3f71d478ff02c57840a900 | [
"Apache-2.0"
] | 4 | 2017-12-13T18:19:11.000Z | 2018-11-17T04:37:14.000Z | utils/lit/lit/llvm/config.py | kkeita/llvm_autofdo | 9ecd435b55a3e58e1e3f71d478ff02c57840a900 | [
"Apache-2.0"
] | 9 | 2019-06-11T06:15:44.000Z | 2022-03-07T16:34:50.000Z | import os
import platform
import re
import subprocess
import sys
import lit.util
from lit.llvm.subst import FindTool
from lit.llvm.subst import ToolSubst
def binary_feature(on, feature, off_prefix):
return feature if on else off_prefix + feature
class LLVMConfig(object):
def __init__(self, lit_config, con... | 45.457661 | 162 | 0.594802 |
f4835b298124d0d4a4049bada49833bdfcbf8e49 | 5,374 | py | Python | project_V1/core/test/test_view.py | arnabtarwani/UCD-MSc-Project | 3ab9a8fc0a092a8dd03099d1d5fa55eb127ef3dc | [
"MIT"
] | 1 | 2019-09-13T16:09:40.000Z | 2019-09-13T16:09:40.000Z | project_V1/core/test/test_view.py | arnabtarwani/Buddyup-ucd-msc-project | 3ab9a8fc0a092a8dd03099d1d5fa55eb127ef3dc | [
"MIT"
] | 9 | 2020-03-24T17:39:10.000Z | 2022-02-10T10:09:09.000Z | project_V1/core/test/test_view.py | arnabtarwani/UCD-MSc-Project | 3ab9a8fc0a092a8dd03099d1d5fa55eb127ef3dc | [
"MIT"
] | null | null | null | from django.test import TestCase,Client
from django.urls import reverse
from core.models import following,tweets_data,notification_data
from login.models import User_detail,Registration
class TestCoreViews(TestCase):
def test_twitter_check_3(self):
client=Client()
response=client.post(rever... | 28.737968 | 63 | 0.593599 |
7f19a8c27d2304f5964cf15aa930b9f08c7c016c | 23,170 | py | Python | sonorant/languagemodel.py | colinpollock/sonorous | a6a2792273f6962f7cc6f2814a0859373e945d78 | [
"MIT"
] | 2 | 2020-03-25T00:55:27.000Z | 2021-02-21T12:43:05.000Z | sonorant/languagemodel.py | colinpollock/sonorous | a6a2792273f6962f7cc6f2814a0859373e945d78 | [
"MIT"
] | 9 | 2020-03-02T22:24:17.000Z | 2020-03-06T01:09:03.000Z | sonorant/languagemodel.py | colinpollock/sonorous | a6a2792273f6962f7cc6f2814a0859373e945d78 | [
"MIT"
] | 1 | 2020-03-06T01:44:41.000Z | 2020-03-06T01:44:41.000Z | """A language model implemented in Torch.
The main class of interest is `LanguageModel`. It can be trained on a sequence of texts, where each
text is a tuple of tokens. This means that tokenization needs to happen before interacting with
LanguageModel. Below is a short walkthrough of everything you'd need from this cl... | 35.646154 | 99 | 0.629823 |
d2d6be629d7d8f647fe145678f7e56a35858f13f | 29,155 | py | Python | airflow/providers/amazon/aws/hooks/s3.py | Hartorn/airflow | a79e2d4c4aa105f3fac5ae6a28e29af9cd572407 | [
"Apache-2.0"
] | 1 | 2020-07-17T20:06:33.000Z | 2020-07-17T20:06:33.000Z | airflow/providers/amazon/aws/hooks/s3.py | Hartorn/airflow | a79e2d4c4aa105f3fac5ae6a28e29af9cd572407 | [
"Apache-2.0"
] | 37 | 2020-07-21T07:50:02.000Z | 2022-03-29T22:31:28.000Z | airflow/providers/amazon/aws/hooks/s3.py | vuppalli/airflow | dfe8337ca2d3ed173d9ecc112938271519792c40 | [
"Apache-2.0"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 37.1875 | 117 | 0.597873 |
75c111c58003b486bcee95d0672c44f12a8a3879 | 22,318 | py | Python | activity/activity_PubmedArticleDeposit.py | gnott/elife-bot | 584c315d15d1289e0d2c27c28aaaae31174812e4 | [
"MIT"
] | null | null | null | activity/activity_PubmedArticleDeposit.py | gnott/elife-bot | 584c315d15d1289e0d2c27c28aaaae31174812e4 | [
"MIT"
] | null | null | null | activity/activity_PubmedArticleDeposit.py | gnott/elife-bot | 584c315d15d1289e0d2c27c28aaaae31174812e4 | [
"MIT"
] | null | null | null | import os
import boto.swf
import json
import importlib
import time
import arrow
import glob
import re
import requests
from collections import namedtuple
import activity
import boto.s3
from boto.s3.connection import S3Connection
import provider.simpleDB as dblib
import provider.article as articlelib
import provider.s... | 34.547988 | 95 | 0.604803 |
1d36691ce9176f3881ac709c0adf792b41141b70 | 1,188 | py | Python | tests/unit_tests/cx_core/feature_support/cover_support_test.py | xaviml/z2m_ikea_controller | e612af5a913e8b4784dcaa23ea5319115427d083 | [
"MIT"
] | 19 | 2019-11-21T19:51:40.000Z | 2020-01-14T09:24:33.000Z | tests/unit_tests/cx_core/feature_support/cover_support_test.py | xaviml/z2m_ikea_controller | e612af5a913e8b4784dcaa23ea5319115427d083 | [
"MIT"
] | 11 | 2019-11-20T16:43:35.000Z | 2020-01-17T16:23:06.000Z | tests/unit_tests/cx_core/feature_support/cover_support_test.py | xaviml/z2m_ikea_controller | e612af5a913e8b4784dcaa23ea5319115427d083 | [
"MIT"
] | 5 | 2019-12-20T21:31:07.000Z | 2020-01-06T18:49:52.000Z | from typing import List
import pytest
from cx_core.feature_support import FeatureSupport
from cx_core.feature_support.cover import CoverSupport
from cx_core.type_controller import Entity, TypeController
@pytest.mark.parametrize(
"number, expected_supported_features",
[
(1, [CoverSupport.OPEN]),
... | 28.285714 | 77 | 0.633838 |
adbb3ed1566d69bf488ff890a247eea6b4cfb7a1 | 6,976 | py | Python | tests/client_tests/test_tw_preprocessor.py | unfoldingWord-dev/door43-job-handler | d26424810706875dd6eef33288900ea486de2e03 | [
"MIT"
] | null | null | null | tests/client_tests/test_tw_preprocessor.py | unfoldingWord-dev/door43-job-handler | d26424810706875dd6eef33288900ea486de2e03 | [
"MIT"
] | 66 | 2018-10-16T19:14:36.000Z | 2020-10-23T03:17:48.000Z | tests/client_tests/test_tw_preprocessor.py | unfoldingWord-dev/door43-job-handler | d26424810706875dd6eef33288900ea486de2e03 | [
"MIT"
] | null | null | null | import os
import tempfile
import unittest
import shutil
import markdown2
from bs4 import BeautifulSoup
from resource_container.ResourceContainer import RC
from preprocessors.preprocessors import do_preprocess, TwPreprocessor
from general_tools.file_utils import unzip, read_file
class TestTwPreprocessor(unittest.Tes... | 42.797546 | 273 | 0.623997 |
9716fe1e513dab725a3647d84f68843402e56038 | 14,961 | py | Python | tests/notifier/notifiers/inventory_summary_test.py | perambulist/forseti-security | 5b87bc536f3d33fdeaa0c2a1f20eea3f56c79060 | [
"Apache-2.0"
] | 1 | 2018-10-06T23:16:59.000Z | 2018-10-06T23:16:59.000Z | tests/notifier/notifiers/inventory_summary_test.py | perambulist/forseti-security | 5b87bc536f3d33fdeaa0c2a1f20eea3f56c79060 | [
"Apache-2.0"
] | null | null | null | tests/notifier/notifiers/inventory_summary_test.py | perambulist/forseti-security | 5b87bc536f3d33fdeaa0c2a1f20eea3f56c79060 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 44.263314 | 98 | 0.63211 |
68965ce7bd26f71e255dc78c1a8f151e11dd37c5 | 3,170 | py | Python | src/python/mlenv_cloud/core/validate.py | gogasca/mlenv | cacd66340d03c018989d5d4222cff4bc1d432336 | [
"Apache-2.0"
] | null | null | null | src/python/mlenv_cloud/core/validate.py | gogasca/mlenv | cacd66340d03c018989d5d4222cff4bc1d432336 | [
"Apache-2.0"
] | null | null | null | src/python/mlenv_cloud/core/validate.py | gogasca/mlenv | cacd66340d03c018989d5d4222cff4bc1d432336 | [
"Apache-2.0"
] | null | null | null | """Module that performs validations on the inputs to the `run` API."""
import os
from . import gcp
def validate(
entry_point,
requirements_txt,
entry_point_args,
docker_image_build_bucket,
called_from_notebook,
docker_parent_image=None,
):
"""Validates the inputs.
Args:
entry... | 34.835165 | 80 | 0.643218 |
10099ded7c39c3aba73fd13a209ff30e5ae05f6e | 7,200 | py | Python | kubernetes_asyncio/client/models/v1_deployment.py | opsani/kubernetes_asyncio | 55283bf6f3690e5c0a0c589cd752221511e2be51 | [
"Apache-2.0"
] | 196 | 2018-05-23T16:55:41.000Z | 2022-03-31T10:09:40.000Z | kubernetes_asyncio/client/models/v1_deployment.py | tomplus/kubernetes_asyncio | e8c8686ec11be3a5295ae9d5d8728299492a61f8 | [
"Apache-2.0"
] | 164 | 2018-05-20T20:39:03.000Z | 2022-03-29T22:57:04.000Z | kubernetes_asyncio/client/models/v1_deployment.py | opsani/kubernetes_asyncio | 55283bf6f3690e5c0a0c589cd752221511e2be51 | [
"Apache-2.0"
] | 41 | 2018-06-08T00:39:53.000Z | 2022-01-12T18:19:06.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.18.20
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
f... | 31.441048 | 312 | 0.613194 |
e8aa4b2667f6c9564d0304724946bfde284051e5 | 29,452 | py | Python | lora/dragino/MAChandler.py | hferentschik/balena-lora-node | 666fb6448aa27e9867538112067a84b88bf105b7 | [
"MIT"
] | null | null | null | lora/dragino/MAChandler.py | hferentschik/balena-lora-node | 666fb6448aa27e9867538112067a84b88bf105b7 | [
"MIT"
] | null | null | null | lora/dragino/MAChandler.py | hferentschik/balena-lora-node | 666fb6448aa27e9867538112067a84b88bf105b7 | [
"MIT"
] | null | null | null | """
MAChandler.py
Handles MAC commands sent by the server.
responses are placed in a list of tuples
when the responses are required to add to an uplink
the responses are converted to a bytearray
The array of responses is cleared after reading
All attributes are cached when the class is deleted
and reloaded when it ... | 31.874459 | 127 | 0.595002 |
d3c968e8b49632a4e3441904c5c6034e7c8d8dc3 | 14,965 | py | Python | hdf5_dataio.py | HaoRiziyou/light-field-networks | 438c198dc024b1a90f5d98d5c1e6cde078de2ec0 | [
"MIT"
] | 95 | 2021-12-10T03:29:41.000Z | 2022-03-28T08:19:17.000Z | hdf5_dataio.py | HaoRiziyou/light-field-networks | 438c198dc024b1a90f5d98d5c1e6cde078de2ec0 | [
"MIT"
] | 4 | 2021-12-26T05:07:20.000Z | 2022-03-08T18:31:30.000Z | hdf5_dataio.py | HaoRiziyou/light-field-networks | 438c198dc024b1a90f5d98d5c1e6cde078de2ec0 | [
"MIT"
] | 14 | 2021-12-10T10:50:18.000Z | 2022-03-02T05:05:06.000Z | import cv2
import os
import torch
import numpy as np
from glob import glob
import data_util
import util
from collections import defaultdict
import h5py
class SceneInstanceDataset(torch.utils.data.Dataset):
"""This creates a dataset class for a single object instance (such as a single car)."""
def __init__(se... | 43.126801 | 120 | 0.596191 |
231f5fd62e7e3dc1e5d85cfdb3d69af1005b902a | 18,669 | py | Python | qiskit/quantum_info/operators/pauli.py | yeralin/qiskit-terra | 251930a7b5d83af121ea0f3aafb33a54a1860e14 | [
"Apache-2.0"
] | 1 | 2019-06-04T12:23:36.000Z | 2019-06-04T12:23:36.000Z | qiskit/quantum_info/operators/pauli.py | yeralin/qiskit-terra | 251930a7b5d83af121ea0f3aafb33a54a1860e14 | [
"Apache-2.0"
] | 35 | 2019-03-07T02:09:22.000Z | 2022-03-22T19:55:15.000Z | qiskit/quantum_info/operators/pauli.py | yeralin/qiskit-terra | 251930a7b5d83af121ea0f3aafb33a54a1860e14 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 31.967466 | 96 | 0.543575 |
e05bd34e3280f4ccad9b50190596b94167fb87ab | 2,240 | py | Python | API License Inventory by Project.py | philipckk/Black-Duck-API | d666ca3717ce9ae8407841ce52e74ff1691a6c27 | [
"Apache-2.0"
] | null | null | null | API License Inventory by Project.py | philipckk/Black-Duck-API | d666ca3717ce9ae8407841ce52e74ff1691a6c27 | [
"Apache-2.0"
] | null | null | null | API License Inventory by Project.py | philipckk/Black-Duck-API | d666ca3717ce9ae8407841ce52e74ff1691a6c27 | [
"Apache-2.0"
] | 1 | 2022-02-23T14:47:50.000Z | 2022-02-23T14:47:50.000Z | from blackduck import Client
import logging
import re
import os
from collections import Counter
import csv
logging.basicConfig(
level=logging.INFO,
format="[%(asctime)s] {%(module)s:%(lineno)d} %(levelname)s - %(message)s"
)
# Please modify the token and base_url
bd = Client(
token=os.environ.get('blackdu... | 33.939394 | 93 | 0.6375 |
170e99a5d448b688e45e486b6b9ea88a518dc30b | 6,334 | py | Python | sdk/python/pulumi_azure_native/apimanagement/v20180601preview/get_diagnostic.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/apimanagement/v20180601preview/get_diagnostic.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/apimanagement/v20180601preview/get_diagnostic.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # 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, overload
from ... import _utilities
fro... | 36.402299 | 173 | 0.657089 |
9de0d72f441b1ba7956109aeb88704ba8062f4b8 | 2,511 | py | Python | ravendb/tests/raven_commands_tests/test_get_by_prefix.py | ravendb/RavenDB-Python-Client | 6286b459b501e755fe8e8591a48acf8616605ccd | [
"MIT"
] | 8 | 2016-10-08T17:45:44.000Z | 2018-05-29T12:16:43.000Z | ravendb/tests/raven_commands_tests/test_get_by_prefix.py | ravendb/RavenDB-Python-Client | 6286b459b501e755fe8e8591a48acf8616605ccd | [
"MIT"
] | 5 | 2017-02-12T15:50:53.000Z | 2017-09-18T12:25:01.000Z | ravendb/tests/raven_commands_tests/test_get_by_prefix.py | ravendb/RavenDB-Python-Client | 6286b459b501e755fe8e8591a48acf8616605ccd | [
"MIT"
] | 8 | 2016-07-03T07:59:12.000Z | 2017-09-18T11:22:23.000Z | import unittest
from ravendb.documents.commands.crud import PutDocumentCommand, GetDocumentsCommand
from ravendb.tests.test_base import TestBase
class TestGetDocumentsByPrefixCommand(TestBase):
def setUp(self):
super(TestGetDocumentsByPrefixCommand, self).setUp()
self.requests_executor = self.sto... | 38.630769 | 116 | 0.650737 |
1733c8f096f882117e25f55217630d2aae45b5f3 | 447 | py | Python | connect_to_chat.py | sleamey/underground-chat | 77a06c23c249f1bec91fb740b9de9724ebe0cd50 | [
"MIT"
] | null | null | null | connect_to_chat.py | sleamey/underground-chat | 77a06c23c249f1bec91fb740b9de9724ebe0cd50 | [
"MIT"
] | null | null | null | connect_to_chat.py | sleamey/underground-chat | 77a06c23c249f1bec91fb740b9de9724ebe0cd50 | [
"MIT"
] | null | null | null | from contextlib import asynccontextmanager
import asyncio
from asyncio import StreamReader, StreamWriter
from typing import AsyncContextManager
@asynccontextmanager
async def get_chat_connection(host: str, port: int) -> AsyncContextManager[(StreamReader, StreamWriter)]:
reader, writer = await asyncio.open_connec... | 26.294118 | 105 | 0.756152 |
efdaebead40b3a0c80b781959f00538d4f3c72cc | 32,150 | py | Python | app.py | JGX020/picture-search-talk | ae264eed9b5d4ba08006284dedf9b8cbfcd46037 | [
"MIT"
] | 2 | 2016-03-03T05:58:04.000Z | 2017-01-26T09:58:32.000Z | app.py | JGX020/picture-search-talk | ae264eed9b5d4ba08006284dedf9b8cbfcd46037 | [
"MIT"
] | 2 | 2016-03-01T01:13:46.000Z | 2016-03-03T04:09:05.000Z | app.py | JGX020/picture-search-talk | ae264eed9b5d4ba08006284dedf9b8cbfcd46037 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sqlite3
import os
import uuid
import histsimilar
import client
import time
import datetime
import random
import textreplace
import json
import dygeneratehtml
import geo
from flask import Flask, render_template,session, g,abort,flash, request, redirect, url_for, \
se... | 68.843683 | 953 | 0.66479 |
37c94c164297fb7178f10c4d22b15558d35a18be | 435 | py | Python | reviews/migrations/0033_auto_20200131_1613.py | UrbanBogger/horrorexplosion | 3698e00a6899a5e8b224cd3d1259c3deb3a2ca80 | [
"MIT"
] | null | null | null | reviews/migrations/0033_auto_20200131_1613.py | UrbanBogger/horrorexplosion | 3698e00a6899a5e8b224cd3d1259c3deb3a2ca80 | [
"MIT"
] | 4 | 2020-06-05T18:21:18.000Z | 2021-06-10T20:17:31.000Z | reviews/migrations/0033_auto_20200131_1613.py | UrbanBogger/horrorexplosion | 3698e00a6899a5e8b224cd3d1259c3deb3a2ca80 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2020-01-31 16:13
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('reviews', '0032_auto_20200126_1743'),
]
operations = [
migrations.AlterModelOptions... | 21.75 | 59 | 0.632184 |
e792e18d2e05526f941750851ab8789b75aef55b | 400 | py | Python | project_name/wsgi.py | julianwachholz/django-headstart | e7ab84d914dd952545aed567092e72c511b09535 | [
"MIT"
] | null | null | null | project_name/wsgi.py | julianwachholz/django-headstart | e7ab84d914dd952545aed567092e72c511b09535 | [
"MIT"
] | null | null | null | project_name/wsgi.py | julianwachholz/django-headstart | e7ab84d914dd952545aed567092e72c511b09535 | [
"MIT"
] | null | null | null | """
WSGI config for project 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/dev/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings")
from dj... | 26.666667 | 78 | 0.7825 |
c31f39dd23d35b335b42bd925accae8430b539b8 | 32 | py | Python | tests/unit/providers/singleton/__init__.py | YelloFam/python-dependency-injector | 541131e33858ee1b8b5a7590d2bb9f929740ea1e | [
"BSD-3-Clause"
] | null | null | null | tests/unit/providers/singleton/__init__.py | YelloFam/python-dependency-injector | 541131e33858ee1b8b5a7590d2bb9f929740ea1e | [
"BSD-3-Clause"
] | null | null | null | tests/unit/providers/singleton/__init__.py | YelloFam/python-dependency-injector | 541131e33858ee1b8b5a7590d2bb9f929740ea1e | [
"BSD-3-Clause"
] | null | null | null | """Singleton provider tests."""
| 16 | 31 | 0.6875 |
077d812feffb19b7e995a849c3713e11697e3ef1 | 6,125 | py | Python | oba/check_attendance.py | philip-baker/engage | dbc4c3278db07fd3b4c678af337a59ab3c319b55 | [
"MIT"
] | null | null | null | oba/check_attendance.py | philip-baker/engage | dbc4c3278db07fd3b4c678af337a59ab3c319b55 | [
"MIT"
] | null | null | null | oba/check_attendance.py | philip-baker/engage | dbc4c3278db07fd3b4c678af337a59ab3c319b55 | [
"MIT"
] | null | null | null | """Documentation for build_system.py
This script is part of the OBA (Out-of-the-Box-Attendance) it has been designed to be used on a daily basis for a given course. As an input it will
look for an image (named sample.jpg), which if it cannot find it will prompt the user to take an image using any camera attache... | 37.576687 | 155 | 0.722776 |
4a9ff274e405a4c8906cc25a45dea14b61a09ae2 | 252 | py | Python | aula1/erros.py | ricMuehlbauer/curso-flask | 530c8d33cdb62cfaf98ad05c2ee87d8bc301a4b6 | [
"Unlicense"
] | null | null | null | aula1/erros.py | ricMuehlbauer/curso-flask | 530c8d33cdb62cfaf98ad05c2ee87d8bc301a4b6 | [
"Unlicense"
] | null | null | null | aula1/erros.py | ricMuehlbauer/curso-flask | 530c8d33cdb62cfaf98ad05c2ee87d8bc301a4b6 | [
"Unlicense"
] | null | null | null | a = 0
b = 10
# EAFP - Easy to access forgiveness before permission
try:
print(b / a)
except AttributeError as e:
print("Nao posso transformar n em maiusculo", str(e))
except ZeroDivisionError as e:
print("Deu erro, tenta de novo", str(e)) | 22.909091 | 57 | 0.690476 |
b23f386d11a3556e850098413cf5f78974e69e46 | 4,434 | py | Python | nn_dataflow/tools/nn_layer_stats.py | Pingziwalk/nn_dataflow | 5ae8eeba4e243df6e9a69127073513a852a62d17 | [
"BSD-3-Clause"
] | null | null | null | nn_dataflow/tools/nn_layer_stats.py | Pingziwalk/nn_dataflow | 5ae8eeba4e243df6e9a69127073513a852a62d17 | [
"BSD-3-Clause"
] | null | null | null | nn_dataflow/tools/nn_layer_stats.py | Pingziwalk/nn_dataflow | 5ae8eeba4e243df6e9a69127073513a852a62d17 | [
"BSD-3-Clause"
] | null | null | null | """ $lic$
Copyright (C) 2016-2020 by Tsinghua University and The Board of Trustees of
Stanford University
This program is free software: you can redistribute it and/or modify it under
the terms of the Modified BSD-3 License as published by the Open Source
Initiative.
This program is distributed in the hope that it wi... | 31.899281 | 79 | 0.59585 |
564d351e0e4eec58b5401240b62cee6ab15ba035 | 572 | py | Python | examples/notepad/notepad/__init__.py | SunChuquin/pyqode.core | edf29204446e3679701e74343288cf692eb07d86 | [
"MIT"
] | 23 | 2015-01-08T15:04:47.000Z | 2022-03-08T07:47:08.000Z | examples/notepad/notepad/__init__.py | SunChuquin/pyqode.core | edf29204446e3679701e74343288cf692eb07d86 | [
"MIT"
] | 16 | 2021-02-01T08:54:08.000Z | 2022-01-09T10:23:57.000Z | examples/notepad/notepad/__init__.py | SunChuquin/pyqode.core | edf29204446e3679701e74343288cf692eb07d86 | [
"MIT"
] | 24 | 2015-01-09T14:16:41.000Z | 2021-12-06T15:11:22.000Z | # -*- coding: utf-8 -*-
"""
This package contains the code of the notepad application:
- editor: contains our custom CodeEdit class definition. This is just
a CodeEdit configured with a set of modes and panels.
- main_window: This is the main window of the application
- server.py: This is the server ... | 22.88 | 73 | 0.702797 |
f03305d66ef3a208b36f389bd466786221365fee | 723 | py | Python | DB/DAO/user.py | jaelyangChoi/ICO | e816a0d050cc2906caf71d2abfa6a04d438ed5b4 | [
"MIT"
] | null | null | null | DB/DAO/user.py | jaelyangChoi/ICO | e816a0d050cc2906caf71d2abfa6a04d438ed5b4 | [
"MIT"
] | null | null | null | DB/DAO/user.py | jaelyangChoi/ICO | e816a0d050cc2906caf71d2abfa6a04d438ed5b4 | [
"MIT"
] | null | null | null | from DAO.sqlExecution import *
from DTO.user import *
from SQL.user import UserSQL as SQL
class UserDAO(SqlExecution):
def select_user_by_email(self, email):
try:
conn = self.db_conn.get_connection()
cursor = conn.cursor()
cursor.execute(SQL.SELECT_USER, email)
... | 24.1 | 72 | 0.576763 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.