hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | 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 245 | max_issues_repo_name stringlengths 6 130 | 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 245 | max_forks_repo_name stringlengths 6 130 | 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 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
790480b08ad84d4d056648aa9b8a63969feccabf | 1,210 | py | Python | airflow/contrib/operators/emr_add_steps_operator.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | 5 | 2020-07-17T07:33:58.000Z | 2022-03-02T06:23:47.000Z | airflow/contrib/operators/emr_add_steps_operator.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | 7 | 2020-06-03T14:55:17.000Z | 2021-12-30T00:01:50.000Z | airflow/contrib/operators/emr_add_steps_operator.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | 12 | 2020-01-09T14:02:39.000Z | 2022-01-24T07:18:51.000Z | # -*- 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
#... | 40.333333 | 100 | 0.771074 |
import warnings
from airflow.providers.amazon.aws.operators.emr_add_steps import EmrAddStepsOperator
warnings.warn(
"This module is deprecated. Please use `airflow.providers.amazon.aws.operators.emr_add_steps`.",
DeprecationWarning, stacklevel=2
)
| true | true |
790481128cb623ac28c14ca0b8a50b9b7f8bc3c8 | 17,980 | py | Python | test/test_formats_geotiff.py | Scartography/mapchete | f7d1a74acb4021adfd3053501416d2b974c40af9 | [
"MIT"
] | null | null | null | test/test_formats_geotiff.py | Scartography/mapchete | f7d1a74acb4021adfd3053501416d2b974c40af9 | [
"MIT"
] | null | null | null | test/test_formats_geotiff.py | Scartography/mapchete | f7d1a74acb4021adfd3053501416d2b974c40af9 | [
"MIT"
] | null | null | null | """Test GeoTIFF as process output."""
import numpy as np
import numpy.ma as ma
import os
import pytest
import rasterio
from rasterio.io import MemoryFile
from rio_cogeo.cogeo import cog_validate
import shutil
from tilematrix import Bounds
import warnings
import mapchete
from mapchete.errors import MapcheteConfigError... | 36.396761 | 86 | 0.628699 |
import numpy as np
import numpy.ma as ma
import os
import pytest
import rasterio
from rasterio.io import MemoryFile
from rio_cogeo.cogeo import cog_validate
import shutil
from tilematrix import Bounds
import warnings
import mapchete
from mapchete.errors import MapcheteConfigError
from mapchete.io import path_exists
f... | true | true |
790481acff9e1f94ef5f8e798b0cdd6ecbc4e28a | 5,863 | py | Python | docs/conf.py | C-Pauli/cob | 88b9c4f9206f09dec446885485a73cdf2b366379 | [
"MIT"
] | 2 | 2016-09-28T15:21:04.000Z | 2017-02-21T19:56:47.000Z | docs/conf.py | C-Pauli/cob | 88b9c4f9206f09dec446885485a73cdf2b366379 | [
"MIT"
] | 67 | 2016-05-17T16:30:14.000Z | 2017-08-06T23:11:51.000Z | docs/conf.py | C-Pauli/cob | 88b9c4f9206f09dec446885485a73cdf2b366379 | [
"MIT"
] | 5 | 2018-09-28T21:45:10.000Z | 2019-08-16T03:20:16.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# cob documentation build configuration file, created by
# sphinx-quickstart on Sun Jan 7 18:09:10 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autoge... | 30.378238 | 79 | 0.683268 |
extensions = [
'sphinxcontrib.programoutput',
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.githubpa... | true | true |
7904834425721460d9dbad64646007bec03538a2 | 14,823 | py | Python | generator_labeler/paper_results/custom_plots.py | researchuser7/QWAugmenter | eb70fa27ddb4b90d72c2eae6db2ff65086c3fb69 | [
"MIT"
] | null | null | null | generator_labeler/paper_results/custom_plots.py | researchuser7/QWAugmenter | eb70fa27ddb4b90d72c2eae6db2ff65086c3fb69 | [
"MIT"
] | null | null | null | generator_labeler/paper_results/custom_plots.py | researchuser7/QWAugmenter | eb70fa27ddb4b90d72c2eae6db2ff65086c3fb69 | [
"MIT"
] | 1 | 2022-02-28T04:45:16.000Z | 2022-02-28T04:45:16.000Z | import numpy as np
from sklearn.metrics import r2_score
np.random.seed(42)
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
figsize = (8, 4)
def show_r2(results):
data_size = results["data_size"]
test_scores = results["test_scores"]
test_scores_exp = results["test_scores_exp"]
... | 38.203608 | 208 | 0.644134 | import numpy as np
from sklearn.metrics import r2_score
np.random.seed(42)
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
figsize = (8, 4)
def show_r2(results):
data_size = results["data_size"]
test_scores = results["test_scores"]
test_scores_exp = results["test_scores_exp"]
... | true | true |
790483b9c92a0a5f9653f2bd70aead4cdd719e0e | 1,292 | py | Python | src/azure-cli/azure/cli/command_modules/iotcentral/commands.py | psignoret/azure-cli | 1a4a043750315f9a7f2894b4287126089978b615 | [
"MIT"
] | 1 | 2020-12-14T15:30:11.000Z | 2020-12-14T15:30:11.000Z | src/azure-cli/azure/cli/command_modules/iotcentral/commands.py | psignoret/azure-cli | 1a4a043750315f9a7f2894b4287126089978b615 | [
"MIT"
] | 4 | 2018-08-08T20:01:17.000Z | 2018-09-17T15:20:06.000Z | src/azure-cli/azure/cli/command_modules/iotcentral/commands.py | psignoret/azure-cli | 1a4a043750315f9a7f2894b4287126089978b615 | [
"MIT"
] | 1 | 2020-12-22T00:28:33.000Z | 2020-12-22T00:28:33.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 46.142857 | 110 | 0.632353 |
from ._client_factory import iotcentral_service_factory
def load_command_table(self, _):
from azure.cli.core.commands import CliCommandType
iotcentral_sdk = CliCommandType(
operations_tmpl='azure.mgmt.iotcentral.operations#IoTCentaralOperations.{}'
)
update_custom_util = CliCommandTyp... | true | true |
790484439b56f027dc2766ba8658b9d6b786dec3 | 8,045 | py | Python | pyzoo/test/zoo/chronos/model/forecast/test_lstm_forecaster.py | DiegoCao/analytics-zoo | 31a7c8acee38053b6bb20ccb4dc02f06d1d58900 | [
"Apache-2.0"
] | null | null | null | pyzoo/test/zoo/chronos/model/forecast/test_lstm_forecaster.py | DiegoCao/analytics-zoo | 31a7c8acee38053b6bb20ccb4dc02f06d1d58900 | [
"Apache-2.0"
] | null | null | null | pyzoo/test/zoo/chronos/model/forecast/test_lstm_forecaster.py | DiegoCao/analytics-zoo | 31a7c8acee38053b6bb20ccb4dc02f06d1d58900 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2018 Analytics Zoo 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... | 40.631313 | 97 | 0.595649 |
import numpy as np
import tempfile
import os
import torch
from zoo.chronos.model.forecast.lstm_forecaster import LSTMForecaster
from zoo.orca import init_orca_context, stop_orca_context
from unittest import TestCase
import pytest
def create_data():
num_train_samples = 1000
num_val_samples = 4... | true | true |
79048490556fde1b61605b3bb2be4bfa21cfe9d0 | 2,046 | py | Python | src/spaceone/inventory/api/v1/network_type.py | choonho/inventory | cc89757490d28fecb7ffccdfd6f89d4c0aa40da5 | [
"Apache-2.0"
] | null | null | null | src/spaceone/inventory/api/v1/network_type.py | choonho/inventory | cc89757490d28fecb7ffccdfd6f89d4c0aa40da5 | [
"Apache-2.0"
] | null | null | null | src/spaceone/inventory/api/v1/network_type.py | choonho/inventory | cc89757490d28fecb7ffccdfd6f89d4c0aa40da5 | [
"Apache-2.0"
] | null | null | null | from spaceone.api.inventory.v1 import network_type_pb2, network_type_pb2_grpc
from spaceone.core.pygrpc import BaseAPI
class NetworkType(BaseAPI, network_type_pb2_grpc.NetworkTypeServicer):
pb2 = network_type_pb2
pb2_grpc = network_type_pb2_grpc
def create(self, request, context):
params, metada... | 43.531915 | 118 | 0.726784 | from spaceone.api.inventory.v1 import network_type_pb2, network_type_pb2_grpc
from spaceone.core.pygrpc import BaseAPI
class NetworkType(BaseAPI, network_type_pb2_grpc.NetworkTypeServicer):
pb2 = network_type_pb2
pb2_grpc = network_type_pb2_grpc
def create(self, request, context):
params, metada... | true | true |
790488091f13f4b2ff427e7b9bda7aa18b0d732c | 1,391 | py | Python | misc/style/check-include-guard-convention.py | nitinkaveriappa/downward | 5c9a1b5111d667bb96f94da61ca2a45b1b70bb83 | [
"MIT"
] | 4 | 2019-04-23T10:41:35.000Z | 2019-10-27T05:14:42.000Z | misc/style/check-include-guard-convention.py | nitinkaveriappa/downward | 5c9a1b5111d667bb96f94da61ca2a45b1b70bb83 | [
"MIT"
] | null | null | null | misc/style/check-include-guard-convention.py | nitinkaveriappa/downward | 5c9a1b5111d667bb96f94da61ca2a45b1b70bb83 | [
"MIT"
] | 4 | 2018-01-16T00:00:22.000Z | 2019-11-01T23:35:01.000Z | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import glob
import os.path
import sys
DIR = os.path.dirname(os.path.abspath(__file__))
REPO = os.path.dirname(os.path.dirname(DIR))
SRC_DIR = os.path.join(REPO, "src")
def check_header_files(component):
component_dir = os.path... | 28.979167 | 90 | 0.591661 |
from __future__ import print_function
import glob
import os.path
import sys
DIR = os.path.dirname(os.path.abspath(__file__))
REPO = os.path.dirname(os.path.dirname(DIR))
SRC_DIR = os.path.join(REPO, "src")
def check_header_files(component):
component_dir = os.path.join(SRC_DIR, component)
header_files = ... | true | true |
7904885b0ba56ba64b7a2d57ff185fb7cd178af8 | 827 | py | Python | backend/unikernel/osv/__init__.py | ShengliangD/Cunik-engine | 1951d20629fc3cbbe0047ee04b438bbe91adc44c | [
"MIT"
] | 31 | 2018-05-17T01:54:46.000Z | 2019-08-22T02:55:58.000Z | backend/unikernel/osv/__init__.py | ShengliangD/Cunik-engine | 1951d20629fc3cbbe0047ee04b438bbe91adc44c | [
"MIT"
] | 1 | 2018-07-06T11:33:31.000Z | 2018-07-17T10:08:15.000Z | backend/unikernel/osv/__init__.py | ShengliangD/Cunik-engine | 1951d20629fc3cbbe0047ee04b438bbe91adc44c | [
"MIT"
] | 7 | 2018-06-08T08:35:11.000Z | 2018-07-07T09:16:32.000Z | """Implements interface for OSv unikernels."""
from backend.vm import VMConfig
from os import path
from .imgedit import set_cmdline
class OSv:
cmdline_template = "--ip=eth0,{ipv4_addr},255.255.255.0 --nameserver=10.0.125.0 {extra_cmdline}"
@staticmethod
def configure(image, config, nic_name):
c... | 29.535714 | 100 | 0.634825 |
from backend.vm import VMConfig
from os import path
from .imgedit import set_cmdline
class OSv:
cmdline_template = "--ip=eth0,{ipv4_addr},255.255.255.0 --nameserver=10.0.125.0 {extra_cmdline}"
@staticmethod
def configure(image, config, nic_name):
cmdline = OSv.cmdline_template.format(
... | true | true |
790489aa109a3810fa6f0d208b39f83eb3d71525 | 1,688 | py | Python | kite/venv/lib/python3.7/site-packages/bs4/tests/test_htmlparser.py | pxuanqui/Edge-Assisted-Cart | 2edd1f7023ab0b02f5733e2e9204bac4623eeeac | [
"BSD-3-Clause"
] | 27 | 2019-10-28T05:03:18.000Z | 2021-06-09T00:16:22.000Z | kite/venv/lib/python3.7/site-packages/bs4/tests/test_htmlparser.py | pxuanqui/Edge-Assisted-Cart | 2edd1f7023ab0b02f5733e2e9204bac4623eeeac | [
"BSD-3-Clause"
] | 47 | 2018-11-16T19:18:01.000Z | 2021-12-01T19:40:44.000Z | virtual/lib/python3.6/site-packages/bs4/tests/test_htmlparser.py | catherine244/Reviews | 30138f5ad09a39c1b6866c8bacf3fd0c89abbd00 | [
"MIT"
] | 9 | 2019-11-02T06:44:18.000Z | 2021-11-08T11:46:19.000Z | """Tests to ensure that the html.parser tree builder generates good
trees."""
from pdb import set_trace
import pickle
from bs4.testing import SoupTest, HTMLTreeBuilderSmokeTest
from bs4.builder import HTMLParserTreeBuilder
from bs4.builder._htmlparser import BeautifulSoupHTMLParser
class HTMLParserTreeBuilderSmokeTes... | 35.166667 | 79 | 0.690758 |
from pdb import set_trace
import pickle
from bs4.testing import SoupTest, HTMLTreeBuilderSmokeTest
from bs4.builder import HTMLParserTreeBuilder
from bs4.builder._htmlparser import BeautifulSoupHTMLParser
class HTMLParserTreeBuilderSmokeTest(SoupTest, HTMLTreeBuilderSmokeTest):
default_builder = HTMLParserTreeBu... | true | true |
79048bb09489ee4abba8f5a07e9432d46f3ca509 | 9,832 | py | Python | apps/Graph4KG/utils.py | LemonNoel/PGL | c12357b66a105b10dd5a1f034fa21008f053d0f0 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | apps/Graph4KG/utils.py | LemonNoel/PGL | c12357b66a105b10dd5a1f034fa21008f053d0f0 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | apps/Graph4KG/utils.py | LemonNoel/PGL | c12357b66a105b10dd5a1f034fa21008f053d0f0 | [
"ECL-2.0",
"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... | 34.989324 | 87 | 0.54465 |
import os
import csv
import math
import json
import time
import random
import logging
import functools
import traceback
from collections import defaultdict
from _thread import start_new_thread
from multiprocessing import Queue, Process
import numpy as np
from tqdm import tqdm
import paddle
import paddle.... | true | true |
79048c6c7c8173928958eb3dfb4ea531ee1fa52d | 54 | py | Python | script.py | Delightkc/fosslab | 19eaf6f00623a54a09b51f3c31e8e6a9dfb3dbe7 | [
"MIT"
] | null | null | null | script.py | Delightkc/fosslab | 19eaf6f00623a54a09b51f3c31e8e6a9dfb3dbe7 | [
"MIT"
] | null | null | null | script.py | Delightkc/fosslab | 19eaf6f00623a54a09b51f3c31e8e6a9dfb3dbe7 | [
"MIT"
] | 1 | 2020-10-17T09:48:19.000Z | 2020-10-17T09:48:19.000Z |
n=input("My Name is Delight Kurian Chandy")
print(n)
| 13.5 | 43 | 0.722222 |
n=input("My Name is Delight Kurian Chandy")
print(n)
| true | true |
79048c75af6e117359e7d8fac15f4339dc33aadb | 32,423 | py | Python | admin.py | SpatialStrout/ago-tools | 6dd3726792d390fff5fa7fe7556a29305c3055e9 | [
"Apache-2.0"
] | null | null | null | admin.py | SpatialStrout/ago-tools | 6dd3726792d390fff5fa7fe7556a29305c3055e9 | [
"Apache-2.0"
] | null | null | null | admin.py | SpatialStrout/ago-tools | 6dd3726792d390fff5fa7fe7556a29305c3055e9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import urllib,urllib2
import json
import csv
import time
from datetime import date, timedelta
class Admin:
'''A class of tools for administering AGO Orgs or Portals'''
def __init__(self, username, portal=None, password=None):
from . import User
self.user = User(username,... | 41.250636 | 547 | 0.559603 |
import urllib,urllib2
import json
import csv
import time
from datetime import date, timedelta
class Admin:
'''A class of tools for administering AGO Orgs or Portals'''
def __init__(self, username, portal=None, password=None):
from . import User
self.user = User(username, portal, password)
... | false | true |
79048c941ac0e16854fa97bd02fbab176bf74c74 | 171 | py | Python | apps/course/apps.py | wyftddev/MXOline | b0353d57fd91851088486e7caf18d9db706c113c | [
"Apache-2.0"
] | null | null | null | apps/course/apps.py | wyftddev/MXOline | b0353d57fd91851088486e7caf18d9db706c113c | [
"Apache-2.0"
] | null | null | null | apps/course/apps.py | wyftddev/MXOline | b0353d57fd91851088486e7caf18d9db706c113c | [
"Apache-2.0"
] | null | null | null | #encoding=utf-8
from __future__ import unicode_literals
from django.apps import AppConfig
class CourseConfig(AppConfig):
name = 'course'
verbose_name = u"课程管理"
| 17.1 | 39 | 0.760234 |
from __future__ import unicode_literals
from django.apps import AppConfig
class CourseConfig(AppConfig):
name = 'course'
verbose_name = u"课程管理"
| true | true |
79048cff42ce750f3a33344f76f2a01c5367ca07 | 485 | py | Python | wargame/designpatterns/pythonic_orcfighter.py | jeantardelli/wargameRepo | 1e11ae40281f7eafa65ea6e40e045304b20e3824 | [
"MIT"
] | 1 | 2020-12-01T20:30:27.000Z | 2020-12-01T20:30:27.000Z | wargame/designpatterns/pythonic_orcfighter.py | jeantardelli/wargameRepo | 1e11ae40281f7eafa65ea6e40e045304b20e3824 | [
"MIT"
] | null | null | null | wargame/designpatterns/pythonic_orcfighter.py | jeantardelli/wargameRepo | 1e11ae40281f7eafa65ea6e40e045304b20e3824 | [
"MIT"
] | null | null | null | """pythonic_orcfighter
This is one of the different GameUnits that are used in the desing patterns examples.
:copyright: 2020, Jean Tardelli
:license: The MIT license (MIT). See LICENSE file for further details.
"""
from pythonic_abstractgameunit import AbstractGameUnit
class OrcFighter(AbstractGameUnit):
"""Cr... | 30.3125 | 85 | 0.736082 | from pythonic_abstractgameunit import AbstractGameUnit
class OrcFighter(AbstractGameUnit):
def info(self):
print("Grrr, I am the Orc Figher!")
| true | true |
79048ec7a7c5aab851a0a8ff50a5e9a9d1fabda0 | 10,620 | py | Python | python_modules/dagster/dagster_tests/daemon_tests/test_queued_run_coordinator_daemon.py | keypointt/dagster | 45683a29cbe2429d4e538254fac9498198f53879 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster_tests/daemon_tests/test_queued_run_coordinator_daemon.py | keypointt/dagster | 45683a29cbe2429d4e538254fac9498198f53879 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster_tests/daemon_tests/test_queued_run_coordinator_daemon.py | keypointt/dagster | 45683a29cbe2429d4e538254fac9498198f53879 | [
"Apache-2.0"
] | null | null | null | # pylint: disable=redefined-outer-name
import pytest
from dagster.core.code_pointer import ModuleCodePointer
from dagster.core.definitions.reconstructable import ReconstructableRepository
from dagster.core.host_representation.grpc_server_registry import ProcessGrpcServerRegistry
from dagster.core.host_representation.h... | 28.32 | 100 | 0.655932 |
import pytest
from dagster.core.code_pointer import ModuleCodePointer
from dagster.core.definitions.reconstructable import ReconstructableRepository
from dagster.core.host_representation.grpc_server_registry import ProcessGrpcServerRegistry
from dagster.core.host_representation.handle import GrpcServerRepositoryLocat... | true | true |
79048f6cdfe5cc3626aeccb151685edee36e7c84 | 11,127 | py | Python | src/canmatrix/tests/test_sym.py | tainnok/canmatrix | 4c785a405c9713cd0f6709c2d1634eee5cebfde8 | [
"BSD-2-Clause"
] | 1 | 2020-12-07T13:16:47.000Z | 2020-12-07T13:16:47.000Z | src/canmatrix/tests/test_sym.py | motorctl/canmatrix | 5b2b43b472c8d8304ea7c09fe497cc0cdd109db3 | [
"BSD-2-Clause"
] | null | null | null | src/canmatrix/tests/test_sym.py | motorctl/canmatrix | 5b2b43b472c8d8304ea7c09fe497cc0cdd109db3 | [
"BSD-2-Clause"
] | 1 | 2020-11-18T00:05:43.000Z | 2020-11-18T00:05:43.000Z | # -*- coding: utf-8 -*-
import io
import sys
import textwrap
from itertools import chain
from pprint import pprint
import pytest
import canmatrix.canmatrix
import canmatrix.formats.sym
def test_colliding_mux_values():
f = io.BytesIO(
textwrap.dedent(
'''\
FormatVersion=5.0 // Do ... | 27.8175 | 119 | 0.560528 |
import io
import sys
import textwrap
from itertools import chain
from pprint import pprint
import pytest
import canmatrix.canmatrix
import canmatrix.formats.sym
def test_colliding_mux_values():
f = io.BytesIO(
textwrap.dedent(
'''\
FormatVersion=5.0 // Do not edit this line!
... | true | true |
79048f8e29eab4293238d092bc3249ac9d44c7ce | 52 | py | Python | __init__.py | rahulk90/vae_sparse | 102b3cf72abae8d66718b945df365edd4a23a62d | [
"MIT"
] | 11 | 2017-11-16T13:01:47.000Z | 2021-12-26T20:07:24.000Z | __init__.py | rahulk90/inference_introspection | 102b3cf72abae8d66718b945df365edd4a23a62d | [
"MIT"
] | null | null | null | __init__.py | rahulk90/inference_introspection | 102b3cf72abae8d66718b945df365edd4a23a62d | [
"MIT"
] | null | null | null | all=['optvaedatasets','optvaemodels','optvaeutils']
| 26 | 51 | 0.769231 | all=['optvaedatasets','optvaemodels','optvaeutils']
| true | true |
79048f9e76a4e94fce44343cd6e4dadc399df71d | 689 | py | Python | lnbits/extensions/satspay/migrations.py | lightningames/lnbits | 63d7431898f9ab79522765dbb29c8a2fd874820a | [
"MIT"
] | null | null | null | lnbits/extensions/satspay/migrations.py | lightningames/lnbits | 63d7431898f9ab79522765dbb29c8a2fd874820a | [
"MIT"
] | null | null | null | lnbits/extensions/satspay/migrations.py | lightningames/lnbits | 63d7431898f9ab79522765dbb29c8a2fd874820a | [
"MIT"
] | null | null | null | async def m001_initial(db):
"""
Initial wallet table.
"""
await db.execute(
"""
CREATE TABLE IF NOT EXISTS charges (
id TEXT NOT NULL PRIMARY KEY,
user TEXT,
description TEXT,
onchainwallet TEXT,
onchainaddress TEXT,
... | 25.518519 | 72 | 0.510885 | async def m001_initial(db):
await db.execute(
"""
CREATE TABLE IF NOT EXISTS charges (
id TEXT NOT NULL PRIMARY KEY,
user TEXT,
description TEXT,
onchainwallet TEXT,
onchainaddress TEXT,
lnbitswallet TEXT,
payment_r... | true | true |
79048fa362c16ca7f8ab347da84da6f744e9c7a6 | 1,070 | py | Python | regulations/tests/apps_tests.py | PhilR8/regulations-site | 19e2eafbba960f02e3a10d37aa288898f2614ee9 | [
"CC0-1.0"
] | 6 | 2020-10-05T20:19:25.000Z | 2022-03-17T18:34:59.000Z | regulations/tests/apps_tests.py | PhilR8/regulations-site | 19e2eafbba960f02e3a10d37aa288898f2614ee9 | [
"CC0-1.0"
] | 95 | 2020-10-22T15:00:46.000Z | 2022-03-31T19:10:20.000Z | regulations/tests/apps_tests.py | PhilR8/regulations-site | 19e2eafbba960f02e3a10d37aa288898f2614ee9 | [
"CC0-1.0"
] | 7 | 2020-10-08T14:10:49.000Z | 2022-01-24T18:36:13.000Z | import os
import shutil
import tempfile
from unittest import TestCase
from mock import patch
from regulations.apps import RegulationsConfig
class RegulationsConfigTests(TestCase):
def setUp(self):
self.tmpdir = tempfile.mkdtemp()
def tearDown(self):
shutil.rmtree(self.tmpdir)
@patch('r... | 34.516129 | 70 | 0.695327 | import os
import shutil
import tempfile
from unittest import TestCase
from mock import patch
from regulations.apps import RegulationsConfig
class RegulationsConfigTests(TestCase):
def setUp(self):
self.tmpdir = tempfile.mkdtemp()
def tearDown(self):
shutil.rmtree(self.tmpdir)
@patch('r... | true | true |
7904900c65e8be12c71fba1a74ba06b9f5cb497e | 1,155 | py | Python | main.py | BraffordHunter/03-Text-Adventure-2 | a967f1bfafcbc44a027c88c07d30f2e386d29774 | [
"MIT"
] | null | null | null | main.py | BraffordHunter/03-Text-Adventure-2 | a967f1bfafcbc44a027c88c07d30f2e386d29774 | [
"MIT"
] | null | null | null | main.py | BraffordHunter/03-Text-Adventure-2 | a967f1bfafcbc44a027c88c07d30f2e386d29774 | [
"MIT"
] | 1 | 2019-09-26T20:10:47.000Z | 2019-09-26T20:10:47.000Z | import sys, os, json
version = (3,7)
assert sys.version_info >= version, "This script requires at least Python {0}.{1}".format(version[0],version[1])
# Game loop functions
def render(game,current):
''' Displays the current room '''
print('You are in the ' + game['rooms'][current]['name'])
print(game['... | 21 | 112 | 0.61039 | import sys, os, json
version = (3,7)
assert sys.version_info >= version, "This script requires at least Python {0}.{1}".format(version[0],version[1])
def render(game,current):
print('You are in the ' + game['rooms'][current]['name'])
print(game['rooms'][current]['desc'])
def getInput():
response = ... | true | true |
7904908fc5c6e9037185991e24be7e0abcfd456e | 174,180 | py | Python | picamera/camera.py | RobertLucian/picamera | eae031080d016753deed1fe78ca878110a818401 | [
"BSD-3-Clause"
] | null | null | null | picamera/camera.py | RobertLucian/picamera | eae031080d016753deed1fe78ca878110a818401 | [
"BSD-3-Clause"
] | null | null | null | picamera/camera.py | RobertLucian/picamera | eae031080d016753deed1fe78ca878110a818401 | [
"BSD-3-Clause"
] | 1 | 2020-04-21T02:40:37.000Z | 2020-04-21T02:40:37.000Z | # vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# Python camera library for the Rasperry-Pi camera module
# Copyright (c) 2013-2017 Dave Jones <dave@waveform.org.uk>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# ... | 45.465936 | 146 | 0.609215 |
from __future__ import (
unicode_literals,
print_function,
division,
absolute_import,
)
str = type('')
import warnings
import datetime
import mimetypes
import ctypes as ct
import threading
from fractions import Fraction
from operator import itemgetter
from collections... | true | true |
790490a2fe105f55f3b011637612348a41355cec | 628 | py | Python | modules/dbnd-airflow/src/dbnd_airflow_contrib/credentials_helper_azure.py | ipattarapong/dbnd | 7bd65621c46c73e078eb628f994127ad4c7dbd1a | [
"Apache-2.0"
] | 224 | 2020-01-02T10:46:37.000Z | 2022-03-02T13:54:08.000Z | modules/dbnd-airflow/src/dbnd_airflow_contrib/credentials_helper_azure.py | ipattarapong/dbnd | 7bd65621c46c73e078eb628f994127ad4c7dbd1a | [
"Apache-2.0"
] | 16 | 2020-03-11T09:37:58.000Z | 2022-01-26T10:22:08.000Z | modules/dbnd-airflow/src/dbnd_airflow_contrib/credentials_helper_azure.py | ipattarapong/dbnd | 7bd65621c46c73e078eb628f994127ad4c7dbd1a | [
"Apache-2.0"
] | 24 | 2020-03-24T13:53:50.000Z | 2022-03-22T11:55:18.000Z | from airflow.hooks.base_hook import BaseHook
class AzureBlobStorageCredentials(BaseHook):
def __init__(self, conn_id="azure_blob_storage_default"):
self.conn_id = conn_id
def get_credentials(self):
connection_object = self.get_connection(self.conn_id)
extras = connection_object.extra_... | 33.052632 | 67 | 0.710191 | from airflow.hooks.base_hook import BaseHook
class AzureBlobStorageCredentials(BaseHook):
def __init__(self, conn_id="azure_blob_storage_default"):
self.conn_id = conn_id
def get_credentials(self):
connection_object = self.get_connection(self.conn_id)
extras = connection_object.extra_... | true | true |
790490e89602a87c8a556e59d31dc0f19b50cac5 | 44,483 | py | Python | flopy/utils/util_list.py | aleaf/flopy | a5777a4d4a745e473110a167c69603ac4ad3106c | [
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | flopy/utils/util_list.py | aleaf/flopy | a5777a4d4a745e473110a167c69603ac4ad3106c | [
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | flopy/utils/util_list.py | aleaf/flopy | a5777a4d4a745e473110a167c69603ac4ad3106c | [
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | """
util_list module. Contains the mflist class.
This classes encapsulates modflow-style list inputs away
from the individual packages. The end-user should not need to
instantiate this class directly.
some more info
"""
from __future__ import division, print_function
import os
import warnings
import numpy a... | 34.349807 | 81 | 0.49012 | from __future__ import division, print_function
import os
import warnings
import numpy as np
from ..datbase import DataInterface, DataListInterface, DataType
from ..utils.recarray_utils import create_empty_recarray
try:
from numpy.lib import NumpyVersion
numpy114 = NumpyVersion(np.__version__) >= "1.14.0"
ex... | true | true |
79049133923de2c6452134da9e925d0cf99c16c7 | 6,283 | py | Python | main.py | EmilienDupont/neural-function-distributions | c034bf79640c6d8922f1c276174b3cb1800d22b4 | [
"MIT"
] | 96 | 2021-05-31T19:29:51.000Z | 2022-03-22T02:15:46.000Z | main.py | EmilienDupont/neural-function-distributions | c034bf79640c6d8922f1c276174b3cb1800d22b4 | [
"MIT"
] | null | null | null | main.py | EmilienDupont/neural-function-distributions | c034bf79640c6d8922f1c276174b3cb1800d22b4 | [
"MIT"
] | 8 | 2021-06-05T05:14:05.000Z | 2022-03-25T02:15:40.000Z | import json
import os
import sys
import time
import torch
from training.training import Trainer
from data.conversion import GridDataConverter, PointCloudDataConverter, ERA5Converter
from data.dataloaders import mnist, celebahq
from data.dataloaders_era5 import era5
from data.dataloaders3d import shapenet_voxels, shapen... | 43.034247 | 115 | 0.660353 | import json
import os
import sys
import time
import torch
from training.training import Trainer
from data.conversion import GridDataConverter, PointCloudDataConverter, ERA5Converter
from data.dataloaders import mnist, celebahq
from data.dataloaders_era5 import era5
from data.dataloaders3d import shapenet_voxels, shapen... | true | true |
790492fa3f4feead19f5b1aef6a861bd440b8ec5 | 4,371 | py | Python | common/migrations/0018_auto_20161014_1805.py | baylee-d/cos.io | 3f88acb0feb7a167bf9e81c42e28f9d2d38bbd43 | [
"Apache-2.0"
] | null | null | null | common/migrations/0018_auto_20161014_1805.py | baylee-d/cos.io | 3f88acb0feb7a167bf9e81c42e28f9d2d38bbd43 | [
"Apache-2.0"
] | null | null | null | common/migrations/0018_auto_20161014_1805.py | baylee-d/cos.io | 3f88acb0feb7a167bf9e81c42e28f9d2d38bbd43 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-14 18:05
from __future__ import unicode_literals
import common.blocks.columns
import common.blocks.tabs
from django.db import migrations, models
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailembeds.blocks
import... | 136.59375 | 3,522 | 0.732098 |
from __future__ import unicode_literals
import common.blocks.columns
import common.blocks.tabs
from django.db import migrations, models
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailembeds.blocks
import wagtail.wagtailimages.blocks
class Migration(migrations.Migration):
... | true | true |
7904934f95925caff636ee0ac9ac8d4a33f42a38 | 746 | py | Python | DieRolls.py | bwnelb/dnd5e | 092a95c16366e0abff248611464eb8fbc500e3af | [
"MIT"
] | null | null | null | DieRolls.py | bwnelb/dnd5e | 092a95c16366e0abff248611464eb8fbc500e3af | [
"MIT"
] | null | null | null | DieRolls.py | bwnelb/dnd5e | 092a95c16366e0abff248611464eb8fbc500e3af | [
"MIT"
] | null | null | null | import random
### Advantage Logic ###
def advantage(rollfunc):
roll1 = rollfunc
roll2 = rollfunc
if roll1 > roll2:
return roll1
else:
return roll2
### Disadvantage Logic ###
def disadvantage(rollfunc):
roll1 = rollfunc
roll2 = rollfunc
if roll1 < roll2:
return roll1
... | 20.162162 | 35 | 0.651475 | import random
roll2 = rollfunc
if roll1 > roll2:
return roll1
else:
return roll2
oll2 = rollfunc
if roll1 < roll2:
return roll1
else:
return roll2
random.randint(1, sides)
def rolld6(sides:int=6):
return random.randint(1, sides)
def rolld8(sides:int=8):
retu... | true | true |
790494120d60c3eb1207b64a634e40696354fd88 | 4,390 | py | Python | core/domain/rule_domain_test.py | VictoriaRoux/oppia | 5ae2a7f0b5c85d6e28222844d22ebdbfb81923c6 | [
"Apache-2.0"
] | null | null | null | core/domain/rule_domain_test.py | VictoriaRoux/oppia | 5ae2a7f0b5c85d6e28222844d22ebdbfb81923c6 | [
"Apache-2.0"
] | null | null | null | core/domain/rule_domain_test.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... | 34.84127 | 77 | 0.648064 |
__author__ = 'Sean Lip'
import inspect
import os
import pkgutil
from core.domain import rule_domain
from extensions.objects.models import objects
import feconf
import test_utils
class FakeRule(rule_domain.Rule):
subject_type = objects.Real
description = 'is between {{x|Real}} and {{y|Unicod... | true | true |
790494268c4a51b99b50ac9e5a941c56937612a9 | 10,561 | py | Python | main/utils_test.py | mitodl/bootcamp-ecommerce | ba7d6aefe56c6481ae2a5afc84cdd644538b6d50 | [
"BSD-3-Clause"
] | 2 | 2018-06-20T19:37:03.000Z | 2021-01-06T09:51:40.000Z | main/utils_test.py | mitodl/bootcamp-ecommerce | ba7d6aefe56c6481ae2a5afc84cdd644538b6d50 | [
"BSD-3-Clause"
] | 1,226 | 2017-02-23T14:52:28.000Z | 2022-03-29T13:19:54.000Z | main/utils_test.py | mitodl/bootcamp-ecommerce | ba7d6aefe56c6481ae2a5afc84cdd644538b6d50 | [
"BSD-3-Clause"
] | 3 | 2017-03-20T03:51:27.000Z | 2021-03-19T15:54:31.000Z | """
Tests for the utils module
"""
import datetime
import operator as op
from math import ceil
from types import SimpleNamespace
import pytest
import pytz
from mitol.common.utils import (
is_near_now,
has_equal_properties,
first_or_none,
first_matching_item,
max_or_none,
partition_to_lists,
... | 30.435159 | 113 | 0.648802 | import datetime
import operator as op
from math import ceil
from types import SimpleNamespace
import pytest
import pytz
from mitol.common.utils import (
is_near_now,
has_equal_properties,
first_or_none,
first_matching_item,
max_or_none,
partition_to_lists,
unique,
unique_ignore_case,
... | true | true |
790496160664ef27a3f84a7e2228d4aa40fd0f66 | 1,762 | py | Python | sysinv/cgts-client/cgts-client/cgtsclient/v1/sm_service_nodes.py | etaivan/stx-config | 281e1f110973f96e077645fb01f67b646fc253cc | [
"Apache-2.0"
] | 10 | 2020-02-07T18:57:44.000Z | 2021-09-11T10:29:34.000Z | sysinv/cgts-client/cgts-client/cgtsclient/v1/sm_service_nodes.py | etaivan/stx-config | 281e1f110973f96e077645fb01f67b646fc253cc | [
"Apache-2.0"
] | 1 | 2021-01-14T12:01:55.000Z | 2021-01-14T12:01:55.000Z | sysinv/cgts-client/cgts-client/cgtsclient/v1/sm_service_nodes.py | etaivan/stx-config | 281e1f110973f96e077645fb01f67b646fc253cc | [
"Apache-2.0"
] | 10 | 2020-10-13T08:37:46.000Z | 2022-02-09T00:21:25.000Z | # -*- encoding: utf-8 -*-
#
# Copyright © 2013 Red Hat, 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 requi... | 27.968254 | 78 | 0.646425 |
from cgtsclient.common import base
from cgtsclient import exc
CREATION_ATTRIBUTES = ['servicename', 'state']
class SmNodes(base.Resource):
def __repr__(self):
return "<SmNodes %s>" % self._info
class SmNodesManager(base.Manager):
resource_class = SmNodes
@staticmethod
... | true | true |
7904962d692fbfb38c6be6c21aabf62d49aa32de | 3,593 | py | Python | example_programs/PadmalaPessoa2011.py | ahsanbutt95/sweetpea-py | d2e2074ef4b20b5f46d8049ca4bb0bf46c3fc705 | [
"MIT"
] | null | null | null | example_programs/PadmalaPessoa2011.py | ahsanbutt95/sweetpea-py | d2e2074ef4b20b5f46d8049ca4bb0bf46c3fc705 | [
"MIT"
] | null | null | null | example_programs/PadmalaPessoa2011.py | ahsanbutt95/sweetpea-py | d2e2074ef4b20b5f46d8049ca4bb0bf46c3fc705 | [
"MIT"
] | null | null | null | # Make SweetPea visible regardless of whether it's been installed.
import sys
sys.path.append("..")
from sweetpea.primitives import Factor, DerivedLevel, WithinTrial, Transition
from sweetpea.constraints import no_more_than_k_in_a_row
from sweetpea import fully_cross_block, synthesize_trials_non_uniform, print_experim... | 38.634409 | 213 | 0.748678 |
import sys
sys.path.append("..")
from sweetpea.primitives import Factor, DerivedLevel, WithinTrial, Transition
from sweetpea.constraints import no_more_than_k_in_a_row
from sweetpea import fully_cross_block, synthesize_trials_non_uniform, print_experiments
# DEFINE REWARD, RESPONSE and CONGRUENCY FACTORS
reward ... | true | true |
7904963f7babdc6d2af45ebb3647c446e74c1004 | 2,974 | py | Python | external/rocksdb/buckifier/targets_builder.py | cashbitecrypto/cashbite | 991200dc37234caa74c603cb8aee094cbd7ce429 | [
"BSD-3-Clause"
] | 858 | 2017-12-10T12:21:19.000Z | 2022-03-28T17:36:42.000Z | external/rocksdb/buckifier/targets_builder.py | cashbitecrypto/cashbite | 991200dc37234caa74c603cb8aee094cbd7ce429 | [
"BSD-3-Clause"
] | 663 | 2017-12-11T22:45:00.000Z | 2021-06-17T16:02:50.000Z | external/rocksdb/buckifier/targets_builder.py | cashbitecrypto/cashbite | 991200dc37234caa74c603cb8aee094cbd7ce429 | [
"BSD-3-Clause"
] | 1,731 | 2017-12-09T15:09:43.000Z | 2022-03-30T18:23:38.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
try:
from builtins import object
from builtins import str
except ImportError:
from __bu... | 31.978495 | 80 | 0.599866 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
try:
from builtins import object
from builtins import str
except ImportError:
from __builtin__ import object
from __builtin__ import str
import targets_cf... | true | true |
79049699a1eef13e74b134490f3bc3f1fe152ec0 | 16,882 | py | Python | testscripts/RDKB/component/WAN_MANAGER/TS_WANMANAGER_DSLWANoE_FixedMode_ActLink_P_1-1_WAN_Pri-Sec.py | rdkcmf/rdkb-tools-tdkb | 9f9c3600cd701d5fc90ac86a6394ebd28d49267e | [
"Apache-2.0"
] | null | null | null | testscripts/RDKB/component/WAN_MANAGER/TS_WANMANAGER_DSLWANoE_FixedMode_ActLink_P_1-1_WAN_Pri-Sec.py | rdkcmf/rdkb-tools-tdkb | 9f9c3600cd701d5fc90ac86a6394ebd28d49267e | [
"Apache-2.0"
] | null | null | null | testscripts/RDKB/component/WAN_MANAGER/TS_WANMANAGER_DSLWANoE_FixedMode_ActLink_P_1-1_WAN_Pri-Sec.py | rdkcmf/rdkb-tools-tdkb | 9f9c3600cd701d5fc90ac86a6394ebd28d49267e | [
"Apache-2.0"
] | null | null | null | ##########################################################################
# If not stated otherwise in this file or this component's Licenses.txt
# file the following copyright and licenses apply:
#
# Copyright 2021 RDK Management
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use th... | 53.936102 | 199 | 0.603838 | Types for DSL and WANOE interfaces
3.Make the priority and WAN Type unequal for further set operations to be success
4.Get the current WAN policy , set the policy to FIXED_MODE if not in the same policy
5.Set the Wan Type and priorities as(1,1) (Primary, Secondary) for DSL and WANOE respectively
6.Get the active l... | false | true |
790497b29462b28b7c826279aa596827763c1a39 | 977 | py | Python | src/testing/drawCountriesReg.py | OpenGeoscience/vgl | 904bc5648727806e9c212af18964153f4cab0d3c | [
"Apache-2.0"
] | 6 | 2015-05-03T05:23:11.000Z | 2018-09-15T08:17:13.000Z | src/testing/drawCountriesReg.py | OpenGeoscience/vgl | 904bc5648727806e9c212af18964153f4cab0d3c | [
"Apache-2.0"
] | 44 | 2015-02-04T18:40:33.000Z | 2018-12-18T16:16:51.000Z | src/testing/drawCountriesReg.py | OpenGeoscience/vgl | 904bc5648727806e9c212af18964153f4cab0d3c | [
"Apache-2.0"
] | 1 | 2015-10-12T00:47:01.000Z | 2015-10-12T00:47:01.000Z | import os
import sys
import time
import datetime
import selenium
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.common.exceptions import NoSuchElementException
from compare_images import *
if __name__ == "__main__":
# Create a Firefox window driver.
... | 27.914286 | 96 | 0.738997 | import os
import sys
import time
import datetime
import selenium
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.common.exceptions import NoSuchElementException
from compare_images import *
if __name__ == "__main__":
browser = webdriver.Firefox()... | false | true |
790497d305bb514cfd066b3430147ed303c833a3 | 398 | py | Python | comment/migrations/0002_auto_20200903_0323.py | shenjinglei/typeidea | 0391db5354bfb3e96b38652d907b670af11eabf7 | [
"BSD-2-Clause"
] | null | null | null | comment/migrations/0002_auto_20200903_0323.py | shenjinglei/typeidea | 0391db5354bfb3e96b38652d907b670af11eabf7 | [
"BSD-2-Clause"
] | null | null | null | comment/migrations/0002_auto_20200903_0323.py | shenjinglei/typeidea | 0391db5354bfb3e96b38652d907b670af11eabf7 | [
"BSD-2-Clause"
] | null | null | null | # Generated by Django 2.2.6 on 2020-09-03 03:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('comment', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='comment',
name='target',
... | 20.947368 | 72 | 0.59799 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('comment', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='comment',
name='target',
field=models.CharField(max_length=100, verbose_... | true | true |
7904984f2db32a39e0ae2d50aef02c67e0eeb3f7 | 52,257 | py | Python | discovery-infra/test_infra/helper_classes/cluster.py | mchernik/assisted-test-infra | 02b2b9533044740dc5de56fcbac7b1ed7f7e1227 | [
"Apache-2.0"
] | null | null | null | discovery-infra/test_infra/helper_classes/cluster.py | mchernik/assisted-test-infra | 02b2b9533044740dc5de56fcbac7b1ed7f7e1227 | [
"Apache-2.0"
] | 206 | 2020-11-10T07:34:14.000Z | 2022-03-29T16:37:50.000Z | discovery-infra/test_infra/helper_classes/cluster.py | mchernik/assisted-test-infra | 02b2b9533044740dc5de56fcbac7b1ed7f7e1227 | [
"Apache-2.0"
] | null | null | null | import contextlib
import ipaddress
import json
import os
import random
import re
import time
import warnings
from collections import Counter
from typing import Any, Dict, List, Optional, Set, Union
import requests
import test_infra.utils.waiting
import waiting
import yaml
from assisted_service_client import models
fro... | 42.450853 | 120 | 0.679813 | import contextlib
import ipaddress
import json
import os
import random
import re
import time
import warnings
from collections import Counter
from typing import Any, Dict, List, Optional, Set, Union
import requests
import test_infra.utils.waiting
import waiting
import yaml
from assisted_service_client import models
fro... | true | true |
790498b4f6c27daf5b1fc037d4e421f7c4553e58 | 1,156 | py | Python | scripts/linters/test_files/invalid_python_three.py | yash10019coder/oppia | 8c349c61ac723a2fd507046b20957934cba70e3a | [
"Apache-2.0"
] | 5,422 | 2015-08-14T01:56:44.000Z | 2022-03-31T23:31:56.000Z | scripts/linters/test_files/invalid_python_three.py | yash10019coder/oppia | 8c349c61ac723a2fd507046b20957934cba70e3a | [
"Apache-2.0"
] | 14,178 | 2015-08-14T05:21:45.000Z | 2022-03-31T23:54:10.000Z | scripts/linters/test_files/invalid_python_three.py | yash10019coder/oppia | 8c349c61ac723a2fd507046b20957934cba70e3a | [
"Apache-2.0"
] | 3,574 | 2015-08-14T04:20:06.000Z | 2022-03-29T01:52:37.000Z | # coding: utf-8
#
# Copyright 2020 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... | 30.421053 | 74 | 0.693772 |
class FakeClass:
def __init__(self, fake_arg):
self.fake_arg = fake_arg
def fake_method(self, name):
yield (name, name)
| true | true |
79049a6892e9c63f8426fc1689bce207fdd771d4 | 7,623 | py | Python | todo/operations/csv_importer.py | paiuolo/django-todo | 17d35460b6dfa8c5a45a9eeafbec262233f1586d | [
"BSD-3-Clause"
] | null | null | null | todo/operations/csv_importer.py | paiuolo/django-todo | 17d35460b6dfa8c5a45a9eeafbec262233f1586d | [
"BSD-3-Clause"
] | null | null | null | todo/operations/csv_importer.py | paiuolo/django-todo | 17d35460b6dfa8c5a45a9eeafbec262233f1586d | [
"BSD-3-Clause"
] | null | null | null | import codecs
import csv
import datetime
import logging
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from todo.models import Task, TaskList
log = logging.getLogger(__name__)
class CSVImporter:
"""Core upsert functionality for CSV import, for re-use by `import_csv`... | 37.737624 | 114 | 0.543093 | import codecs
import csv
import datetime
import logging
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from todo.models import Task, TaskList
log = logging.getLogger(__name__)
class CSVImporter:
def __init__(self):
self.errors = []
self.upserts = []... | true | true |
79049ac874bf28ecbdb30f9685138e91dcc1a528 | 561 | py | Python | gevent/gevent-group_pool.py | all3g/pieces | bc378fd22ddc700891fe7f34ab0d5b341141e434 | [
"CNRI-Python"
] | 34 | 2016-10-31T02:05:24.000Z | 2018-11-08T14:33:13.000Z | gevent/gevent-group_pool.py | join-us/python-programming | bc378fd22ddc700891fe7f34ab0d5b341141e434 | [
"CNRI-Python"
] | 2 | 2017-05-11T03:00:31.000Z | 2017-11-01T23:37:37.000Z | gevent/gevent-group_pool.py | join-us/python-programming | bc378fd22ddc700891fe7f34ab0d5b341141e434 | [
"CNRI-Python"
] | 21 | 2016-08-19T09:05:45.000Z | 2018-11-08T14:33:16.000Z | #!/usr/bin/env python
# -*- coding: utf8 -*-
import gevent
from gevent import getcurrent
from gevent.pool import Group
group = Group()
def hello_from(n):
print('Size of group %s' % len(group))
print('Hello from Greenlet %s' % id(getcurrent()))
group.map(hello_from, xrange(3))
def intensive(n):
gev... | 14.025 | 54 | 0.655971 |
import gevent
from gevent import getcurrent
from gevent.pool import Group
group = Group()
def hello_from(n):
print('Size of group %s' % len(group))
print('Hello from Greenlet %s' % id(getcurrent()))
group.map(hello_from, xrange(3))
def intensive(n):
gevent.sleep(3 - n)
return 'task', n
pri... | true | true |
79049b3404e746c2e38fd147e8eaa255ab8306e2 | 1,931 | py | Python | packages/std/nodes/std___Or0/std___Or0___METACODE.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | packages/std/nodes/std___Or0/std___Or0___METACODE.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | packages/std/nodes/std___Or0/std___Or0___METACODE.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | from custom_src.NodeInstance import NodeInstance
from custom_src.Node import Node
# USEFUL
# self.input(index) <- access to input data
# self.outputs[index].set_val(val) <- set output data port value
# self.main_widget <- access to main widget
# self.exec_output(index) ... | 34.482143 | 97 | 0.671673 | from custom_src.NodeInstance import NodeInstance
from custom_src.Node import Node
class %NODE_TITLE%_NodeInstance(NodeInstance):
def __init__(self, parent_node: Node, flow, configuration=None):
super(%NODE_TITLE%_NodeInstance, self).__init__(parent_node, flow, configuration)
self.spec... | false | true |
79049bd4a704b0a968e7e105aba2606fd9874bca | 774 | py | Python | apps/sys_inspect/urls.py | MaLei666/oms | 2447ec656ae5b61b9edc93c28a42f487476b5978 | [
"MIT"
] | null | null | null | apps/sys_inspect/urls.py | MaLei666/oms | 2447ec656ae5b61b9edc93c28a42f487476b5978 | [
"MIT"
] | 6 | 2020-03-23T09:21:13.000Z | 2022-03-11T23:49:57.000Z | apps/sys_inspect/urls.py | MaLei666/oms | 2447ec656ae5b61b9edc93c28a42f487476b5978 | [
"MIT"
] | 1 | 2019-10-15T03:06:46.000Z | 2019-10-15T03:06:46.000Z | """
Host management app
"""
from django.urls import path
from .views import *
app_name = 'sys_inspect'
urlpatterns = [
# 设备列表
path('device/list', InspectDevInfoViews.as_view(), name='inspect_devices_list'),
# 添加设备
path('device/add', AddDevView.as_view(), name='inspect_devices_add'),
# 删除设备
... | 22.114286 | 85 | 0.686047 | from django.urls import path
from .views import *
app_name = 'sys_inspect'
urlpatterns = [
path('device/list', InspectDevInfoViews.as_view(), name='inspect_devices_list'),
path('device/add', AddDevView.as_view(), name='inspect_devices_add'),
path('device/delete', DeleteDevView.as_view(),... | true | true |
79049bfff6d362808a6e0e4af9dd2d0fd9ef944b | 15,158 | py | Python | Classes/Packets/Server/Home/OwnHomeDataMessage.py | ServerBSvvv/BSDS-V41 | 5ffbc308c520f6d4e8a8fb9d7eca497c59735653 | [
"Apache-2.0"
] | null | null | null | Classes/Packets/Server/Home/OwnHomeDataMessage.py | ServerBSvvv/BSDS-V41 | 5ffbc308c520f6d4e8a8fb9d7eca497c59735653 | [
"Apache-2.0"
] | null | null | null | Classes/Packets/Server/Home/OwnHomeDataMessage.py | ServerBSvvv/BSDS-V41 | 5ffbc308c520f6d4e8a8fb9d7eca497c59735653 | [
"Apache-2.0"
] | null | null | null | import time
from Classes.Packets.PiranhaMessage import PiranhaMessage
class OwnHomeDataMessage(PiranhaMessage):
def __init__(self, messageData):
super().__init__(messageData)
self.messageVersion = 0
def encode(self, fields, player):
ownedBrawlersCount = len(player.OwnedBrawlers)
... | 31.844538 | 152 | 0.599419 | import time
from Classes.Packets.PiranhaMessage import PiranhaMessage
class OwnHomeDataMessage(PiranhaMessage):
def __init__(self, messageData):
super().__init__(messageData)
self.messageVersion = 0
def encode(self, fields, player):
ownedBrawlersCount = len(player.OwnedBrawlers)
... | true | true |
79049daa71c2792e4230d62fcf43754cca915b74 | 1,030 | py | Python | app.py | flamanta/river-trash-detection | f61228352c0d5e352962e5dfc132f44865a349c8 | [
"MIT"
] | null | null | null | app.py | flamanta/river-trash-detection | f61228352c0d5e352962e5dfc132f44865a349c8 | [
"MIT"
] | null | null | null | app.py | flamanta/river-trash-detection | f61228352c0d5e352962e5dfc132f44865a349c8 | [
"MIT"
] | 1 | 2020-10-10T04:59:54.000Z | 2020-10-10T04:59:54.000Z | # Digital OCEAN FLASK SERVER RECEIVES IMAGE
from flask import Flask, request, jsonify
import classify
import base64
import json
import firebase
import env
# Instantiate Flask
app = Flask(__name__)
# health check
@app.route("/status")
def health_check():
return "Running!"
# Performing image Recognition on Image... | 20.196078 | 71 | 0.691262 |
from flask import Flask, request, jsonify
import classify
import base64
import json
import firebase
import env
app = Flask(__name__)
@app.route("/status")
def health_check():
return "Running!"
@app.route("/detect", methods=["POST"])
def detect():
imgBytes = request.data
imgdata = base64.b64decode... | true | true |
79049dfac8e8811455c6071dfde7aa1cbd3abdd8 | 8,118 | py | Python | infrastructure-provisioning/src/general/scripts/os/common_clean_instance.py | pjfanning/incubator-datalab | 53a98c3deff17533e38f3c0d87eb6706b067f3c7 | [
"Apache-2.0"
] | null | null | null | infrastructure-provisioning/src/general/scripts/os/common_clean_instance.py | pjfanning/incubator-datalab | 53a98c3deff17533e38f3c0d87eb6706b067f3c7 | [
"Apache-2.0"
] | null | null | null | infrastructure-provisioning/src/general/scripts/os/common_clean_instance.py | pjfanning/incubator-datalab | 53a98c3deff17533e38f3c0d87eb6706b067f3c7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# *****************************************************************************
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ... | 38.657143 | 91 | 0.612343 |
import argparse
import os
import sys
from datalab.notebook_lib import *
from fabric import *
parser = argparse.ArgumentParser()
parser.add_argument('--hostname', type=str, default='')
parser.add_argument('--keyfile', type=str, default='')
parser.add_argument('--os_user', type=str, default='')
pa... | true | true |
79049f677b5dcfa6f0d3dafc6c589c5010d7295e | 16,206 | py | Python | gammapy/irf/psf/gauss.py | mdebony/gammapy | 29541fbfd90b0895ccc04fd3b9814a6f95511e14 | [
"BSD-3-Clause"
] | null | null | null | gammapy/irf/psf/gauss.py | mdebony/gammapy | 29541fbfd90b0895ccc04fd3b9814a6f95511e14 | [
"BSD-3-Clause"
] | null | null | null | gammapy/irf/psf/gauss.py | mdebony/gammapy | 29541fbfd90b0895ccc04fd3b9814a6f95511e14 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import logging
import numpy as np
from astropy import units as u
from astropy.coordinates import Angle
from astropy.io import fits
from astropy.table import Table
from gammapy.maps import MapAxes, MapAxis
from gammapy.utils.array import array_stats_str
fro... | 32.542169 | 106 | 0.578304 |
import logging
import numpy as np
from astropy import units as u
from astropy.coordinates import Angle
from astropy.io import fits
from astropy.table import Table
from gammapy.maps import MapAxes, MapAxis
from gammapy.utils.array import array_stats_str
from gammapy.utils.gauss import MultiGauss2D
from gammapy.utils.in... | true | true |
79049fc29922dc54a008d5f0cf947137a3610083 | 4,728 | py | Python | bin/parse_new_files.py | LoganRickert/CPP-Builder-And-Documentator | c537b8d9380c23ad94073f9841b83e7e8137d27a | [
"CC0-1.0"
] | 2 | 2017-07-28T16:30:19.000Z | 2018-05-16T02:26:48.000Z | bin/parse_new_files.py | LoganRickert/CPP-Manager | c537b8d9380c23ad94073f9841b83e7e8137d27a | [
"CC0-1.0"
] | null | null | null | bin/parse_new_files.py | LoganRickert/CPP-Manager | c537b8d9380c23ad94073f9841b83e7e8137d27a | [
"CC0-1.0"
] | null | null | null |
import sys
import datetime
def capitalize(string):
return string[0].upper() + string[1:]
action = sys.argv[1]
file_path = sys.argv[2]
project_name = sys.argv[3]
namespace = sys.argv[4]
now = datetime.datetime.now()
date = now.strftime("%m-%d-%Y %H:%M:%S")
args = sys.argv[6:]
username = "Logan Rickert"
def new_c... | 20.828194 | 104 | 0.666244 |
import sys
import datetime
def capitalize(string):
return string[0].upper() + string[1:]
action = sys.argv[1]
file_path = sys.argv[2]
project_name = sys.argv[3]
namespace = sys.argv[4]
now = datetime.datetime.now()
date = now.strftime("%m-%d-%Y %H:%M:%S")
args = sys.argv[6:]
username = "Logan Rickert"
def new_c... | false | true |
7904a04d4b3fa8725c8de1a5a3345de34d30e585 | 11,307 | py | Python | train_model.py | shineyjg/cnn_captcha | 1048494895ab6c1e4d5940025c02026386c32912 | [
"Apache-2.0"
] | null | null | null | train_model.py | shineyjg/cnn_captcha | 1048494895ab6c1e4d5940025c02026386c32912 | [
"Apache-2.0"
] | null | null | null | train_model.py | shineyjg/cnn_captcha | 1048494895ab6c1e4d5940025c02026386c32912 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import time
from PIL import Image
import random
import os
from sample import sample_conf
from tensorflow.python.framework.errors_impl import NotFoundError
# 设置以下环境变量可开启CPU识别
# os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_I... | 39.534965 | 122 | 0.580437 |
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import time
from PIL import Image
import random
import os
from sample import sample_conf
from tensorflow.python.framework.errors_impl import NotFoundError
class TrainError(Exception):
pass
class TrainModel(object):
def __init__(s... | true | true |
7904a08ed39c9c940c519724269e4a13f846add2 | 13,875 | py | Python | noiseprint/utility/gaussianMixture.py | steveazzolin/noiseprint | f42335c3ae641b620583c7dcd89063ca24a6437b | [
"BSD-4-Clause-UC"
] | null | null | null | noiseprint/utility/gaussianMixture.py | steveazzolin/noiseprint | f42335c3ae641b620583c7dcd89063ca24a6437b | [
"BSD-4-Clause-UC"
] | null | null | null | noiseprint/utility/gaussianMixture.py | steveazzolin/noiseprint | f42335c3ae641b620583c7dcd89063ca24a6437b | [
"BSD-4-Clause-UC"
] | null | null | null | # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#
# Copyright (c) 2017 Image Processing Research Group of University Federico II of Naples ('GRIP-UNINA').
# This software is delivered with Government Purpose Rights (GPR) under agreement number FA8750-16-2-0204.
#
# By downloading and/or usin... | 39.756447 | 127 | 0.541333 |
import numpy as np
from scipy.linalg import eigvalsh
from numpy.linalg import cholesky
from numpy.linalg import eigh
from numba import jit
import torch
class gm:
prioriProb = 0
outliersProb = 0
outliersNlogl = 0
mu = 0
listSigma = []
listSigmaInds = []
listSigmaType = []
= l... | true | true |
7904a20c44284db3241f6b6fcfb29b1197cb2d9b | 1,847 | py | Python | appengine/standard/users/main.py | baditaflorin/python-docs-samples | f122cbc13f20336d15409b5bd9820377dcb65464 | [
"Apache-2.0"
] | 2 | 2017-09-23T04:23:46.000Z | 2021-06-11T01:23:06.000Z | appengine/standard/users/main.py | Acidburn0zzz/python-docs-samples | bc0924a6826cbdb669415b58fd5b2d8534d87aa1 | [
"Apache-2.0"
] | 2 | 2021-06-10T23:54:32.000Z | 2021-06-10T23:54:33.000Z | appengine/standard/users/main.py | Acidburn0zzz/python-docs-samples | bc0924a6826cbdb669415b58fd5b2d8534d87aa1 | [
"Apache-2.0"
] | 2 | 2019-11-27T00:13:37.000Z | 2021-03-24T00:05:36.000Z | # Copyright 2016 Google 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 writing, ... | 30.278689 | 74 | 0.646995 |
from google.appengine.api import users
import webapp2
class MainPage(webapp2.RequestHandler):
def get(self):
user = users.get_current_user()
if user:
nickname = user.nickname()
logout_url = users.create_logout_url('/')
greeting = 'Welcome, {}! (... | true | true |
7904a3040e8c6bf9902569d51ccd6879143a4351 | 1,963 | py | Python | DailyCodingProblem/84_Amazon_Find_Islands_From_Matrix.py | RafayAK/CodingPrep | 718eccb439db0f6e727806964766a40e8234c8a9 | [
"MIT"
] | 5 | 2019-09-07T17:31:17.000Z | 2022-03-05T09:59:46.000Z | DailyCodingProblem/84_Amazon_Find_Islands_From_Matrix.py | RafayAK/CodingPrep | 718eccb439db0f6e727806964766a40e8234c8a9 | [
"MIT"
] | null | null | null | DailyCodingProblem/84_Amazon_Find_Islands_From_Matrix.py | RafayAK/CodingPrep | 718eccb439db0f6e727806964766a40e8234c8a9 | [
"MIT"
] | 2 | 2019-09-07T17:31:24.000Z | 2019-10-28T16:10:52.000Z | """
This problem was asked by Amazon.
Given a matrix of 1s and 0s, return the number of "islands" in the matrix.
A 1 represents land and 0 represents water, so an island is a group of 1s
that are neighboring whose perimeter is surrounded by water.
For example, this matrix has 4 islands.
1 0 0 0 0
0 0 1 1 0
0 1 1 0 0... | 21.107527 | 74 | 0.496689 |
moves = [
(0, 1),
(0, -1),
(1, 0),
(-1, 0),
(1,1),
(1, -1),
(-1, 1),
(-1, -1)
]
def mark_island(row, col, land_map, marker):
if row < 0 or col<0 or row>=len(land_map) or col >= len(land_map[0]):
return land_map
if land_map[row][col]== 0:
retu... | true | true |
7904a32bbc9136e18a310b57a5c186fce26b8e7e | 3,981 | py | Python | parl/remote/tests/cluster_test.py | GOnion/PARL | b29c45a6d2a187d1cfa8b5fe38e9c81b99ef37f2 | [
"Apache-2.0"
] | 1 | 2020-08-04T13:56:12.000Z | 2020-08-04T13:56:12.000Z | parl/remote/tests/cluster_test.py | GOnion/PARL | b29c45a6d2a187d1cfa8b5fe38e9c81b99ef37f2 | [
"Apache-2.0"
] | null | null | null | parl/remote/tests/cluster_test.py | GOnion/PARL | b29c45a6d2a187d1cfa8b5fe38e9c81b99ef37f2 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 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 app... | 26.898649 | 74 | 0.621954 |
import unittest
import parl
from parl.remote.master import Master
from parl.remote.worker import Worker
import time
import threading
from parl.remote.client import disconnect
from parl.remote import exceptions
import timeout_decorator
import subprocess
@parl.remote_class
class Actor(object):
def __... | true | true |
7904a352993473b0a3fcdaec0f4a8c7c0ca8c781 | 6,268 | py | Python | onlinecourse/views.py | yashjain0112/djangoapp | 3e55b947a78d42a56dc4a293d185de5a040cf2fb | [
"Apache-2.0"
] | null | null | null | onlinecourse/views.py | yashjain0112/djangoapp | 3e55b947a78d42a56dc4a293d185de5a040cf2fb | [
"Apache-2.0"
] | null | null | null | onlinecourse/views.py | yashjain0112/djangoapp | 3e55b947a78d42a56dc4a293d185de5a040cf2fb | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponseRedirect
# <HINT> Import any new Models here
from .models import Course, Enrollment, Question, Choice, Submission , Lesson
from django.contrib.auth.models import User
from django.shortcuts import get_object_or_404, render, redirect
from django.url... | 36.654971 | 153 | 0.690651 | from django.shortcuts import render
from django.http import HttpResponseRedirect
from .models import Course, Enrollment, Question, Choice, Submission , Lesson
from django.contrib.auth.models import User
from django.shortcuts import get_object_or_404, render, redirect
from django.urls import reverse
from django.views ... | true | true |
7904a3cf708d31f553aba6bc487fdbfd5a76f097 | 9,136 | py | Python | generate_xfoil/Step4_CreateDataset.py | nasa/airfoil-learning | a76dabc0474485d1e573471e70ec4826aeae0517 | [
"NASA-1.3"
] | null | null | null | generate_xfoil/Step4_CreateDataset.py | nasa/airfoil-learning | a76dabc0474485d1e573471e70ec4826aeae0517 | [
"NASA-1.3"
] | null | null | null | generate_xfoil/Step4_CreateDataset.py | nasa/airfoil-learning | a76dabc0474485d1e573471e70ec4826aeae0517 | [
"NASA-1.3"
] | null | null | null | import pickle
from typing import Dict, List, Tuple
from tqdm import trange
import numpy as np
import random, json
import torch, glob, os
import os.path as osp
from torch.utils.data import random_split
import torch_geometric.transforms as T
from libs.utils import create_edge_adjacency
from torch_geometric.data import Da... | 45.004926 | 207 | 0.660574 | import pickle
from typing import Dict, List, Tuple
from tqdm import trange
import numpy as np
import random, json
import torch, glob, os
import os.path as osp
from torch.utils.data import random_split
import torch_geometric.transforms as T
from libs.utils import create_edge_adjacency
from torch_geometric.data import Da... | true | true |
7904a48fd08bc3a934fe3f4f273745b2570dce4c | 21,535 | py | Python | hw06_train.py | arao53/BME695-object-detection | 7f094cc016d91c6b00d6f86f7c3e2e96acbb0083 | [
"MIT"
] | null | null | null | hw06_train.py | arao53/BME695-object-detection | 7f094cc016d91c6b00d6f86f7c3e2e96acbb0083 | [
"MIT"
] | null | null | null | hw06_train.py | arao53/BME695-object-detection | 7f094cc016d91c6b00d6f86f7c3e2e96acbb0083 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""hw06_training.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1bjAeUIVjt9W8mASk8vw1y2SbuBYuQdlG
"""
!pip install reports
import PIL.Image as Image, requests, urllib, random
import argparse, json, PIL.Image, reports, os... | 39.083485 | 168 | 0.622661 |
"""hw06_training.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1bjAeUIVjt9W8mASk8vw1y2SbuBYuQdlG
"""
!pip install reports
import PIL.Image as Image, requests, urllib, random
import argparse, json, PIL.Image, reports, os, pickle
from requests.... | false | true |
7904a4bffb91e3d6fbb33c163e21b3b5e6eeb747 | 86 | py | Python | .vim/template/python/base-atcoder.py | reireias/dotfiles | 7e25c5fcb9203c6ddd1e280ea3bad577c3af28f6 | [
"MIT"
] | 24 | 2017-04-27T09:21:49.000Z | 2022-01-10T16:44:34.000Z | skale/migrate.py | skalenetwork/skaled-tests | b1cbbff9888a6854f04f58917ab3400395933f5a | [
"MIT"
] | 7 | 2019-11-13T14:54:37.000Z | 2022-03-01T01:05:13.000Z | skale/migrate.py | skalenetwork/skaled-tests | b1cbbff9888a6854f04f58917ab3400395933f5a | [
"MIT"
] | 12 | 2018-01-29T08:27:57.000Z | 2021-07-25T04:55:03.000Z | #!/usr/bin/env python3
def main():
pass
if __name__ == '__main__':
main()
| 8.6 | 26 | 0.569767 |
def main():
pass
if __name__ == '__main__':
main()
| true | true |
7904a55033cf1b02c79576dfe78b8b0e9c0e6741 | 1,770 | py | Python | examples/button.py | NextLight/drawy | e7cd8f9607a52937df589e936f4dcce0ca1306aa | [
"MIT"
] | null | null | null | examples/button.py | NextLight/drawy | e7cd8f9607a52937df589e936f4dcce0ca1306aa | [
"MIT"
] | null | null | null | examples/button.py | NextLight/drawy | e7cd8f9607a52937df589e936f4dcce0ca1306aa | [
"MIT"
] | null | null | null | from drawy import *
class Button:
def __init__(self, text, click_handler, point, width, height, *, hide=False, do_highlight=True, background_color='gray', highlight_color='lightgray', text_color='black', border_color='black'):
self.text = text
self.click_handler = click_handler
self.p... | 34.038462 | 197 | 0.640678 | from drawy import *
class Button:
def __init__(self, text, click_handler, point, width, height, *, hide=False, do_highlight=True, background_color='gray', highlight_color='lightgray', text_color='black', border_color='black'):
self.text = text
self.click_handler = click_handler
self.p... | true | true |
7904a6e26a9b0119d1b29ca665ce26547d0afb9c | 798 | py | Python | app/rest/serializers.py | WishesFire/Epam-Python-Project | d54bbe48d539b0810d9b42b0839a64b035021c6d | [
"Apache-2.0"
] | 1 | 2021-11-18T11:57:02.000Z | 2021-11-18T11:57:02.000Z | app/rest/serializers.py | WishesFire/Epam-project | d54bbe48d539b0810d9b42b0839a64b035021c6d | [
"Apache-2.0"
] | null | null | null | app/rest/serializers.py | WishesFire/Epam-project | d54bbe48d539b0810d9b42b0839a64b035021c6d | [
"Apache-2.0"
] | null | null | null | """
This module used for serializing data
CategorySchema - data from Category model
VacancySchema - data from Vacancy model
"""
# pylint: disable=too-many-ancestors
# pylint: disable=missing-class-docstring
# pylint: disable=too-few-public-methods
from app import ma
from app.models.model import Category, Vacancy
cl... | 22.166667 | 55 | 0.692982 |
from app import ma
from app.models.model import Category, Vacancy
class CategorySchema(ma.SQLAlchemyAutoSchema):
class Meta:
model = Category
fields = ("name", )
class VacancySchema(ma.SQLAlchemyAutoSchema):
class Meta:
model = Vacancy
fields = ("name", "salary", "info", ... | true | true |
7904a85d5c7963b95e5adf6c7e63db126115a3f3 | 8,302 | py | Python | facenet/align/align_dataset_mtcnn.py | btlk/facenet | fd531331b962ec4fd4aac534debf9a5bbf7e8c4a | [
"MIT"
] | null | null | null | facenet/align/align_dataset_mtcnn.py | btlk/facenet | fd531331b962ec4fd4aac534debf9a5bbf7e8c4a | [
"MIT"
] | null | null | null | facenet/align/align_dataset_mtcnn.py | btlk/facenet | fd531331b962ec4fd4aac534debf9a5bbf7e8c4a | [
"MIT"
] | null | null | null | """Performs face alignment and stores face thumbnails in the output directory."""
# MIT License
#
# Copyright (c) 2016 David Sandberg
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software witho... | 51.8875 | 133 | 0.57456 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from scipy import misc
import sys
import os
import argparse
import tensorflow as tf
import numpy as np
import facenet
from detect_face import create_mtcnn, detect_face
import random
from t... | true | true |
7904a8c11b4b2be45e4c03e64545a4ce832791ee | 5,287 | py | Python | libs/sdc_etl_libs/test/dataframe_tests/sdc_dataframe_sql.py | darknegma/docker-airflow | 44e3d02d7ac43c8876145ae47acfbbbde67230df | [
"Apache-2.0"
] | null | null | null | libs/sdc_etl_libs/test/dataframe_tests/sdc_dataframe_sql.py | darknegma/docker-airflow | 44e3d02d7ac43c8876145ae47acfbbbde67230df | [
"Apache-2.0"
] | 3 | 2021-03-31T19:26:57.000Z | 2021-12-13T20:33:01.000Z | libs/sdc_etl_libs/test/dataframe_tests/sdc_dataframe_sql.py | darknegma/docker-airflow | 44e3d02d7ac43c8876145ae47acfbbbde67230df | [
"Apache-2.0"
] | null | null | null | import sys
import math
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../../../")
from sdc_etl_libs.sdc_dataframe.Dataframe import *
import pandas as pd
import numpy as np
import json
import pytest
def test_generate_insert_query_ddl(mocker):
test_schema = """
{
"namespace": "Ti... | 35.722973 | 275 | 0.538491 | import sys
import math
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../../../")
from sdc_etl_libs.sdc_dataframe.Dataframe import *
import pandas as pd
import numpy as np
import json
import pytest
def test_generate_insert_query_ddl(mocker):
test_schema = """
{
"namespace": "Ti... | true | true |
7904a934ee4c0d7f813b2c3b6ed46871ce61bd49 | 5,855 | py | Python | netdev/vendors/junos_like.py | maliciousgroup/netdev | e2585ac24891cba172fc2056e9868e1d7c41ddc2 | [
"Apache-2.0"
] | 199 | 2016-06-24T14:00:33.000Z | 2022-02-14T07:48:44.000Z | netdev/vendors/junos_like.py | maliciousgroup/netdev | e2585ac24891cba172fc2056e9868e1d7c41ddc2 | [
"Apache-2.0"
] | 55 | 2017-05-08T10:01:26.000Z | 2021-07-02T00:54:33.000Z | netdev/vendors/junos_like.py | maliciousgroup/netdev | e2585ac24891cba172fc2056e9868e1d7c41ddc2 | [
"Apache-2.0"
] | 54 | 2016-12-29T13:28:00.000Z | 2022-03-01T04:58:19.000Z | """
JunOSLikeDevice Class is abstract class for using in Juniper JunOS like devices
Connection Method are based upon AsyncSSH and should be running in asyncio loop
"""
import re
from netdev.logger import logger
from netdev.vendors.base import BaseDevice
class JunOSLikeDevice(BaseDevice):
"""
... | 40.10274 | 119 | 0.644236 |
import re
from netdev.logger import logger
from netdev.vendors.base import BaseDevice
class JunOSLikeDevice(BaseDevice):
_delimiter_list = ["%", ">", "#"]
_pattern = r"\w+(\@[\-\w]*)?[{delimiters}]"
_disable_paging_command = "set cli screen-length 0"
_config_enter = "configure"
... | true | true |
7904a9a5f121ef43001036bd043db12acd71f522 | 565 | py | Python | Prime Powers/prime_powers.py | philippossfrn/Integer-Sequences | ba803320ab6e1abd921db402c60fb8c48a5877d5 | [
"Unlicense"
] | 48 | 2021-06-28T05:53:43.000Z | 2022-03-17T10:37:26.000Z | Prime Powers/prime_powers.py | philippossfrn/Integer-Sequences | ba803320ab6e1abd921db402c60fb8c48a5877d5 | [
"Unlicense"
] | 99 | 2021-06-28T03:16:51.000Z | 2022-03-17T00:18:50.000Z | Prime Powers/prime_powers.py | philippossfrn/Integer-Sequences | ba803320ab6e1abd921db402c60fb8c48a5877d5 | [
"Unlicense"
] | 140 | 2021-06-28T06:29:19.000Z | 2022-03-30T11:15:45.000Z | import math
def is_prime_power(n):
#even number divisible
factors = set()
while n % 2 == 0:
factors.add(2)
n = n / 2
#n became odd
for i in range(3,int(math.sqrt(n))+1,2):
while (n % i == 0):
factors.add(i)
n = n / i
if n > 2:
factors.add(n)
ret... | 17.65625 | 43 | 0.486726 | import math
def is_prime_power(n):
factors = set()
while n % 2 == 0:
factors.add(2)
n = n / 2
for i in range(3,int(math.sqrt(n))+1,2):
while (n % i == 0):
factors.add(i)
n = n / i
if n > 2:
factors.add(n)
return len(factors) == 1
def main():
... | true | true |
7904a9f3f89733d06a46bd4b4fa1b13af9209ed9 | 655 | py | Python | src/pycontw2016/settings/production/pycontw2016.py | kaka-lin/pycon.tw | 67809a5e43b03273ac8d8f5a1b6b3d3f73474be7 | [
"MIT"
] | 47 | 2015-12-19T10:23:11.000Z | 2018-06-13T08:07:33.000Z | src/pycontw2016/settings/production/pycontw2016.py | kaka-lin/pycon.tw | 67809a5e43b03273ac8d8f5a1b6b3d3f73474be7 | [
"MIT"
] | 473 | 2018-12-01T13:01:48.000Z | 2022-03-30T07:10:42.000Z | src/pycontw2016/settings/production/pycontw2016.py | kaka-lin/pycon.tw | 67809a5e43b03273ac8d8f5a1b6b3d3f73474be7 | [
"MIT"
] | 91 | 2018-07-26T02:38:59.000Z | 2022-01-16T02:38:31.000Z | import collections
import datetime
from django.utils.translation import gettext_lazy as _
from .base import * # noqa
# Override static and media URL for prefix in WSGI server.
# https://code.djangoproject.com/ticket/25598
STATIC_URL = '/2016/static/'
MEDIA_URL = '/2016/media/'
CONFERENCE_DEFAULT_SLUG = 'pycontw... | 25.192308 | 58 | 0.674809 | import collections
import datetime
from django.utils.translation import gettext_lazy as _
from .base import *
STATIC_URL = '/2016/static/'
MEDIA_URL = '/2016/media/'
CONFERENCE_DEFAULT_SLUG = 'pycontw-2016'
TALK_PROPOSAL_DURATION_CHOICES = (
('NOPREF', _('No preference')),
('PREF25', _('Prefer 25min... | true | true |
7904aa9d28cbe73452b0cf7ed25e00e98afe1123 | 215 | py | Python | WebPersonal/WebPersonal/wsgi.py | CristianAAT/web-personal | 12a920247e89e37030ca49ae42d1f0959b6d2796 | [
"Apache-2.0"
] | null | null | null | WebPersonal/WebPersonal/wsgi.py | CristianAAT/web-personal | 12a920247e89e37030ca49ae42d1f0959b6d2796 | [
"Apache-2.0"
] | 7 | 2021-03-30T13:57:13.000Z | 2022-01-13T02:56:37.000Z | WebPersonal/WebPersonal/wsgi.py | CristianAAT/web-personal | 12a920247e89e37030ca49ae42d1f0959b6d2796 | [
"Apache-2.0"
] | null | null | null | import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "WebPersonal.settings")
application = get_wsgi_application()
#application = DjangoWhiteNoise(application) | 30.714286 | 71 | 0.84186 | import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "WebPersonal.settings")
application = get_wsgi_application()
| true | true |
7904ab641d3683007eb6f39dfe08fafe512112a5 | 4,181 | py | Python | scripts/asmt_merge_vacc_exetera.py | deng113jie/ExeTeraCovid | ee9ec90983d7c2c711962c7fe9ac25251392e41b | [
"Apache-2.0"
] | 3 | 2021-03-23T14:23:06.000Z | 2021-12-29T16:54:42.000Z | scripts/asmt_merge_vacc_exetera.py | deng113jie/ExeTeraCovid | ee9ec90983d7c2c711962c7fe9ac25251392e41b | [
"Apache-2.0"
] | 29 | 2021-02-22T12:12:53.000Z | 2021-09-27T10:52:25.000Z | scripts/asmt_merge_vacc_exetera.py | deng113jie/ExeTeraCovid | ee9ec90983d7c2c711962c7fe9ac25251392e41b | [
"Apache-2.0"
] | 1 | 2021-03-08T15:00:30.000Z | 2021-03-08T15:00:30.000Z | from datetime import datetime
import numpy as np
import exetera.core.session as sess
from exetera.core import dataframe
ADATA = '/home/jd21/data/processed_May17_processed.hdf5'
VDATA = '/home/jd21/data/vacc.0603.h5'
DSTDATA = '/home/jd21/data/full_merge.h5'
def asmt_merge_vacc():
"""
Merge assessment df wi... | 45.945055 | 153 | 0.643387 | from datetime import datetime
import numpy as np
import exetera.core.session as sess
from exetera.core import dataframe
ADATA = '/home/jd21/data/processed_May17_processed.hdf5'
VDATA = '/home/jd21/data/vacc.0603.h5'
DSTDATA = '/home/jd21/data/full_merge.h5'
def asmt_merge_vacc():
with sess.Session() as s:
... | true | true |
7904abd77015675bb1233aacba24a03ea36cc363 | 2,529 | py | Python | angrmanagement/ui/widgets/qpatch_table.py | GeistInDerSH/angr-management | 7033aa25957d8d59cea7ba10e296d38b4b6678b7 | [
"BSD-2-Clause"
] | 1 | 2021-09-09T13:52:51.000Z | 2021-09-09T13:52:51.000Z | angrmanagement/ui/widgets/qpatch_table.py | GeistInDerSH/angr-management | 7033aa25957d8d59cea7ba10e296d38b4b6678b7 | [
"BSD-2-Clause"
] | null | null | null | angrmanagement/ui/widgets/qpatch_table.py | GeistInDerSH/angr-management | 7033aa25957d8d59cea7ba10e296d38b4b6678b7 | [
"BSD-2-Clause"
] | null | null | null |
import binascii
from PySide2.QtWidgets import QTableWidget, QTableWidgetItem, QAbstractItemView
from PySide2.QtCore import Qt
class QPatchTableItem:
def __init__(self, patch, old_bytes):
self.patch = patch
self.old_bytes = old_bytes
def widgets(self):
patch = self.patch
wid... | 30.46988 | 114 | 0.619217 |
import binascii
from PySide2.QtWidgets import QTableWidget, QTableWidgetItem, QAbstractItemView
from PySide2.QtCore import Qt
class QPatchTableItem:
def __init__(self, patch, old_bytes):
self.patch = patch
self.old_bytes = old_bytes
def widgets(self):
patch = self.patch
wid... | true | true |
7904abff7d1aa5738d8b5453dbfe318987c1ab13 | 18,835 | py | Python | Lib/test/test_contextlib_async.py | syokoysn/cpython | 889036f7ef7290ef15b6c3373023f6a35387af0c | [
"0BSD"
] | 2 | 2021-08-03T10:25:23.000Z | 2021-08-07T20:14:43.000Z | Lib/test/test_contextlib_async.py | syokoysn/cpython | 889036f7ef7290ef15b6c3373023f6a35387af0c | [
"0BSD"
] | 10 | 2021-05-01T05:44:13.000Z | 2022-03-01T08:01:37.000Z | Lib/test/test_contextlib_async.py | rapidcow/cpython | dd3adc013b21ec1338bb5fea2e2c04a4fc650306 | [
"0BSD"
] | 1 | 2021-07-04T14:39:48.000Z | 2021-07-04T14:39:48.000Z | import asyncio
from contextlib import (
asynccontextmanager, AbstractAsyncContextManager,
AsyncExitStack, nullcontext, aclosing)
import functools
from test import support
import unittest
from test.test_contextlib import TestBaseExitStack
def _async_test(func):
"""Decorator to turn an async function into ... | 32.251712 | 84 | 0.583754 | import asyncio
from contextlib import (
asynccontextmanager, AbstractAsyncContextManager,
AsyncExitStack, nullcontext, aclosing)
import functools
from test import support
import unittest
from test.test_contextlib import TestBaseExitStack
def _async_test(func):
@functools.wraps(func)
def wrapper(*args... | true | true |
7904add70e4abbcf3f37aba53f90e891b9dc8808 | 5,950 | py | Python | atkinson/dlrn/http_data.py | jpichon/atkinson | e829d9c15161ac252f77605a14be696109b6bfb3 | [
"MIT"
] | null | null | null | atkinson/dlrn/http_data.py | jpichon/atkinson | e829d9c15161ac252f77605a14be696109b6bfb3 | [
"MIT"
] | null | null | null | atkinson/dlrn/http_data.py | jpichon/atkinson | e829d9c15161ac252f77605a14be696109b6bfb3 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
"""Functions for working with the DLRN API"""
import csv
import os.path
import requests
from toolchest import yaml
from atkinson.config.manager import ConfigManager
from atkinson.logging.logger import getLogger
def _raw_fetch(url, logger):
"""
Fetch remote data and return the text ou... | 32.692308 | 79 | 0.565546 |
import csv
import os.path
import requests
from toolchest import yaml
from atkinson.config.manager import ConfigManager
from atkinson.logging.logger import getLogger
def _raw_fetch(url, logger):
ret_data = None
try:
req = requests.get(url)
if req.status_code == requests.codes.ok:
... | true | true |
7904ae4da0b6717e33cffa41ad9f29f6e442f000 | 1,712 | py | Python | cataloger/settings.py | centuri-engineering/cataloger | 4faf7a1a02249e067aea3faf23770324dccd0f69 | [
"MIT"
] | 1 | 2022-01-14T19:27:09.000Z | 2022-01-14T19:27:09.000Z | cataloger/settings.py | centuri-engineering/cataloger | 4faf7a1a02249e067aea3faf23770324dccd0f69 | [
"MIT"
] | 10 | 2020-10-12T13:47:50.000Z | 2022-02-25T18:28:27.000Z | cataloger/settings.py | centuri-engineering/cataloger | 4faf7a1a02249e067aea3faf23770324dccd0f69 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Application configuration.
Most configuration is set via environment variables.
For local development, use a .env file to set
environment variables.
"""
from environs import Env
env = Env()
env.read_env()
ENV = env.str("FLASK_ENV", default="production")
DEBUG = ENV == "development"
SQLALC... | 34.24 | 75 | 0.739486 |
from environs import Env
env = Env()
env.read_env()
ENV = env.str("FLASK_ENV", default="production")
DEBUG = ENV == "development"
SQLALCHEMY_DATABASE_URI = env.str("DATABASE_URL")
SECRET_KEY = env.str("SECRET_KEY")
SEND_FILE_MAX_AGE_DEFAULT = env.int("SEND_FILE_MAX_AGE_DEFAULT")
BCRYPT_LOG_ROUNDS = env.int("BCRYPT_L... | true | true |
7904ae5794cd8c14f01c88125eb4edc68be9f382 | 1,703 | py | Python | chapter06/dags/listing_6_4.py | add54/Data_PipeLine_Apache_Airflow | 40b52ba6fcda3203b194be9e1c2850135997215a | [
"BSD-Source-Code"
] | 303 | 2019-09-30T10:59:15.000Z | 2022-03-30T17:03:27.000Z | chapter06/dags/listing_6_4.py | andreaschandra/data-pipelines-with-apache-airflow | 40b52ba6fcda3203b194be9e1c2850135997215a | [
"BSD-Source-Code"
] | 13 | 2020-04-08T12:28:30.000Z | 2021-12-30T06:40:37.000Z | chapter06/dags/listing_6_4.py | andreaschandra/data-pipelines-with-apache-airflow | 40b52ba6fcda3203b194be9e1c2850135997215a | [
"BSD-Source-Code"
] | 148 | 2020-01-03T03:30:39.000Z | 2022-03-28T04:19:43.000Z | from pathlib import Path
import airflow.utils.dates
from airflow import DAG
from airflow.operators.dummy import DummyOperator
from airflow.operators.trigger_dagrun import TriggerDagRunOperator
from airflow.sensors.python import PythonSensor
dag1 = DAG(
dag_id="listing_6_04_dag01",
start_date=airflow.utils.dat... | 35.479167 | 87 | 0.760423 | from pathlib import Path
import airflow.utils.dates
from airflow import DAG
from airflow.operators.dummy import DummyOperator
from airflow.operators.trigger_dagrun import TriggerDagRunOperator
from airflow.sensors.python import PythonSensor
dag1 = DAG(
dag_id="listing_6_04_dag01",
start_date=airflow.utils.dat... | true | true |
7904ae6539ae32b4869881b5da4552aa128ddb2f | 7,061 | py | Python | update-attack.py | Alexander-RB/attack-website | 43f21a2b5db0c37826283a3e427d330ba3668b22 | [
"Apache-2.0"
] | 2 | 2021-04-08T08:05:39.000Z | 2021-06-01T08:17:46.000Z | temp-directory/MITRE-ATTACK-WEBSITE/update-attack.py | devgunho/CTI_with_NLP | 5b98cc76923b79f76e9977745a74e9b868a92ab0 | [
"Apache-2.0"
] | null | null | null | temp-directory/MITRE-ATTACK-WEBSITE/update-attack.py | devgunho/CTI_with_NLP | 5b98cc76923b79f76e9977745a74e9b868a92ab0 | [
"Apache-2.0"
] | null | null | null | import argparse
import colorama
import json
import os
import time
from string import Template
import modules
from modules import site_config
from modules import util
# argument defaults and options for the CLI
module_choices = ['clean', 'stix_data', 'groups', 'search', 'matrices', 'mitigations', 'software', 'tactics',... | 43.319018 | 189 | 0.596233 | import argparse
import colorama
import json
import os
import time
from string import Template
import modules
from modules import site_config
from modules import util
module_choices = ['clean', 'stix_data', 'groups', 'search', 'matrices', 'mitigations', 'software', 'tactics', 'techniques', 'tour', 'website_build', 'ra... | true | true |
7904b03b0a2aec971e32e1cd340649c330ce75df | 2,293 | py | Python | server/websockets/consumers/world/broadcasts/avatar.py | nking1232/html5-msoy | 6e026f1989b15310ad67c050beb69a168c3bdd5f | [
"MIT"
] | null | null | null | server/websockets/consumers/world/broadcasts/avatar.py | nking1232/html5-msoy | 6e026f1989b15310ad67c050beb69a168c3bdd5f | [
"MIT"
] | null | null | null | server/websockets/consumers/world/broadcasts/avatar.py | nking1232/html5-msoy | 6e026f1989b15310ad67c050beb69a168c3bdd5f | [
"MIT"
] | 2 | 2020-12-18T19:19:38.000Z | 2020-12-18T19:53:56.000Z | from asgiref.sync import sync_to_async
from channels.layers import get_channel_layer
from ....models import Participant
import humps
channel_layer = get_channel_layer()
def get_participant(room_channel_name, channel_name):
participant = Participant.objects.get(
channel_room__channel_name=room_channel_name... | 30.573333 | 87 | 0.66812 | from asgiref.sync import sync_to_async
from channels.layers import get_channel_layer
from ....models import Participant
import humps
channel_layer = get_channel_layer()
def get_participant(room_channel_name, channel_name):
participant = Participant.objects.get(
channel_room__channel_name=room_channel_name... | true | true |
7904b0e611c3fa61bcb656dfacb3cb6407036a58 | 17,862 | py | Python | egs/librispeech/ASR/tdnn_lstm_ctc/train.py | aarora8/icefall | 8cb7f712e413fffbcdfdd865be73d6ff43f0ce7a | [
"Apache-2.0"
] | null | null | null | egs/librispeech/ASR/tdnn_lstm_ctc/train.py | aarora8/icefall | 8cb7f712e413fffbcdfdd865be73d6ff43f0ce7a | [
"Apache-2.0"
] | null | null | null | egs/librispeech/ASR/tdnn_lstm_ctc/train.py | aarora8/icefall | 8cb7f712e413fffbcdfdd865be73d6ff43f0ce7a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2021 Xiaomi Corp. (authors: Fangjun Kuang
# Mingshuang Luo)
#
# See ../../../../LICENSE for clarification regarding multiple authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use th... | 29.969799 | 79 | 0.632124 |
import argparse
import logging
from pathlib import Path
from shutil import copyfile
from typing import Optional, Tuple
import k2
import torch
import torch.multiprocessing as mp
import torch.nn as nn
import torch.optim as optim
from asr_datamodule import LibriSpeechAsrDataModule
from lhotse.utils imp... | true | true |
7904b1463761804da7691d4d9ee95e88b306acc6 | 574 | py | Python | py/memcheck.py | lbyoo/l_clib | 8a0eaa0fe505d0f35ca24e8ba239c2643dbdb784 | [
"Apache-2.0"
] | null | null | null | py/memcheck.py | lbyoo/l_clib | 8a0eaa0fe505d0f35ca24e8ba239c2643dbdb784 | [
"Apache-2.0"
] | null | null | null | py/memcheck.py | lbyoo/l_clib | 8a0eaa0fe505d0f35ca24e8ba239c2643dbdb784 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""
Usage: program | ./memcheck.py
"""
import fileinput
import pdb
with fileinput.input() as f:
data = "".join(f)
s = {}
for l in data.splitlines():
if "malloc:" in l:
c = l.split(":")
s[c[-1].strip()] = l
# print("malloc:%s" %c[-1].strip... | 16.882353 | 44 | 0.463415 |
import fileinput
import pdb
with fileinput.input() as f:
data = "".join(f)
s = {}
for l in data.splitlines():
if "malloc:" in l:
c = l.split(":")
s[c[-1].strip()] = l
if "free:" in l:
c = l.split(":")
del s[c[-1].strip()]
pr... | true | true |
7904b165e3b895846a449ff76f2e4e98d5080f5d | 2,476 | py | Python | datasets/ade.py | hsfzxjy/ESSNet | 6dc2f53b074a0800c17109a1f38a010e3944d96b | [
"MIT"
] | 27 | 2020-12-12T13:34:09.000Z | 2022-03-23T07:35:32.000Z | datasets/ade.py | hsfzxjy/ESSNet | 6dc2f53b074a0800c17109a1f38a010e3944d96b | [
"MIT"
] | 6 | 2021-02-15T02:22:58.000Z | 2021-04-09T20:22:09.000Z | datasets/ade.py | hsfzxjy/ESSNet | 6dc2f53b074a0800c17109a1f38a010e3944d96b | [
"MIT"
] | 3 | 2020-12-15T09:38:51.000Z | 2021-03-21T12:23:36.000Z | from __future__ import print_function, division
import json
import torch
from torch.utils.data import Dataset
import numpy as np
import os
import sys
import collections
import torch.utils.data as data
import shutil
from PIL import Image
from torchvision.datasets.utils import download_url, check_integrity
class ADE20KD... | 36.411765 | 92 | 0.5937 | from __future__ import print_function, division
import json
import torch
from torch.utils.data import Dataset
import numpy as np
import os
import sys
import collections
import torch.utils.data as data
import shutil
from PIL import Image
from torchvision.datasets.utils import download_url, check_integrity
class ADE20KD... | true | true |
7904b168a4116b84fb89d03c6509bd216b10c0ed | 5,765 | py | Python | py/util/config.py | PurdueMINDS/MCLV-RBM | 46b1f90b52447687983113f37a5ce2c66b8f0465 | [
"Apache-2.0"
] | 4 | 2018-07-21T14:36:09.000Z | 2021-01-27T15:40:04.000Z | py/util/config.py | PurdueMINDS/MCLV-RBM | 46b1f90b52447687983113f37a5ce2c66b8f0465 | [
"Apache-2.0"
] | null | null | null | py/util/config.py | PurdueMINDS/MCLV-RBM | 46b1f90b52447687983113f37a5ce2c66b8f0465 | [
"Apache-2.0"
] | 1 | 2018-07-21T14:36:10.000Z | 2018-07-21T14:36:10.000Z | # Copyright 2017 Bruno Ribeiro, Mayank Kakodkar, Pedro Savarese
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 44.346154 | 104 | 0.580225 |
import argparse
import torch
from bean.phase import Phase
def parse_top_level_arguments():
parser = argparse.ArgumentParser(description='Fit RBM to MNIST using different gradient estimators')
parser.add_argument('--local', '-l', dest='LOCAL', action='store_const',
const... | true | true |
7904b1a75bef9f140e7eac3da786676eba0628ab | 2,032 | py | Python | archive/model_archive/ConvModel.py | Sensors-in-Paradise/OpportunityML | a123b4842de45f735d517be6bcd96ca35171db91 | [
"MIT"
] | 1 | 2022-03-25T16:00:36.000Z | 2022-03-25T16:00:36.000Z | archive/model_archive/ConvModel.py | Sensors-in-Paradise/OpportunityML | a123b4842de45f735d517be6bcd96ca35171db91 | [
"MIT"
] | 1 | 2022-03-28T13:50:28.000Z | 2022-03-28T13:50:28.000Z | archive/model_archive/ConvModel.py | Sensors-in-Paradise/OpportunityML | a123b4842de45f735d517be6bcd96ca35171db91 | [
"MIT"
] | null | null | null | from random import shuffle
from models.RainbowModelLeaveRecsOut import RainbowModelLeaveRecsOut
from tensorflow.keras.layers import Conv1D, MaxPooling1D, Flatten, Dense, Dropout # type: ignore
from tensorflow.keras.models import Sequential # type: ignore
import numpy as np
from utils.Recording import Recording
from ... | 33.311475 | 102 | 0.628937 | from random import shuffle
from models.RainbowModelLeaveRecsOut import RainbowModelLeaveRecsOut
from tensorflow.keras.layers import Conv1D, MaxPooling1D, Flatten, Dense, Dropout
from tensorflow.keras.models import Sequential
import numpy as np
from utils.Recording import Recording
from utils.array_operations impor... | true | true |
7904b1a95ec4a92851d54e13112e93ebd44a8795 | 1,130 | py | Python | setup.py | ddkwing/har2case | 6d440651c8d79228b7bf034790334e7c9406f023 | [
"MIT"
] | null | null | null | setup.py | ddkwing/har2case | 6d440651c8d79228b7bf034790334e7c9406f023 | [
"MIT"
] | null | null | null | setup.py | ddkwing/har2case | 6d440651c8d79228b7bf034790334e7c9406f023 | [
"MIT"
] | null | null | null | # encoding: utf-8
import io
from setuptools import find_packages, setup
from har2case import __version__
with io.open("README.rst", encoding='utf-8') as f:
long_description = f.read()
install_requires = open("requirements.txt").readlines()
setup(
name='har2case',
version=__version__,
description='C... | 28.25 | 83 | 0.645133 |
import io
from setuptools import find_packages, setup
from har2case import __version__
with io.open("README.rst", encoding='utf-8') as f:
long_description = f.read()
install_requires = open("requirements.txt").readlines()
setup(
name='har2case',
version=__version__,
description='Convert HAR(HTTP A... | true | true |
7904b23ee14067bfd38e03513fc61139dffd378a | 9,003 | py | Python | rasa/utils/common.py | paper2code/rasa | 2e77a0b71a2813a89bdfa60782c761fe71490722 | [
"Apache-2.0"
] | null | null | null | rasa/utils/common.py | paper2code/rasa | 2e77a0b71a2813a89bdfa60782c761fe71490722 | [
"Apache-2.0"
] | 9 | 2020-09-15T20:10:23.000Z | 2020-09-15T20:19:07.000Z | rasa/utils/common.py | karen-white/rasa | 302825e10305a995184b5c0b92fea4813cd3416e | [
"Apache-2.0"
] | null | null | null | import asyncio
import logging
import os
import shutil
import warnings
from types import TracebackType
from typing import Any, Coroutine, Dict, List, Optional, Text, Type, TypeVar
import rasa.core.utils
import rasa.utils.io
from rasa.constants import (
DEFAULT_LOG_LEVEL_LIBRARIES,
ENV_LOG_LEVEL_LIBRARIES,
)
fro... | 30.01 | 119 | 0.690103 | import asyncio
import logging
import os
import shutil
import warnings
from types import TracebackType
from typing import Any, Coroutine, Dict, List, Optional, Text, Type, TypeVar
import rasa.core.utils
import rasa.utils.io
from rasa.constants import (
DEFAULT_LOG_LEVEL_LIBRARIES,
ENV_LOG_LEVEL_LIBRARIES,
)
fro... | true | true |
7904b28224c3d7798b69b07fb4d2841d4934d390 | 11,013 | py | Python | examples/add_saml_sso_from_metadata.py | YmonOy/lastline_api | cb17088f55eef3daf107cc8ad37eee4d70422796 | [
"Apache-2.0"
] | 2 | 2017-12-30T21:58:47.000Z | 2018-02-28T13:13:30.000Z | examples/add_saml_sso_from_metadata.py | YmonOy/lastline_api | cb17088f55eef3daf107cc8ad37eee4d70422796 | [
"Apache-2.0"
] | null | null | null | examples/add_saml_sso_from_metadata.py | YmonOy/lastline_api | cb17088f55eef3daf107cc8ad37eee4d70422796 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
"""
Sample program to add SSO options to a Manager/Pinbox.
:Copyright:
Copyright 2014 Lastline, Inc. All Rights Reserved.
Created on: Dec 8, 2014 by Lukyan Hritsko
"""
import requests
import argparse
import ConfigParser
import os.path
import logging
import re
from lxml import etre... | 33.886154 | 93 | 0.579769 |
import requests
import argparse
import ConfigParser
import os.path
import logging
import re
from lxml import etree
from json import dumps
from urlparse import urlparse
from papi_client import papi_client
from papi_client import loader
class MissingValue(Exception):
pass
class InvalidXML(Exception):
pass
... | true | true |
7904b2aa6e643007a5f5761c391708fd1ac11ac3 | 3,688 | py | Python | wallux.py | Manoj-Paramsetti/Wallux | 8975b9c7e3dffc997d7dcb55f85694b5ad9d7f28 | [
"MIT"
] | 1 | 2022-01-03T14:36:02.000Z | 2022-01-03T14:36:02.000Z | wallux.py | Manoj-Paramsetti/Wallux | 8975b9c7e3dffc997d7dcb55f85694b5ad9d7f28 | [
"MIT"
] | null | null | null | wallux.py | Manoj-Paramsetti/Wallux | 8975b9c7e3dffc997d7dcb55f85694b5ad9d7f28 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import requests
os.system("clear")
print("""
██ ██ █████ ██ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ █ ██ ███████ ██ ██ ██ ██ ███
██ ███ ██ ██ ██ ██ ██ ██ ██ ██ ██
███ ███ ██ ██ ███████ ███████... | 40.086957 | 143 | 0.588124 |
import os
import requests
os.system("clear")
print("""
██ ██ █████ ██ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ █ ██ ███████ ██ ██ ██ ██ ███
██ ███ ██ ██ ██ ██ ██ ██ ██ ██ ██
███ ███ ██ ██ ███████ ███████ ██████ ██ ██
... | true | true |
7904b2ed358e366a409681b9af8d829027a8c18d | 8,140 | py | Python | pacu/modules/lightsail__generate_temp_access/main.py | damienjburks/pacu | 5853f9668a7d78945c40d403bf88a47101ba2b3d | [
"BSD-3-Clause"
] | 1 | 2021-12-22T22:39:49.000Z | 2021-12-22T22:39:49.000Z | pacu/modules/lightsail__generate_temp_access/main.py | damienjburks/pacu | 5853f9668a7d78945c40d403bf88a47101ba2b3d | [
"BSD-3-Clause"
] | null | null | null | pacu/modules/lightsail__generate_temp_access/main.py | damienjburks/pacu | 5853f9668a7d78945c40d403bf88a47101ba2b3d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import argparse
from botocore.exceptions import ClientError
import os
from pacu.core.lib import downloads_dir
module_info = {
# Name of the module (should be the same as the filename)
"name": "lightsail__generate_temp_access",
# Name and any other notes about the author
"author"... | 40.7 | 224 | 0.575553 |
import argparse
from botocore.exceptions import ClientError
import os
from pacu.core.lib import downloads_dir
module_info = {
"name": "lightsail__generate_temp_access",
"author": "Alexander Morgenstern alexander.morgenstern@rhinosecuritylabs.com",
"category": "EXPLOIT",
"one_liner... | true | true |
7904b41a53181da51a73376ea7fdd8e568e8b6c4 | 5,348 | py | Python | build/android/adb_install_apk.py | google-ar/chromium | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 777 | 2017-08-29T15:15:32.000Z | 2022-03-21T05:29:41.000Z | build/android/adb_install_apk.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 66 | 2017-08-30T18:31:18.000Z | 2021-08-02T10:59:35.000Z | build/android/adb_install_apk.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 123 | 2017-08-30T01:19:34.000Z | 2022-03-17T22:55:31.000Z | #!/usr/bin/env python
#
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility script to install APKs from the command line quickly."""
import argparse
import glob
import logging
import os
import ... | 40.210526 | 80 | 0.618923 |
import argparse
import glob
import logging
import os
import sys
import devil_chromium
from devil.android import apk_helper
from devil.android import device_blacklist
from devil.android import device_errors
from devil.android import device_utils
from devil.utils import run_tests_helper
from pylib import constant... | true | true |
7904b43875f56a776f055dd0752c594e08d497aa | 7,246 | py | Python | ml/train_net.py | brungcm/health-hack-2019 | 3f537ea40ceefdcf5f3044b6931bfa3951c351f7 | [
"MIT"
] | null | null | null | ml/train_net.py | brungcm/health-hack-2019 | 3f537ea40ceefdcf5f3044b6931bfa3951c351f7 | [
"MIT"
] | null | null | null | ml/train_net.py | brungcm/health-hack-2019 | 3f537ea40ceefdcf5f3044b6931bfa3951c351f7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import tensorflow as tf
import logging
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
import argparse
from aquaman_net import AquamanNet
from utils import IMAGE_SIZE
EPOCHS = 1000
BATCH_SIZE = 4
def preproc(image_bytes):
image_jpg = tf.image.d... | 32.63964 | 109 | 0.637593 |
import tensorflow as tf
import logging
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
import argparse
from aquaman_net import AquamanNet
from utils import IMAGE_SIZE
EPOCHS = 1000
BATCH_SIZE = 4
def preproc(image_bytes):
image_jpg = tf.image.decode_jpeg(image_bytes,... | true | true |
7904b4459d529e374c9aba9733d3f3df8c17f078 | 299 | py | Python | picscope/urls.py | yeaske/picscope | efb38459631b7aee8b2db4f38da1f437c2d96ad8 | [
"MIT"
] | null | null | null | picscope/urls.py | yeaske/picscope | efb38459631b7aee8b2db4f38da1f437c2d96ad8 | [
"MIT"
] | null | null | null | picscope/urls.py | yeaske/picscope | efb38459631b7aee8b2db4f38da1f437c2d96ad8 | [
"MIT"
] | null | null | null | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'picscope.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
)
| 23 | 53 | 0.652174 | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
)
| true | true |
7904b50baf488b7d1514f62d0a16210c6ad537bd | 5,303 | py | Python | tencentcloud/ims/v20200713/ims_client.py | dyllllll/tencentcloud-sdk-python | 677424361ec00927a52fd3c6d5110c4de5737449 | [
"Apache-2.0"
] | 2 | 2021-07-10T09:40:16.000Z | 2022-02-04T09:01:22.000Z | tencentcloud/ims/v20200713/ims_client.py | dyllllll/tencentcloud-sdk-python | 677424361ec00927a52fd3c6d5110c4de5737449 | [
"Apache-2.0"
] | null | null | null | tencentcloud/ims/v20200713/ims_client.py | dyllllll/tencentcloud-sdk-python | 677424361ec00927a52fd3c6d5110c4de5737449 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf8 -*-
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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... | 42.087302 | 204 | 0.613426 |
import json
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.common.abstract_client import AbstractClient
from tencentcloud.ims.v20200713 import models
class ImsClient(AbstractClient):
_apiVersion = '2020-07-13'
_endpoint = 'ims.t... | true | true |
7904b57c4115b987aa10e92260dce68694256203 | 5,124 | py | Python | satchmo/newsletter/mailman.py | sankroh/satchmo | e48df0c2a4be4ce14785d0a5d6dd1e516c57a838 | [
"BSD-3-Clause"
] | 1 | 2016-05-09T12:21:04.000Z | 2016-05-09T12:21:04.000Z | satchmo/newsletter/mailman.py | sankroh/satchmo | e48df0c2a4be4ce14785d0a5d6dd1e516c57a838 | [
"BSD-3-Clause"
] | null | null | null | satchmo/newsletter/mailman.py | sankroh/satchmo | e48df0c2a4be4ce14785d0a5d6dd1e516c57a838 | [
"BSD-3-Clause"
] | null | null | null | """A Mailman newsletter subscription interface.
To use this plugin, enable the newsletter module and set the newsletter module and name settings
in the admin settings page.
"""
from django.utils.translation import ugettext as _
from Mailman import MailList, Errors
from models import Subscription
from satchmo.configur... | 34.621622 | 119 | 0.62178 |
from django.utils.translation import ugettext as _
from Mailman import MailList, Errors
from models import Subscription
from satchmo.configuration import config_value
import logging
import sys
log = logging.getLogger('newsletter.mailman')
class UserDesc: pass
def is_subscribed(contact):
return Subscription.emai... | true | true |
7904b5d0340a5014924842d37fa20c59899899eb | 1,049 | py | Python | runtime/image_classification/models/vgg16/gpus=16_straight/stage5.py | NestLakerJasonLIN/pipedream | f50827f2e28cbdbd82a4ea686c0498272b1460d6 | [
"MIT"
] | 273 | 2019-08-31T14:12:11.000Z | 2022-03-05T13:34:25.000Z | runtime/image_classification/models/vgg16/gpus=16_straight/stage5.py | albertsh10/pipedream | cad624f79a71f44ba79099f0c38321347b13e5c2 | [
"MIT"
] | 67 | 2019-09-19T15:36:59.000Z | 2022-01-13T09:11:54.000Z | runtime/image_classification/models/vgg16/gpus=16_straight/stage5.py | albertsh10/pipedream | cad624f79a71f44ba79099f0c38321347b13e5c2 | [
"MIT"
] | 100 | 2019-09-16T20:59:14.000Z | 2022-03-23T12:56:56.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import torch
class Stage5(torch.nn.Module):
def __init__(self):
super(Stage5, self).__init__()
self.layer1 = torch.nn.Conv2d(64, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
self._initialize_weights()
... | 34.966667 | 97 | 0.585319 |
import torch
class Stage5(torch.nn.Module):
def __init__(self):
super(Stage5, self).__init__()
self.layer1 = torch.nn.Conv2d(64, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
self._initialize_weights()
def forward(self, input0):
out0 = input0.clone()
out1 ... | true | true |
7904b5e587db74f3b24656b9c3e16df5d33013fc | 172 | py | Python | labs/lab2.py | sw33tr0ll/aws-training | db071a1592c717b1edd1786fa4d9ae07a51ecf1e | [
"MIT"
] | 2 | 2020-08-12T05:36:25.000Z | 2020-08-12T17:12:17.000Z | labs/lab2.py | sw33tr0ll/aws-training | db071a1592c717b1edd1786fa4d9ae07a51ecf1e | [
"MIT"
] | null | null | null | labs/lab2.py | sw33tr0ll/aws-training | db071a1592c717b1edd1786fa4d9ae07a51ecf1e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import boto3
s3_client = boto3.client('s3')
raw_response = s3_client.list_buckets()
for bucket in raw_response['Buckets']:
print(bucket['Name'])
| 24.571429 | 39 | 0.738372 |
import boto3
s3_client = boto3.client('s3')
raw_response = s3_client.list_buckets()
for bucket in raw_response['Buckets']:
print(bucket['Name'])
| true | true |
7904b63a049f8fc242f82641fda19c361cd92ba7 | 186 | py | Python | config.py | matale14/api-blueprint | fdeb31fdac48ef1d0fdfd68fe17cbb0b7f2470ec | [
"MIT"
] | null | null | null | config.py | matale14/api-blueprint | fdeb31fdac48ef1d0fdfd68fe17cbb0b7f2470ec | [
"MIT"
] | null | null | null | config.py | matale14/api-blueprint | fdeb31fdac48ef1d0fdfd68fe17cbb0b7f2470ec | [
"MIT"
] | null | null | null | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
#SESSION_COOKIE_SECURE = True
SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess'
| 26.571429 | 68 | 0.763441 | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess'
| true | true |
7904b72dd954318ac996a1568fb8a6aab0bfa2ab | 13,280 | py | Python | django/core/management/templates.py | skyl/django | 843e7450ddcb820b2bdc6d47d6c4aab9820a46c4 | [
"BSD-3-Clause"
] | 1 | 2021-11-22T17:41:19.000Z | 2021-11-22T17:41:19.000Z | django/core/management/templates.py | skyl/django | 843e7450ddcb820b2bdc6d47d6c4aab9820a46c4 | [
"BSD-3-Clause"
] | null | null | null | django/core/management/templates.py | skyl/django | 843e7450ddcb820b2bdc6d47d6c4aab9820a46c4 | [
"BSD-3-Clause"
] | 1 | 2020-06-03T07:55:20.000Z | 2020-06-03T07:55:20.000Z | import cgi
import errno
import mimetypes
import os
import posixpath
import re
import shutil
import stat
import sys
import tempfile
try:
from urllib.request import urlretrieve
except ImportError: # Python 2
from urllib import urlretrieve
from optparse import make_option
from os import path
import django
fr... | 40.364742 | 81 | 0.565437 | import cgi
import errno
import mimetypes
import os
import posixpath
import re
import shutil
import stat
import sys
import tempfile
try:
from urllib.request import urlretrieve
except ImportError:
from urllib import urlretrieve
from optparse import make_option
from os import path
import django
from django.... | true | true |
7904b778d9b92de92c48d8a78e68442549089945 | 1,328 | py | Python | posts/models.py | SergeyKorobenkov/hw05_final | 6ab9c2a3cb5eaa319860fa3e2947ea664db6016d | [
"MIT"
] | null | null | null | posts/models.py | SergeyKorobenkov/hw05_final | 6ab9c2a3cb5eaa319860fa3e2947ea664db6016d | [
"MIT"
] | 8 | 2021-04-08T21:57:32.000Z | 2022-02-10T10:49:21.000Z | posts/models.py | SergeyKorobenkov/hw05_final | 6ab9c2a3cb5eaa319860fa3e2947ea664db6016d | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth import get_user_model
User = get_user_model()
class Group(models.Model):
title = models.CharField(max_length=200)
slug = models.SlugField(unique=True)
description = models.TextField()
class Post(models.Model):
text = models.TextField()
pub_d... | 36.888889 | 119 | 0.743223 | from django.db import models
from django.contrib.auth import get_user_model
User = get_user_model()
class Group(models.Model):
title = models.CharField(max_length=200)
slug = models.SlugField(unique=True)
description = models.TextField()
class Post(models.Model):
text = models.TextField()
pub_d... | true | true |
7904b816d584f80681ac44108e8d394e8df61fe7 | 8,558 | py | Python | config/settings/production.py | Musyimi97/veritasLtd | 5f764eb6fad87de3419ce85461467c402e8e74ca | [
"MIT"
] | 1 | 2019-08-03T16:42:10.000Z | 2019-08-03T16:42:10.000Z | config/settings/production.py | Musyimi97/veritasLtd | 5f764eb6fad87de3419ce85461467c402e8e74ca | [
"MIT"
] | 6 | 2020-06-05T22:25:15.000Z | 2021-06-09T18:25:38.000Z | config/settings/production.py | Musyimi97/veritasLtd | 5f764eb6fad87de3419ce85461467c402e8e74ca | [
"MIT"
] | null | null | null | import logging
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
from sentry_sdk.integrations.logging import LoggingIntegration
from sentry_sdk.integrations.celery import CeleryIntegration
from .base import * # noqa
from .base import env
# GENERAL
# -----------------------------------... | 39.256881 | 89 | 0.6276 | import logging
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
from sentry_sdk.integrations.logging import LoggingIntegration
from sentry_sdk.integrations.celery import CeleryIntegration
from .base import *
from .base import env
= env("DJANGO_SECRET_KEY")
= env.list("DJANGO_ALL... | true | true |
7904b86d8abe58e7e4529517770077d8ca8f90b5 | 140 | py | Python | metrics/outputs/__init__.py | sebMathieu/code_metrics | f188041c8f2c0950c5f63a1f719cdb05aaeb42c9 | [
"MIT"
] | null | null | null | metrics/outputs/__init__.py | sebMathieu/code_metrics | f188041c8f2c0950c5f63a1f719cdb05aaeb42c9 | [
"MIT"
] | null | null | null | metrics/outputs/__init__.py | sebMathieu/code_metrics | f188041c8f2c0950c5f63a1f719cdb05aaeb42c9 | [
"MIT"
] | null | null | null | """
Output formats.
"""
from .rst import RST
from .console import Console
from .json import JSON
from .svg import SVG
from .png import PNG
| 14 | 28 | 0.735714 |
from .rst import RST
from .console import Console
from .json import JSON
from .svg import SVG
from .png import PNG
| true | true |
7904b8a2cdca64039dc37b164ff5dca05d0dc8cc | 319 | py | Python | admob/config.py | Mavhod/GodotAdmob | d603f259fba414f22fc6e3ea977cbcdc36ef460e | [
"MIT"
] | 76 | 2015-02-12T15:25:34.000Z | 2021-11-05T03:48:54.000Z | admob/config.py | Mavhod/GodotAdmob | d603f259fba414f22fc6e3ea977cbcdc36ef460e | [
"MIT"
] | 5 | 2016-01-18T02:58:52.000Z | 2016-12-16T16:03:26.000Z | admob/config.py | Mavhod/GodotAdmob | d603f259fba414f22fc6e3ea977cbcdc36ef460e | [
"MIT"
] | 26 | 2015-01-28T21:25:02.000Z | 2020-11-20T12:31:30.000Z | def can_build(plat):
return plat=="android"
def configure(env):
if (env['platform'] == 'android'):
env.android_add_dependency("compile 'com.google.android.gms:play-services-ads:8.3.0'")
env.android_add_java_dir("android")
env.android_add_to_manifest("android/AndroidManifestChunk.xml")
env.disable_module()
| 29 | 88 | 0.752351 | def can_build(plat):
return plat=="android"
def configure(env):
if (env['platform'] == 'android'):
env.android_add_dependency("compile 'com.google.android.gms:play-services-ads:8.3.0'")
env.android_add_java_dir("android")
env.android_add_to_manifest("android/AndroidManifestChunk.xml")
env.disable_module()
| true | true |
7904b8e33c31f6d92956725446e35ad01c19f1d0 | 861 | py | Python | src/scan_pdf/combine.py | wuan/scan_pdf | ebac89ff0c7be9266142904946b41f0f05e07413 | [
"Apache-2.0"
] | null | null | null | src/scan_pdf/combine.py | wuan/scan_pdf | ebac89ff0c7be9266142904946b41f0f05e07413 | [
"Apache-2.0"
] | null | null | null | src/scan_pdf/combine.py | wuan/scan_pdf | ebac89ff0c7be9266142904946b41f0f05e07413 | [
"Apache-2.0"
] | null | null | null | import logging
import os
import subprocess
logger = logging.getLogger(__name__)
class Combiner(object):
def __init__(self, options):
self.options = options
def combine(self, page_file_names):
output_file_name = self.options.output_file_name[0]
logger.info("combine %d pages into %s",... | 29.689655 | 87 | 0.663182 | import logging
import os
import subprocess
logger = logging.getLogger(__name__)
class Combiner(object):
def __init__(self, options):
self.options = options
def combine(self, page_file_names):
output_file_name = self.options.output_file_name[0]
logger.info("combine %d pages into %s",... | true | true |
7904b9125f4918bcc6cf4c739f53a33485849458 | 2,383 | py | Python | lightning_conceptnet/nodes.py | ldtoolkit/lightning-conceptnet | f2be7209ef90f98c08df23892529227a2a45882e | [
"Apache-2.0"
] | null | null | null | lightning_conceptnet/nodes.py | ldtoolkit/lightning-conceptnet | f2be7209ef90f98c08df23892529227a2a45882e | [
"Apache-2.0"
] | null | null | null | lightning_conceptnet/nodes.py | ldtoolkit/lightning-conceptnet | f2be7209ef90f98c08df23892529227a2a45882e | [
"Apache-2.0"
] | null | null | null | from lightning_conceptnet.uri import concept_uri
from wordfreq import simple_tokenize
from wordfreq.preprocess import preprocess_text
STOPWORDS = [
'the', 'a', 'an'
]
DROP_FIRST = ['to']
def english_filter(tokens):
"""
Given a list of tokens, remove a small list of English stopwords.
"""
non_st... | 34.042857 | 79 | 0.684431 | from lightning_conceptnet.uri import concept_uri
from wordfreq import simple_tokenize
from wordfreq.preprocess import preprocess_text
STOPWORDS = [
'the', 'a', 'an'
]
DROP_FIRST = ['to']
def english_filter(tokens):
non_stopwords = [token for token in tokens if token not in STOPWORDS]
while non_stopword... | true | true |
7904b91e96d8e96213fffe27a374d056ae9b25f2 | 4,573 | py | Python | deploy_gh_pages.py | follower/docs | bf920c47ae46cdc4f9f984fa8b6fdaa733749222 | [
"MIT"
] | null | null | null | deploy_gh_pages.py | follower/docs | bf920c47ae46cdc4f9f984fa8b6fdaa733749222 | [
"MIT"
] | null | null | null | deploy_gh_pages.py | follower/docs | bf920c47ae46cdc4f9f984fa8b6fdaa733749222 | [
"MIT"
] | 1 | 2021-01-26T15:19:11.000Z | 2021-01-26T15:19:11.000Z | import json
import os
import shutil
import tempfile
def copytree(src, dst, symlinks=False, ignore=None):
for item in os.listdir(src):
s = os.path.join(src, item)
d = os.path.join(dst, item)
if os.path.isdir(s):
shutil.copytree(s, d, symlinks, ignore)
else:
s... | 31.321918 | 98 | 0.535535 | import json
import os
import shutil
import tempfile
def copytree(src, dst, symlinks=False, ignore=None):
for item in os.listdir(src):
s = os.path.join(src, item)
d = os.path.join(dst, item)
if os.path.isdir(s):
shutil.copytree(s, d, symlinks, ignore)
else:
s... | true | true |
7904b9a4efc32f95ac981147d443811bf80d46e4 | 684 | py | Python | dags/test_dag_failure.py | GrokData/grok-airflow-dags | 545c2fb9bc1a3653b0df5e112e1c672d1b3558f0 | [
"MIT"
] | null | null | null | dags/test_dag_failure.py | GrokData/grok-airflow-dags | 545c2fb9bc1a3653b0df5e112e1c672d1b3558f0 | [
"MIT"
] | null | null | null | dags/test_dag_failure.py | GrokData/grok-airflow-dags | 545c2fb9bc1a3653b0df5e112e1c672d1b3558f0 | [
"MIT"
] | 1 | 2021-09-24T02:57:48.000Z | 2021-09-24T02:57:48.000Z | import datetime as dt
from airflow.models import DAG
from airflow.operators.dummy import DummyOperator
from airflow.operators.python import PythonOperator
default_args = {
'start_date': dt.datetime.now() - dt.timedelta(days=7),
'owner': 'airflow'
}
def throw_error():
raise Exception('It failed!')
with... | 23.586207 | 148 | 0.717836 | import datetime as dt
from airflow.models import DAG
from airflow.operators.dummy import DummyOperator
from airflow.operators.python import PythonOperator
default_args = {
'start_date': dt.datetime.now() - dt.timedelta(days=7),
'owner': 'airflow'
}
def throw_error():
raise Exception('It failed!')
with... | true | true |
7904b9ec43363d65c6c7499691923c70ca846c82 | 781 | py | Python | setup.oci.py | busunkim96/cc-utils | aa864b1fad3061410907d6b93b8aee8cd25f33b5 | [
"Apache-2.0"
] | 15 | 2018-04-18T13:25:30.000Z | 2022-03-04T09:25:41.000Z | setup.oci.py | busunkim96/cc-utils | aa864b1fad3061410907d6b93b8aee8cd25f33b5 | [
"Apache-2.0"
] | 221 | 2018-04-12T06:29:43.000Z | 2022-03-27T03:01:40.000Z | setup.oci.py | busunkim96/cc-utils | aa864b1fad3061410907d6b93b8aee8cd25f33b5 | [
"Apache-2.0"
] | 29 | 2018-04-11T14:42:23.000Z | 2021-11-09T16:26:32.000Z | import setuptools
import os
own_dir = os.path.abspath(os.path.dirname(__file__))
def requirements():
with open(os.path.join(own_dir, 'requirements.oci.txt')) as f:
for line in f.readlines():
line = line.strip()
if not line or line.startswith('#'):
continue
... | 19.04878 | 66 | 0.583867 | import setuptools
import os
own_dir = os.path.abspath(os.path.dirname(__file__))
def requirements():
with open(os.path.join(own_dir, 'requirements.oci.txt')) as f:
for line in f.readlines():
line = line.strip()
if not line or line.startswith('#'):
continue
... | true | true |
7904badcd2a11493ff4f9fd979f7602edbf8b9e7 | 806 | py | Python | yamlHighlighter.py | ShardulNalegave/pycode | 6050c3c44dad4c460ecea32352429bc463ac8009 | [
"MIT"
] | 5 | 2018-06-02T11:07:07.000Z | 2020-10-27T00:26:54.000Z | yamlHighlighter.py | ShardulNalegave/pycode | 6050c3c44dad4c460ecea32352429bc463ac8009 | [
"MIT"
] | null | null | null | yamlHighlighter.py | ShardulNalegave/pycode | 6050c3c44dad4c460ecea32352429bc463ac8009 | [
"MIT"
] | 1 | 2020-08-16T14:38:40.000Z | 2020-08-16T14:38:40.000Z |
import wx.stc as stc
def highlight(editor, styles, faces):
editor.SetLexer(stc.STC_LEX_YAML)
editor.StyleSetSpec(stc.STC_YAML_DEFAULT, "fore:" +
styles["default"] + ",face:%(helv)s,size:%(size)d" % faces)
editor.StyleSetSpec(stc.STC_YAML_COMMENT, "fore:" +
... | 35.043478 | 86 | 0.569479 |
import wx.stc as stc
def highlight(editor, styles, faces):
editor.SetLexer(stc.STC_LEX_YAML)
editor.StyleSetSpec(stc.STC_YAML_DEFAULT, "fore:" +
styles["default"] + ",face:%(helv)s,size:%(size)d" % faces)
editor.StyleSetSpec(stc.STC_YAML_COMMENT, "fore:" +
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.