hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
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 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f766fbea4992f2497bb14351a4b89f1b07867374 | 16,157 | py | Python | superannotate/annotation_helpers.py | dskkato/superannotate-python-sdk | 67eece2d7d06375ad2e502c2282e3b29c9b82631 | [
"MIT"
] | null | null | null | superannotate/annotation_helpers.py | dskkato/superannotate-python-sdk | 67eece2d7d06375ad2e502c2282e3b29c9b82631 | [
"MIT"
] | null | null | null | superannotate/annotation_helpers.py | dskkato/superannotate-python-sdk | 67eece2d7d06375ad2e502c2282e3b29c9b82631 | [
"MIT"
] | null | null | null | """SuperAnnotate format annotation JSON helpers"""
import json
from .exceptions import SABaseException
def fill_in_missing(annotation_json):
for field in ["instances", "comments", "tags"]:
if field not in annotation_json:
annotation_json[field] = []
if "metadata" not in annotation_json:
... | 31.131021 | 120 | 0.618122 |
import json
from .exceptions import SABaseException
def fill_in_missing(annotation_json):
for field in ["instances", "comments", "tags"]:
if field not in annotation_json:
annotation_json[field] = []
if "metadata" not in annotation_json:
annotation_json["metadata"] = {}
def _pre... | true | true |
f766fca3322dcd90585f97dd21894f68de9c8cb3 | 14,042 | py | Python | test/functional/p2p_unrequested_blocks.py | Blockchain-Solutions-BCS/bcschain-core | 70091ad8005f49c7fb6218e31c6f8007210fbbaf | [
"MIT"
] | 1 | 2020-03-07T19:49:44.000Z | 2020-03-07T19:49:44.000Z | test/functional/p2p_unrequested_blocks.py | Blockchain-Solutions-BCS/bcschain-core | 70091ad8005f49c7fb6218e31c6f8007210fbbaf | [
"MIT"
] | null | null | null | test/functional/p2p_unrequested_blocks.py | Blockchain-Solutions-BCS/bcschain-core | 70091ad8005f49c7fb6218e31c6f8007210fbbaf | [
"MIT"
] | 1 | 2020-01-27T10:27:12.000Z | 2020-01-27T10:27:12.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Core developers
# Copyright (c) 2017-2020 The Qtum Core developers
# Copyright (c) 2020 The BCS Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test ... | 45.00641 | 113 | 0.683307 |
import time
from test_framework.blocktools import create_block, create_coinbase, create_tx_with_script
from test_framework.messages import CBlockHeader, CInv, msg_block, msg_headers, msg_inv
from test_framework.mininode import mininode_lock, P2PInterface
from test_framework.test_framework import BitcoinTestFramework
... | true | true |
f766fd33b594d1b71e9d7692d19bfffb3231c5d5 | 1,473 | py | Python | Week5/intSet.py | Sid2697/MIT-6.00.1x | 70514740701890d008e42af2b8662c57f762760b | [
"MIT"
] | 3 | 2018-02-12T11:24:13.000Z | 2021-01-27T07:15:16.000Z | Week5/intSet.py | Sid2697/MIT-6.00.1x | 70514740701890d008e42af2b8662c57f762760b | [
"MIT"
] | null | null | null | Week5/intSet.py | Sid2697/MIT-6.00.1x | 70514740701890d008e42af2b8662c57f762760b | [
"MIT"
] | null | null | null | class intSet(object):
"""An intSet is a set of integers
The value is represented by a list of ints, self.vals.
Each int in the set occurs in self.vals exactly once."""
def __init__(self):
"""Create an empty set of integers"""
self.vals = []
def insert(self, e):
"""Assumes e... | 28.882353 | 73 | 0.535642 | class intSet(object):
def __init__(self):
self.vals = []
def insert(self, e):
if not e in self.vals:
self.vals.append(e)
def member(self, e):
return e in self.vals
def remove(self, e):
try:
self.vals.remove(e)
except:
raise ... | true | true |
f766fd7f99aed56dde14f08ff00d4f5ec962457c | 11,438 | py | Python | services/core/MasterDriverAgent/master_driver/interfaces/bacnet.py | hashstat/volttron | 7c75a18dd02370718156798a909e21a3e4e8cc99 | [
"Apache-2.0"
] | 1 | 2021-04-20T12:03:36.000Z | 2021-04-20T12:03:36.000Z | services/core/MasterDriverAgent/master_driver/interfaces/bacnet.py | hashstat/volttron | 7c75a18dd02370718156798a909e21a3e4e8cc99 | [
"Apache-2.0"
] | null | null | null | services/core/MasterDriverAgent/master_driver/interfaces/bacnet.py | hashstat/volttron | 7c75a18dd02370718156798a909e21a3e4e8cc99 | [
"Apache-2.0"
] | 1 | 2018-08-14T23:28:10.000Z | 2018-08-14T23:28:10.000Z |
# Copyright (c) 2017, Battelle Memorial Institute
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of c... | 43.823755 | 127 | 0.642507 |
from master_driver.interfaces import BaseInterface, BaseRegister
from csv import DictReader
from StringIO import StringIO
import logging
from datetime import datetime, timedelta
from master_driver.driver_exceptions import DriverConfigError
from volttron.platform.vip.agent import errors
from volttron.platform.jsonr... | true | true |
f766fe1fc57ecbfb2a16d34d5ab13b0560456b0c | 4,797 | py | Python | sdk/python/pulumi_azure_native/migrate/v20180901preview/get_migrate_project.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/migrate/v20180901preview/get_migrate_project.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/migrate/v20180901preview/get_migrate_project.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 33.082759 | 150 | 0.633521 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'GetMigrateProjectResult',
'AwaitableGetMigrateProjectResult',
'get_migrate_project',
]
@pulumi.output_type
class GetMigrate... | true | true |
f766fe5b0c92f3c0745d92622a0da18596b559d2 | 27,915 | py | Python | object_detection/metrics/coco_evaluation.py | gourav108/coreml | 6bc2d494dff23cff923368e735992a4f4a47483c | [
"MIT"
] | 14 | 2018-06-26T09:40:19.000Z | 2022-01-24T00:12:07.000Z | object_detection/metrics/coco_evaluation.py | gourav108/coreml | 6bc2d494dff23cff923368e735992a4f4a47483c | [
"MIT"
] | 2 | 2018-05-30T16:56:49.000Z | 2018-07-23T22:55:43.000Z | object_detection/metrics/coco_evaluation.py | gourav108/coreml | 6bc2d494dff23cff923368e735992a4f4a47483c | [
"MIT"
] | 7 | 2018-06-08T05:53:01.000Z | 2020-06-09T12:23:44.000Z | # Copyright 2017 The TensorFlow 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 applica... | 47.636519 | 80 | 0.66355 | import numpy as np
import tensorflow as tf
from core import standard_fields
from metrics import coco_tools
from utils import object_detection_evaluation
class CocoDetectionEvaluator(object_detection_evaluation.DetectionEvaluator):
def __init__(self,
categories,
include_metrics_per_ca... | true | true |
f766ff2c2423bae00bbd9b7942831f1696405ff1 | 179 | bzl | Python | owners-common/common.bzl | pivonroll/Gerrit-Owners | 741b3fc6dedec50a94b3bfb5cab903ea8e12b487 | [
"Apache-2.0"
] | null | null | null | owners-common/common.bzl | pivonroll/Gerrit-Owners | 741b3fc6dedec50a94b3bfb5cab903ea8e12b487 | [
"Apache-2.0"
] | null | null | null | owners-common/common.bzl | pivonroll/Gerrit-Owners | 741b3fc6dedec50a94b3bfb5cab903ea8e12b487 | [
"Apache-2.0"
] | null | null | null | EXTERNAL_DEPS = [
"@jackson-core//jar:neverlink",
"@jackson-databind//jar",
"@jackson-annotations//jar",
"@jackson-dataformat-yaml//jar",
"@snakeyaml//jar",
]
| 22.375 | 36 | 0.620112 | EXTERNAL_DEPS = [
"@jackson-core//jar:neverlink",
"@jackson-databind//jar",
"@jackson-annotations//jar",
"@jackson-dataformat-yaml//jar",
"@snakeyaml//jar",
]
| true | true |
f766ffcee5f63bac7054d013fc5dfc34a5cee791 | 955 | py | Python | rlcard/agents/__init__.py | randombenj/rlcard | 0948035d26e1b619c068360326f12451f5d28f8b | [
"MIT"
] | 1,735 | 2019-09-05T12:49:43.000Z | 2022-03-30T12:02:07.000Z | rlcard/agents/__init__.py | randombenj/rlcard | 0948035d26e1b619c068360326f12451f5d28f8b | [
"MIT"
] | 197 | 2019-09-14T05:59:02.000Z | 2022-03-03T19:21:19.000Z | rlcard/agents/__init__.py | randombenj/rlcard | 0948035d26e1b619c068360326f12451f5d28f8b | [
"MIT"
] | 476 | 2019-09-13T15:25:32.000Z | 2022-03-29T01:41:29.000Z | import subprocess
import sys
from distutils.version import LooseVersion
reqs = subprocess.check_output([sys.executable, '-m', 'pip', 'freeze'])
installed_packages = [r.decode().split('==')[0] for r in reqs.split()]
if 'torch' in installed_packages:
from rlcard.agents.dqn_agent import DQNAgent as DQNAgent
from... | 50.263158 | 103 | 0.845026 | import subprocess
import sys
from distutils.version import LooseVersion
reqs = subprocess.check_output([sys.executable, '-m', 'pip', 'freeze'])
installed_packages = [r.decode().split('==')[0] for r in reqs.split()]
if 'torch' in installed_packages:
from rlcard.agents.dqn_agent import DQNAgent as DQNAgent
from... | true | true |
f767005487cb4c89b85a341beee8d9fed44f1b9b | 9,181 | py | Python | aqtools/getAQMeshData.py | cemac/UNRESP_AQSensorTools | 0c73eb48ccd1680da866dc344ab22bc40ef899fb | [
"MIT"
] | null | null | null | aqtools/getAQMeshData.py | cemac/UNRESP_AQSensorTools | 0c73eb48ccd1680da866dc344ab22bc40ef899fb | [
"MIT"
] | 1 | 2019-03-07T11:06:55.000Z | 2019-03-07T11:06:55.000Z | aqtools/getAQMeshData.py | cemac/UNRESP_AQSensorTools | 0c73eb48ccd1680da866dc344ab22bc40ef899fb | [
"MIT"
] | 1 | 2021-06-22T19:23:25.000Z | 2021-06-22T19:23:25.000Z | #!/usr/bin/env python
"""
Script name: getAQMeshData.py
Author: JO'N/ CEMAC (University of Leeds)
Date: March 2018
Purpose: Download data from an AQMesh pod using the API tool
Usage: ./getAQMeshData.py <stationID> <startDate> <endDate> <variables> <outFreq>
<stationID> - Unique ID of the AQMesh station from whi... | 49.360215 | 199 | 0.614966 |
import pandas as pd
from pandas.io.json import json_normalize
import json
import requests
from dateutil.parser import parse
import pytz
import datetime as dt
import os
def main(stationID, startDate, endDate, variables, outFreq):
pyDir = os.path.dirname(os.path.realpath(__file__))
allFreqs = ['all', 'da... | true | true |
f76700b74d4a59c111e1a140f66744907c772c14 | 3,764 | py | Python | model/model_se_spec/basic.py | Tommy-Liu/MovieQA_Contest | 4281bf4a731aa14a0d19f18adda31d59a4a297cb | [
"MIT"
] | null | null | null | model/model_se_spec/basic.py | Tommy-Liu/MovieQA_Contest | 4281bf4a731aa14a0d19f18adda31d59a4a297cb | [
"MIT"
] | null | null | null | model/model_se_spec/basic.py | Tommy-Liu/MovieQA_Contest | 4281bf4a731aa14a0d19f18adda31d59a4a297cb | [
"MIT"
] | null | null | null | import tensorflow as tf
import utils.model_utils as mu
from model.basic_model import BasicModel
from raw_input import Input
class SetupModel(BasicModel):
def __init__(self, attn, checkpoint):
super(SetupModel, self).__init__()
self.data = Input()
self.output = None
self.saver = No... | 43.264368 | 109 | 0.650903 | import tensorflow as tf
import utils.model_utils as mu
from model.basic_model import BasicModel
from raw_input import Input
class SetupModel(BasicModel):
def __init__(self, attn, checkpoint):
super(SetupModel, self).__init__()
self.data = Input()
self.output = None
self.saver = No... | true | true |
f767022a25e5d144bf3d372a3ee087bc6d283818 | 395 | py | Python | 2161-partition-array-according-to-given-pivot/2161-partition-array-according-to-given-pivot.py | Dawit-Getachew/A2SV_Practice | 2fe06d725e0acfe668c6dae98fe3ef6e6e26ef61 | [
"MIT"
] | null | null | null | 2161-partition-array-according-to-given-pivot/2161-partition-array-according-to-given-pivot.py | Dawit-Getachew/A2SV_Practice | 2fe06d725e0acfe668c6dae98fe3ef6e6e26ef61 | [
"MIT"
] | null | null | null | 2161-partition-array-according-to-given-pivot/2161-partition-array-according-to-given-pivot.py | Dawit-Getachew/A2SV_Practice | 2fe06d725e0acfe668c6dae98fe3ef6e6e26ef61 | [
"MIT"
] | null | null | null | class Solution:
def pivotArray(self, nums: List[int], pivot: int) -> List[int]:
great = []
small = []
equal = []
for num in nums:
if num > pivot:
great.append(num)
elif num < pivot:
small.append(num)
else:
... | 28.214286 | 67 | 0.435443 | class Solution:
def pivotArray(self, nums: List[int], pivot: int) -> List[int]:
great = []
small = []
equal = []
for num in nums:
if num > pivot:
great.append(num)
elif num < pivot:
small.append(num)
else:
... | true | true |
f767032ef23ce443bd076456a02d1b226a45bac0 | 26,218 | py | Python | celery/tests/worker/test_request.py | stratoukos/celery | da9c0bad1f52515a70ae28d48abddbf42571a39f | [
"BSD-3-Clause"
] | 1 | 2015-12-02T17:12:09.000Z | 2015-12-02T17:12:09.000Z | celery/tests/worker/test_request.py | stratoukos/celery | da9c0bad1f52515a70ae28d48abddbf42571a39f | [
"BSD-3-Clause"
] | null | null | null | celery/tests/worker/test_request.py | stratoukos/celery | da9c0bad1f52515a70ae28d48abddbf42571a39f | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import with_statement
import anyjson
import os
import sys
import time
from datetime import datetime, timedelta
from kombu.transport.base import Message
from kombu.utils.encoding import from_utf8, default_encode
from mock import Mock, patc... | 34.049351 | 77 | 0.572965 | from __future__ import absolute_import
from __future__ import with_statement
import anyjson
import os
import sys
import time
from datetime import datetime, timedelta
from kombu.transport.base import Message
from kombu.utils.encoding import from_utf8, default_encode
from mock import Mock, patch
from nose import SkipT... | false | true |
f7670342e63384a8a144cbf4ad02eb82d367dd20 | 9,578 | py | Python | model.py | JONGHYEOK667/Udacity_SelfDrivingCar_P4 | 6cee1afbd33d704fd594c40ce80c893024f6d022 | [
"MIT"
] | null | null | null | model.py | JONGHYEOK667/Udacity_SelfDrivingCar_P4 | 6cee1afbd33d704fd594c40ce80c893024f6d022 | [
"MIT"
] | null | null | null | model.py | JONGHYEOK667/Udacity_SelfDrivingCar_P4 | 6cee1afbd33d704fd594c40ce80c893024f6d022 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# ---
# In[1]: Setting GPU w/ Tensorflow running
import tensorflow as tf
print(tf.__version__)
import keras
print(keras.__version__)
gpus = tf.config.experimental.list_physical_devices('GPU')
if gpus:
try:
# Currently, memory growth needs to be the same across GPUs
... | 26.679666 | 131 | 0.680622 |
import tensorflow as tf
print(tf.__version__)
import keras
print(keras.__version__)
gpus = tf.config.experimental.list_physical_devices('GPU')
if gpus:
try:
for gpu in gpus:
tf.config.experimental.set_memory_growth(gpu, True)
logical_gpus = tf.config.experimental.list_logical_devices('GPU')
... | true | true |
f7670485d74a4bfac292d11a0426bb1e24b410bb | 24,537 | py | Python | src/qinfer/utils.py | mikedeltalima/python-qinfer | 8170c84a0be1723f8c6b09e0d3c7a40a886f1fe3 | [
"BSD-3-Clause"
] | 73 | 2016-01-27T18:42:22.000Z | 2022-03-11T22:27:45.000Z | src/qinfer/utils.py | mikedeltalima/python-qinfer | 8170c84a0be1723f8c6b09e0d3c7a40a886f1fe3 | [
"BSD-3-Clause"
] | 127 | 2016-01-22T05:05:24.000Z | 2021-01-06T19:55:20.000Z | src/qinfer/utils.py | mikedeltalima/python-qinfer | 8170c84a0be1723f8c6b09e0d3c7a40a886f1fe3 | [
"BSD-3-Clause"
] | 34 | 2016-01-26T22:37:10.000Z | 2022-03-17T04:24:36.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
##
# utils.py : some auxiliary functions
##
# © 2017, Chris Ferrie (csferrie@gmail.com) and
# Christopher Granade (cgranade@cgranade.com).
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following co... | 35.612482 | 149 | 0.623956 |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from builtins import range
import warnings
import numpy as np
import numpy.linalg as la
from scipy.linalg import eigh
from scipy.stats import logistic, binom
from scipy.special import gammaln, gamma, exp... | true | true |
f76704c43b8196ba548739e8c2c6550b3c726383 | 88 | py | Python | gunicorn.conf.py | shambu09/manga-utils-server | 6be3f6a516827a6cba6c6b68df5fd908bd80aa34 | [
"MIT"
] | null | null | null | gunicorn.conf.py | shambu09/manga-utils-server | 6be3f6a516827a6cba6c6b68df5fd908bd80aa34 | [
"MIT"
] | null | null | null | gunicorn.conf.py | shambu09/manga-utils-server | 6be3f6a516827a6cba6c6b68df5fd908bd80aa34 | [
"MIT"
] | null | null | null | workers = 3
accesslog = "gunicorn_access.log"
logfile = "gunicorn.log"
loglevel = "info" | 22 | 33 | 0.738636 | workers = 3
accesslog = "gunicorn_access.log"
logfile = "gunicorn.log"
loglevel = "info" | true | true |
f76705d87e0f5c2ef4146b36b755905153ea2511 | 1,163 | py | Python | scripts/create-table.py | TheJacksonLaboratory/JAX_Microbiome_Workshop | 800dffdec753b7b1c2a08b0e0ef29d85e54eb5cc | [
"Apache-2.0"
] | null | null | null | scripts/create-table.py | TheJacksonLaboratory/JAX_Microbiome_Workshop | 800dffdec753b7b1c2a08b0e0ef29d85e54eb5cc | [
"Apache-2.0"
] | null | null | null | scripts/create-table.py | TheJacksonLaboratory/JAX_Microbiome_Workshop | 800dffdec753b7b1c2a08b0e0ef29d85e54eb5cc | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import sys
import os
import re
import shutil
import subprocess
inputs=sys.argv[1]
output=sys.argv[2]
#names=["Username", "IP", "Terminal 1", "Terminal 2", "RStudio", "Jupyter", "Download Files"]
df = pd.read_csv(inputs, sep=",", header=None, names=["Username", "IP"])
df['Terminal 1'] = df["IP"].map... | 43.074074 | 127 | 0.687016 | import pandas as pd
import sys
import os
import re
import shutil
import subprocess
inputs=sys.argv[1]
output=sys.argv[2]
df = pd.read_csv(inputs, sep=",", header=None, names=["Username", "IP"])
df['Terminal 1'] = df["IP"].map(lambda beta_value: "<a href='{}/terminal/' target='_blank'>terminal 1</a>".format(beta_value)... | true | true |
f76706f674bfd6d24d4637cd39b4d20d78dc3681 | 59,758 | py | Python | theano/sandbox/cuda/opt.py | mrocklin/Theano | 6f98d16acd8b6fc8c3d86d9847165d21c1c9b950 | [
"BSD-3-Clause"
] | 1 | 2016-11-09T20:23:00.000Z | 2016-11-09T20:23:00.000Z | theano/sandbox/cuda/opt.py | mrocklin/Theano | 6f98d16acd8b6fc8c3d86d9847165d21c1c9b950 | [
"BSD-3-Clause"
] | null | null | null | theano/sandbox/cuda/opt.py | mrocklin/Theano | 6f98d16acd8b6fc8c3d86d9847165d21c1c9b950 | [
"BSD-3-Clause"
] | null | null | null | import logging
_logger = logging.getLogger('theano.sandbox.cuda.opt')
import copy
import sys
import warnings
import numpy
import theano
from theano.scan_module import scan_utils, scan_op, scan_opt
from theano import scalar as scal
from theano import tensor, compile, gof
import theano.ifelse
from theano.compile impo... | 38.528691 | 83 | 0.586984 | import logging
_logger = logging.getLogger('theano.sandbox.cuda.opt')
import copy
import sys
import warnings
import numpy
import theano
from theano.scan_module import scan_utils, scan_op, scan_opt
from theano import scalar as scal
from theano import tensor, compile, gof
import theano.ifelse
from theano.compile impo... | false | true |
f76707174ee3c195ca7ff378874962bcac26c107 | 2,715 | py | Python | openstack/tests/functional/compute/v2/test_keypair.py | horion/openstacksdk | cbb0e12e1dc944847f2ba0e67bf35b9c7a67b3a3 | [
"Apache-2.0"
] | 99 | 2018-03-28T15:41:45.000Z | 2022-01-23T17:22:13.000Z | openstack/tests/functional/compute/v2/test_keypair.py | horion/openstacksdk | cbb0e12e1dc944847f2ba0e67bf35b9c7a67b3a3 | [
"Apache-2.0"
] | 5 | 2018-05-25T16:54:23.000Z | 2021-11-21T02:27:16.000Z | openstack/tests/functional/compute/v2/test_keypair.py | horion/openstacksdk | cbb0e12e1dc944847f2ba0e67bf35b9c7a67b3a3 | [
"Apache-2.0"
] | 104 | 2018-04-06T14:33:54.000Z | 2022-03-01T01:58:09.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 34.807692 | 75 | 0.669245 |
from openstack.compute.v2 import keypair
from openstack.tests.functional import base
class TestKeypair(base.BaseFunctionalTest):
def setUp(self):
super(TestKeypair, self).setUp()
self.NAME = self.getUniqueString().split('.')[-1]
sot = self.conn.compute.create_keypair(name=self... | true | true |
f76708d7471aa5d570bd5ddef8657c98378d9b65 | 55 | py | Python | oekaki/__init__.py | y-tetsu/oekaki | 9b48d0e5ecc0f7dfc6cf49b569a2f42495658990 | [
"MIT"
] | null | null | null | oekaki/__init__.py | y-tetsu/oekaki | 9b48d0e5ecc0f7dfc6cf49b569a2f42495658990 | [
"MIT"
] | null | null | null | oekaki/__init__.py | y-tetsu/oekaki | 9b48d0e5ecc0f7dfc6cf49b569a2f42495658990 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from oekaki.oekaki import Oekaki
| 18.333333 | 32 | 0.781818 | from oekaki.oekaki import Oekaki
| true | true |
f7670a678d8bcc924de3456d4f783257c3680a1b | 21 | py | Python | next.py | adijkema/recipe_app_api | 792a9562626ccb3ce55506989ed209114da161bc | [
"MIT"
] | null | null | null | next.py | adijkema/recipe_app_api | 792a9562626ccb3ce55506989ed209114da161bc | [
"MIT"
] | null | null | null | next.py | adijkema/recipe_app_api | 792a9562626ccb3ce55506989ed209114da161bc | [
"MIT"
] | null | null | null | # Nothing in it here
| 10.5 | 20 | 0.714286 | true | true | |
f7670a73ff7859c4cc17900522a4a957566c4f16 | 5,095 | py | Python | server/djangoapp/views.py | JsExplorer/agfzb-CloudAppDevelopment_Capstone | 0a95a598af6b925469a35266ec2487d1fbef089b | [
"Apache-2.0"
] | null | null | null | server/djangoapp/views.py | JsExplorer/agfzb-CloudAppDevelopment_Capstone | 0a95a598af6b925469a35266ec2487d1fbef089b | [
"Apache-2.0"
] | null | null | null | server/djangoapp/views.py | JsExplorer/agfzb-CloudAppDevelopment_Capstone | 0a95a598af6b925469a35266ec2487d1fbef089b | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponseRedirect, HttpResponse
from django.contrib.auth.models import User
from django.shortcuts import get_object_or_404, render, redirect
from .models import CarModel, CarMake, CarDealer, DealerReview, ReviewPost
from .restapis import get_dealers_from_cf... | 38.598485 | 109 | 0.640432 | from django.shortcuts import render
from django.http import HttpResponseRedirect, HttpResponse
from django.contrib.auth.models import User
from django.shortcuts import get_object_or_404, render, redirect
from .models import CarModel, CarMake, CarDealer, DealerReview, ReviewPost
from .restapis import get_dealers_from_cf... | true | true |
f7670acb9b2a1e936ac577d2e37dae40690039cd | 1,055 | py | Python | model-optimizer/extensions/front/tf/resize_bilinear.py | apexxs/dldt | 17e66dc5a6631d630da454506902bd7c25d4170b | [
"Apache-2.0"
] | 2 | 2021-04-19T06:08:35.000Z | 2021-08-25T02:43:43.000Z | model-optimizer/extensions/front/tf/resize_bilinear.py | apexxs/dldt | 17e66dc5a6631d630da454506902bd7c25d4170b | [
"Apache-2.0"
] | 6 | 2022-01-11T18:56:22.000Z | 2022-02-21T13:20:20.000Z | model-optimizer/extensions/front/tf/resize_bilinear.py | apexxs/dldt | 17e66dc5a6631d630da454506902bd7c25d4170b | [
"Apache-2.0"
] | 3 | 2021-02-05T17:11:17.000Z | 2021-04-19T08:33:31.000Z | """
Copyright (c) 2018 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | 31.969697 | 73 | 0.717536 | from extensions.ops.interp import InterpOp
from mo.front.extractor import FrontExtractorOp
class ResizeBilinearFrontExtractor(FrontExtractorOp):
op = 'ResizeBilinear'
enabled = True
@staticmethod
def extract(node):
mapping_rule = {
'pad_end': 0,
'pad_beg': 0,
... | true | true |
f7670acfb0022d61e4a6f8b9e0244a467e29fd3e | 10,288 | py | Python | jenkinsapi/build.py | tuenti/jenkinsapi | 52548695da01bd431a6f9fc3c46f7ff42922af39 | [
"MIT"
] | null | null | null | jenkinsapi/build.py | tuenti/jenkinsapi | 52548695da01bd431a6f9fc3c46f7ff42922af39 | [
"MIT"
] | null | null | null | jenkinsapi/build.py | tuenti/jenkinsapi | 52548695da01bd431a6f9fc3c46f7ff42922af39 | [
"MIT"
] | 1 | 2019-12-08T16:20:22.000Z | 2019-12-08T16:20:22.000Z | import time
import pytz
import urllib2
import urlparse
import datetime
from jenkinsapi.artifact import Artifact
from jenkinsapi import config
from jenkinsapi.jenkinsbase import JenkinsBase
from jenkinsapi.exceptions import NoResults
from jenkinsapi.constants import STATUS_SUCCESS
from jenkinsapi.result_set import Resul... | 32.974359 | 146 | 0.6007 | import time
import pytz
import urllib2
import urlparse
import datetime
from jenkinsapi.artifact import Artifact
from jenkinsapi import config
from jenkinsapi.jenkinsbase import JenkinsBase
from jenkinsapi.exceptions import NoResults
from jenkinsapi.constants import STATUS_SUCCESS
from jenkinsapi.result_set import Resul... | true | true |
f7670b43587b7f707217f4be7c5fa6845eb33e2d | 2,112 | py | Python | libtc/utils.py | tobbez/libtc | c51cf2d28efa4fe3b398593a3990663f67cb617f | [
"MIT"
] | null | null | null | libtc/utils.py | tobbez/libtc | c51cf2d28efa4fe3b398593a3990663f67cb617f | [
"MIT"
] | null | null | null | libtc/utils.py | tobbez/libtc | c51cf2d28efa4fe3b398593a3990663f67cb617f | [
"MIT"
] | null | null | null | import os
from pathlib import Path
def is_legal_path(path):
for p in path:
if p in [".", ".."] or "/" in p:
return False
return True
def map_existing_files(torrent, path, add_name_to_folder=True):
name = torrent[b"info"][b"name"].decode()
files = []
if b"files" in torrent[b"... | 28.16 | 80 | 0.616951 | import os
from pathlib import Path
def is_legal_path(path):
for p in path:
if p in [".", ".."] or "/" in p:
return False
return True
def map_existing_files(torrent, path, add_name_to_folder=True):
name = torrent[b"info"][b"name"].decode()
files = []
if b"files" in torrent[b"... | true | true |
f7670cfd85050f0f2bf4cc4b504cfe189435ec32 | 11,869 | py | Python | rllab/optimizers/conjugate_gradient_optimizer.py | samuelfneumann/rllab | ccd80547380b25344b1b091e730beb646d12d192 | [
"MIT"
] | null | null | null | rllab/optimizers/conjugate_gradient_optimizer.py | samuelfneumann/rllab | ccd80547380b25344b1b091e730beb646d12d192 | [
"MIT"
] | null | null | null | rllab/optimizers/conjugate_gradient_optimizer.py | samuelfneumann/rllab | ccd80547380b25344b1b091e730beb646d12d192 | [
"MIT"
] | null | null | null | from rllab.misc import ext
from rllab.misc import krylov
from rllab.misc import logger
from rllab.core.serializable import Serializable
import theano.tensor as TT
import theano
import itertools
import numpy as np
from rllab.misc.ext import sliced_fun
from ast import Num
class PerlmutterHvp(Serializable):
def __i... | 39.962963 | 119 | 0.616143 | from rllab.misc import ext
from rllab.misc import krylov
from rllab.misc import logger
from rllab.core.serializable import Serializable
import theano.tensor as TT
import theano
import itertools
import numpy as np
from rllab.misc.ext import sliced_fun
from ast import Num
class PerlmutterHvp(Serializable):
def __i... | true | true |
f7670dd72e857a0095a7072de87d679746ca0f2c | 14,884 | py | Python | acme/acme/messages.py | rockbreja/rockbreja.com | 5fa20805586213262d5b5848747bfc5ec8241139 | [
"Apache-2.0"
] | null | null | null | acme/acme/messages.py | rockbreja/rockbreja.com | 5fa20805586213262d5b5848747bfc5ec8241139 | [
"Apache-2.0"
] | null | null | null | acme/acme/messages.py | rockbreja/rockbreja.com | 5fa20805586213262d5b5848747bfc5ec8241139 | [
"Apache-2.0"
] | null | null | null | """ACME protocol messages."""
import collections
from acme import challenges
from acme import errors
from acme import fields
from acme import jose
from acme import util
OLD_ERROR_PREFIX = "urn:acme:error:"
ERROR_PREFIX = "urn:ietf:params:acme:error:"
ERROR_CODES = {
'badCSR': 'The CSR is unacceptable (e.g., due ... | 31.400844 | 80 | 0.670183 | import collections
from acme import challenges
from acme import errors
from acme import fields
from acme import jose
from acme import util
OLD_ERROR_PREFIX = "urn:acme:error:"
ERROR_PREFIX = "urn:ietf:params:acme:error:"
ERROR_CODES = {
'badCSR': 'The CSR is unacceptable (e.g., due to a short key)',
'badNonc... | true | true |
f7670f4e1b9dce73c7a034063da04cb89b4eec62 | 16,810 | py | Python | benchmarks/f3_wrong_hints_permutations/scaling_ltl_timed_transition_system/7-sender_receiver_35.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints_permutations/scaling_ltl_timed_transition_system/7-sender_receiver_35.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints_permutations/scaling_ltl_timed_transition_system/7-sender_receiver_35.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import FrozenSet
from collections import Iterable
from math import log, ceil
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type
from mathsat import msat_make_and, msa... | 39.646226 | 89 | 0.569958 | from typing import FrozenSet
from collections import Iterable
from math import log, ceil
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type
from mathsat import msat_make_and, msa... | true | true |
f76710833a1dee3fb87b052dfed7b030751ddc87 | 6,199 | py | Python | src/sentry/discover/endpoints/discover_query.py | kinghuang/sentry | 5c22673994a62f54a782d1c595852986ccc51ae9 | [
"BSD-3-Clause"
] | 1 | 2019-10-17T17:46:16.000Z | 2019-10-17T17:46:16.000Z | src/sentry/discover/endpoints/discover_query.py | kinghuang/sentry | 5c22673994a62f54a782d1c595852986ccc51ae9 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/discover/endpoints/discover_query.py | kinghuang/sentry | 5c22673994a62f54a782d1c595852986ccc51ae9 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from functools import partial
from copy import deepcopy
from rest_framework.response import Response
from sentry.api.bases.organization import OrganizationPermission
from sentry.api.bases import OrganizationEndpoint
from sentry.api.paginator import GenericOffsetPaginator
from s... | 38.74375 | 99 | 0.615906 | from __future__ import absolute_import
from functools import partial
from copy import deepcopy
from rest_framework.response import Response
from sentry.api.bases.organization import OrganizationPermission
from sentry.api.bases import OrganizationEndpoint
from sentry.api.paginator import GenericOffsetPaginator
from s... | true | true |
f76710cb7a4e720f684b62e6f605562e1f0896b4 | 4,937 | py | Python | mmdet/datasets/densepose.py | cjm-sfw/multi-parsing | 439e8624c0183fdb7d70973fa91911b8f2087834 | [
"BSD-2-Clause"
] | null | null | null | mmdet/datasets/densepose.py | cjm-sfw/multi-parsing | 439e8624c0183fdb7d70973fa91911b8f2087834 | [
"BSD-2-Clause"
] | null | null | null | mmdet/datasets/densepose.py | cjm-sfw/multi-parsing | 439e8624c0183fdb7d70973fa91911b8f2087834 | [
"BSD-2-Clause"
] | null | null | null | import numpy as np
from pycocotools.coco import COCO
from .custom import CustomDataset
from .registry import DATASETS
@DATASETS.register_module
class DensePose(CustomDataset):
CLASSES = ('person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus',
'train', 'truck', 'boat', 'traffic_light', 'fire_... | 39.496 | 104 | 0.546891 | import numpy as np
from pycocotools.coco import COCO
from .custom import CustomDataset
from .registry import DATASETS
@DATASETS.register_module
class DensePose(CustomDataset):
CLASSES = ('person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus',
'train', 'truck', 'boat', 'traffic_light', 'fire_... | true | true |
f76710e58a2665818d31df7cff2a01afdca9b2ef | 1,714 | py | Python | setup.py | jazzband/django-sorter | e92b2f7acc5d331166aa9f7a21a8ce6419bf256f | [
"BSD-3-Clause"
] | 30 | 2015-12-17T13:08:41.000Z | 2021-11-08T11:18:04.000Z | setup.py | jezdez-archive/django-sorter | e92b2f7acc5d331166aa9f7a21a8ce6419bf256f | [
"BSD-3-Clause"
] | 2 | 2016-06-11T09:55:23.000Z | 2018-05-09T19:46:45.000Z | setup.py | jazzband/django-sorter | e92b2f7acc5d331166aa9f7a21a8ce6419bf256f | [
"BSD-3-Clause"
] | 6 | 2015-12-24T14:25:10.000Z | 2019-09-29T04:33:41.000Z | import os
import codecs
import re
from setuptools import setup
def read(*parts):
return codecs.open(os.path.join(os.path.dirname(__file__), *parts)).read()
def find_version(*file_paths):
version_file = read(*file_paths)
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
... | 29.551724 | 78 | 0.577013 | import os
import codecs
import re
from setuptools import setup
def read(*parts):
return codecs.open(os.path.join(os.path.dirname(__file__), *parts)).read()
def find_version(*file_paths):
version_file = read(*file_paths)
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
... | true | true |
f7671178088f1608728e4b0d1667fd3b116144ec | 11,622 | py | Python | model_hub/examples/huggingface/text-classification/glue_trial.py | gh-determined-ai/determined | 9a1ab33a3a356b69681b3351629fef4ab98ddb56 | [
"Apache-2.0"
] | null | null | null | model_hub/examples/huggingface/text-classification/glue_trial.py | gh-determined-ai/determined | 9a1ab33a3a356b69681b3351629fef4ab98ddb56 | [
"Apache-2.0"
] | null | null | null | model_hub/examples/huggingface/text-classification/glue_trial.py | gh-determined-ai/determined | 9a1ab33a3a356b69681b3351629fef4ab98ddb56 | [
"Apache-2.0"
] | null | null | null | """
This example is largely based on the GLUE text-classification example in the huggingface
transformers library. The license for the transformer's library is reproduced below.
==================================================================================================
Copyright 2020 The HuggingFace Team. All ... | 45.576471 | 99 | 0.633626 |
import functools
import logging
from typing import Dict, Union
import attrdict
import datasets
import numpy as np
import transformers
import determined.pytorch as det_torch
import model_hub.huggingface as hf
import model_hub.utils as utils
task_to_keys = {
"cola": ("sentence", None),
"mnli": ("premise", "hy... | true | true |
f767129ce41cea7b3df27eab6b2cc77d43fe2821 | 2,379 | py | Python | Final_data_building/video_based_split/split_vid_top14_p123.py | wuyifan2233/Tencent_WWF | 2b248a810295f95cb0483837cb8cb8797c144821 | [
"MIT"
] | 2 | 2021-07-08T01:52:15.000Z | 2021-07-29T08:46:06.000Z | Final_data_building/video_based_split/split_vid_top14_p123.py | wuyifan2233/Tencent_WWF | 2b248a810295f95cb0483837cb8cb8797c144821 | [
"MIT"
] | null | null | null | Final_data_building/video_based_split/split_vid_top14_p123.py | wuyifan2233/Tencent_WWF | 2b248a810295f95cb0483837cb8cb8797c144821 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
from math import e, inf
import os
from numpy.lib.type_check import _imag_dispatcher
import pandas as pd
import shutil
import numpy as np
import cv2
import random
from tqdm import tqdm
import pyfastcopy
import json,sklearn
from sklearn.model_selection import train_test_split
def main():
... | 38.370968 | 117 | 0.62211 | from math import e, inf
import os
from numpy.lib.type_check import _imag_dispatcher
import pandas as pd
import shutil
import numpy as np
import cv2
import random
from tqdm import tqdm
import pyfastcopy
import json,sklearn
from sklearn.model_selection import train_test_split
def main():
data_stat_path... | true | true |
f76712a8c9cf4879943711eb56cabd66a0968b74 | 13,774 | py | Python | adafruit_fram.py | caternuson/Adafruit_CircuitPython_FRAM | 671164e2cff227f37b60b919156b082e7cebd294 | [
"Unlicense",
"MIT-0",
"MIT"
] | null | null | null | adafruit_fram.py | caternuson/Adafruit_CircuitPython_FRAM | 671164e2cff227f37b60b919156b082e7cebd294 | [
"Unlicense",
"MIT-0",
"MIT"
] | null | null | null | adafruit_fram.py | caternuson/Adafruit_CircuitPython_FRAM | 671164e2cff227f37b60b919156b082e7cebd294 | [
"Unlicense",
"MIT-0",
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2018 Michael Schroeder for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_fram`
====================================================
CircuitPython/Python library to support the I2C and SPI FRAM Breakouts.
* Author(s): Michael Schroeder
Implementation Notes
-------------... | 35.963446 | 95 | 0.583708 |
from micropython import const
__version__ = "0.0.0-auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FRAM.git"
_MAX_SIZE_I2C = const(0x8000)
_MAX_SIZE_SPI = const(0x2000)
_I2C_MANF_ID = const(0x0A)
_I2C_PROD_ID = const(0x510)
_SPI_MANF_ID = const(0x04)
_SPI_PROD_ID = const(0x302)
_SPI_OPCODE... | true | true |
f76712f40b91e80356b9699dcd686fdced4564a9 | 26 | py | Python | src/__init__.py | KathTheDragon/markup | 9aced58c52e76da54a22996f69857707be2b0174 | [
"Unlicense"
] | null | null | null | src/__init__.py | KathTheDragon/markup | 9aced58c52e76da54a22996f69857707be2b0174 | [
"Unlicense"
] | null | null | null | src/__init__.py | KathTheDragon/markup | 9aced58c52e76da54a22996f69857707be2b0174 | [
"Unlicense"
] | null | null | null | from .parse import Markup
| 13 | 25 | 0.807692 | from .parse import Markup
| true | true |
f767130220427c1ff2fa8a51ce83bae7997d2c4f | 1,885 | py | Python | runtime_interface.py | uscheller/aws-lambda-runtime-pypy | 2c4824d49699f064e24d56fd8fd22141cb5dcfd3 | [
"Apache-2.0"
] | 10 | 2018-12-18T18:04:28.000Z | 2021-04-23T07:31:13.000Z | runtime_interface.py | uscheller/aws-lambda-runtime-pypy | 2c4824d49699f064e24d56fd8fd22141cb5dcfd3 | [
"Apache-2.0"
] | null | null | null | runtime_interface.py | uscheller/aws-lambda-runtime-pypy | 2c4824d49699f064e24d56fd8fd22141cb5dcfd3 | [
"Apache-2.0"
] | 3 | 2019-06-22T14:16:57.000Z | 2021-12-29T22:04:42.000Z | """
A Custom Runtime Interface for running Python code with Pypy on AWS Lambda
"""
import os
import json
import requests
import importlib
__author__ = "Ulrich Scheller"
__email__ = "mail@ulrich-scheller.de"
__website__ = "www.ulrich-scheller.de"
__status__ = "Prototype"
class RuntimeInterface(object):
def __init... | 31.416667 | 74 | 0.657294 | import os
import json
import requests
import importlib
__author__ = "Ulrich Scheller"
__email__ = "mail@ulrich-scheller.de"
__website__ = "www.ulrich-scheller.de"
__status__ = "Prototype"
class RuntimeInterface(object):
def __init__(self):
api = os.getenv("AWS_LAMBDA_RUNTIME_API")
handler = os.ge... | true | true |
f7671397bc15139866ec4522e71776159e31aacf | 8,872 | py | Python | tests/attr/neuron/test_neuron_deeplift.py | trsvchn/captum | 0435ff10a71724a788bdc54f01324f4f5c788541 | [
"BSD-3-Clause"
] | 3,140 | 2019-10-10T17:05:37.000Z | 2022-03-31T17:31:01.000Z | tests/attr/neuron/test_neuron_deeplift.py | sarsbug/captum | 38b57082d22854013c0a0b80a51c0b85269afdaf | [
"BSD-3-Clause"
] | 758 | 2019-10-11T18:01:04.000Z | 2022-03-31T21:36:07.000Z | tests/attr/neuron/test_neuron_deeplift.py | sarsbug/captum | 38b57082d22854013c0a0b80a51c0b85269afdaf | [
"BSD-3-Clause"
] | 345 | 2019-10-10T17:17:06.000Z | 2022-03-30T07:31:31.000Z | #!/usr/bin/env python3
from __future__ import print_function
from typing import Tuple, Union
import torch
from captum._utils.typing import TensorOrTupleOfTensorsGeneric
from captum.attr._core.neuron.neuron_deep_lift import NeuronDeepLift, NeuronDeepLiftShap
from tests.attr.layer.test_layer_deeplift import (
_cre... | 39.963964 | 88 | 0.661745 |
from __future__ import print_function
from typing import Tuple, Union
import torch
from captum._utils.typing import TensorOrTupleOfTensorsGeneric
from captum.attr._core.neuron.neuron_deep_lift import NeuronDeepLift, NeuronDeepLiftShap
from tests.attr.layer.test_layer_deeplift import (
_create_inps_and_base_for_d... | true | true |
f7671592522570278772223dccc28e1af2d6af6d | 322 | py | Python | describe/meta.py | jeffh/describe | 6a33ffecc3340b57e60bc8a7095521882ff9a156 | [
"MIT"
] | 3 | 2015-06-25T07:10:04.000Z | 2015-11-13T08:59:49.000Z | describe/meta.py | jeffh/describe | 6a33ffecc3340b57e60bc8a7095521882ff9a156 | [
"MIT"
] | 1 | 2018-05-29T04:31:51.000Z | 2018-05-29T04:31:51.000Z | describe/meta.py | jeffh/describe | 6a33ffecc3340b57e60bc8a7095521882ff9a156 | [
"MIT"
] | 1 | 2018-05-25T03:59:57.000Z | 2018-05-25T03:59:57.000Z | """meta.py - Describing describe. All metadata about the Describe package is here.
This also loaded by setup.py
"""
__author__ = "Jeff Hui"
__credits__ = [
"Kai Groner", "Jeff Hui"
]
__license__ = "MIT"
__version__ = "1.0.0beta1"
__maintainer__ = "Jeff Hui"
__email__ = "jeff@jeffhui.net"
__status__ = "Development... | 21.466667 | 82 | 0.71118 | __author__ = "Jeff Hui"
__credits__ = [
"Kai Groner", "Jeff Hui"
]
__license__ = "MIT"
__version__ = "1.0.0beta1"
__maintainer__ = "Jeff Hui"
__email__ = "jeff@jeffhui.net"
__status__ = "Development"
| true | true |
f7671615af4a957c2417c7dc94fdf956feba3375 | 264 | py | Python | smoke/noaa/plot_grid.py | minnieteng/smoke_project | cc3c8f16f7759fe29e46d3cec32a3ed6ca86bd5f | [
"Apache-2.0"
] | null | null | null | smoke/noaa/plot_grid.py | minnieteng/smoke_project | cc3c8f16f7759fe29e46d3cec32a3ed6ca86bd5f | [
"Apache-2.0"
] | null | null | null | smoke/noaa/plot_grid.py | minnieteng/smoke_project | cc3c8f16f7759fe29e46d3cec32a3ed6ca86bd5f | [
"Apache-2.0"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
grid2D = np.load(r"C:\temp\10km_grids\20180808-23.npy")
fig, ax = plt.subplots(figsize=(16.2, 16))
im = ax.imshow(grid2D)
ax.set_xlabel("Cols")
ax.set_ylabel("Rows")
plt.colorbar(im)
plt.savefig('grid2D.png')
| 18.857143 | 55 | 0.723485 | import matplotlib.pyplot as plt
import numpy as np
grid2D = np.load(r"C:\temp\10km_grids\20180808-23.npy")
fig, ax = plt.subplots(figsize=(16.2, 16))
im = ax.imshow(grid2D)
ax.set_xlabel("Cols")
ax.set_ylabel("Rows")
plt.colorbar(im)
plt.savefig('grid2D.png')
| true | true |
f76716f5f111cf3888dfa7a9fc2c46cff628cba7 | 1,423 | py | Python | test/ably/resttime_test.py | jvinet/ably-python | 0d75a7af347bf7c1a8d73739f58fa41ed4eaae23 | [
"Apache-2.0"
] | 22 | 2015-04-29T13:33:46.000Z | 2022-01-10T17:51:10.000Z | test/ably/resttime_test.py | jvinet/ably-python | 0d75a7af347bf7c1a8d73739f58fa41ed4eaae23 | [
"Apache-2.0"
] | 193 | 2015-04-07T22:47:17.000Z | 2022-03-28T14:52:56.000Z | test/ably/resttime_test.py | jvinet/ably-python | 0d75a7af347bf7c1a8d73739f58fa41ed4eaae23 | [
"Apache-2.0"
] | 21 | 2015-04-14T13:26:31.000Z | 2021-10-02T15:30:54.000Z | import time
import pytest
from ably import AblyException
from test.ably.restsetup import RestSetup
from test.ably.utils import VaryByProtocolTestsMetaclass, dont_vary_protocol, BaseAsyncTestCase
class TestRestTime(BaseAsyncTestCase, metaclass=VaryByProtocolTestsMetaclass):
def per_protocol_setup(self, use_bin... | 32.340909 | 107 | 0.711174 | import time
import pytest
from ably import AblyException
from test.ably.restsetup import RestSetup
from test.ably.utils import VaryByProtocolTestsMetaclass, dont_vary_protocol, BaseAsyncTestCase
class TestRestTime(BaseAsyncTestCase, metaclass=VaryByProtocolTestsMetaclass):
def per_protocol_setup(self, use_bin... | true | true |
f767174c8149559cec166d19cd26271f9cfd4aa5 | 24,806 | py | Python | python/dglke/dataloader/sampler.py | sherry-1001/dgl-ke | 2d2542a21f9725f764e9b927ed257c575f374f47 | [
"Apache-2.0"
] | 1 | 2022-01-22T02:29:26.000Z | 2022-01-22T02:29:26.000Z | python/dglke/dataloader/sampler.py | sherry-1001/dgl-ke | 2d2542a21f9725f764e9b927ed257c575f374f47 | [
"Apache-2.0"
] | null | null | null | python/dglke/dataloader/sampler.py | sherry-1001/dgl-ke | 2d2542a21f9725f764e9b927ed257c575f374f47 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# sampler.py
#
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.or... | 34.693706 | 109 | 0.578812 |
import math
import numpy as np
import scipy as sp
import dgl.backend as F
import dgl
import os
import sys
import pickle
import time
from dgl.base import NID, EID
def SoftRelationPartition(edges, n, threshold=0.05):
heads, rels, tails = edges
print('relation partition {} edges into {} parts'.format(len(heads)... | true | true |
f76718dc3b1dd4eb221762864b17445583c9b56a | 1,488 | py | Python | examples/run.py | alaflaquiere/unsupervised-spatial-predictor | 3c8aa02dc20782d31d1df791dd5e92dce275aec2 | [
"MIT"
] | null | null | null | examples/run.py | alaflaquiere/unsupervised-spatial-predictor | 3c8aa02dc20782d31d1df791dd5e92dce275aec2 | [
"MIT"
] | null | null | null | examples/run.py | alaflaquiere/unsupervised-spatial-predictor | 3c8aa02dc20782d31d1df791dd5e92dce275aec2 | [
"MIT"
] | null | null | null | import os
import time
import subprocess
from argparse import ArgumentParser
import yaml
import tkinter as tk
from tkinter import filedialog
from unsup_spatial_pred import run_experiment
def check_directory(directory):
if not os.path.exists(directory):
root = tk.Tk()
root.withdraw()
directo... | 26.571429 | 83 | 0.626344 | import os
import time
import subprocess
from argparse import ArgumentParser
import yaml
import tkinter as tk
from tkinter import filedialog
from unsup_spatial_pred import run_experiment
def check_directory(directory):
if not os.path.exists(directory):
root = tk.Tk()
root.withdraw()
directo... | true | true |
f767194aace3d5c23bf88f81c1e46069cc957ff2 | 454 | py | Python | src/36.py | cloudzfy/euler | b82efad753ee98375fd40ec4e3989be57828e82c | [
"MIT"
] | 12 | 2016-10-19T09:03:20.000Z | 2021-01-10T10:53:23.000Z | src/36.py | cloudzfy/euler | b82efad753ee98375fd40ec4e3989be57828e82c | [
"MIT"
] | null | null | null | src/36.py | cloudzfy/euler | b82efad753ee98375fd40ec4e3989be57828e82c | [
"MIT"
] | 6 | 2018-09-12T03:13:58.000Z | 2021-07-07T00:29:43.000Z | # The decimal number, 585 = 1001001001_2 (binary), is palindromic
# in both bases.
# Find the sum of all numbers, less than one million, which are
# palindromic in base 10 and base 2.
# (Please note that the palindromic number, in either base, may
# not include leading zeros.)
def is_palindrome(num):
return num[::-... | 23.894737 | 65 | 0.707048 |
def is_palindrome(num):
return num[::-1] == num
ans = []
for i in range(1000000):
if is_palindrome(str(i)) and is_palindrome(bin(i)[2:]):
ans.append(i)
print sum(ans)
| false | true |
f767197040411cb366311f9e6555b10927c8985e | 3,652 | py | Python | python_modules/dagster/dagster/core/execution/context/init.py | withshubh/dagster | ff4a0db53e126f44097a337eecef54988cc718ef | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/execution/context/init.py | withshubh/dagster | ff4a0db53e126f44097a337eecef54988cc718ef | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/execution/context/init.py | withshubh/dagster | ff4a0db53e126f44097a337eecef54988cc718ef | [
"Apache-2.0"
] | null | null | null | from collections import namedtuple
from typing import Any, Dict, Optional, Set
from dagster import check
from dagster.core.definitions.pipeline import PipelineDefinition
from dagster.core.definitions.resource import ResourceDefinition, ScopedResourcesBuilder
from dagster.core.instance import DagsterInstance
from dagst... | 41.5 | 100 | 0.694414 | from collections import namedtuple
from typing import Any, Dict, Optional, Set
from dagster import check
from dagster.core.definitions.pipeline import PipelineDefinition
from dagster.core.definitions.resource import ResourceDefinition, ScopedResourcesBuilder
from dagster.core.instance import DagsterInstance
from dagst... | true | true |
f7671a828ca71f78f9b86afb0aa3b06caf0ae5ac | 1,865 | py | Python | freegames/tiles.py | rezaa2002/free-python-games | ca99e10313e281643c88e42531afbf50d5349407 | [
"Apache-2.0"
] | 3 | 2021-06-17T19:27:32.000Z | 2022-02-09T05:14:02.000Z | freegames/tiles.py | rezaa2002/free-python-games | ca99e10313e281643c88e42531afbf50d5349407 | [
"Apache-2.0"
] | 6 | 2019-05-31T11:47:21.000Z | 2019-06-10T14:11:37.000Z | freegames/tiles.py | rezaa2002/free-python-games | ca99e10313e281643c88e42531afbf50d5349407 | [
"Apache-2.0"
] | 3 | 2021-01-20T10:19:37.000Z | 2021-03-22T14:07:04.000Z | """Tiles, number swapping game.
Exercises
1. Track a score by the number of tile moves.
2. Permit diagonal squares as neighbors.
3. Respond to arrow keys instead of mouse clicks.
4. Make the grid bigger.
"""
from random import *
from turtle import *
from freegames import floor, vector
tiles = {}
neighbors = [
... | 19.631579 | 54 | 0.563003 |
from random import *
from turtle import *
from freegames import floor, vector
tiles = {}
neighbors = [
vector(100, 0),
vector(-100, 0),
vector(0, 100),
vector(0, -100),
]
def load():
count = 1
for y in range(-200, 200, 100):
for x in range(-200, 200, 100):
mark = vector(x... | true | true |
f7671b364f63373a2e46283e3130b458e5d7b46b | 1,121 | py | Python | release/stubs.min/System/Windows/Controls/Primitives_parts/TickPlacement.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 182 | 2017-06-27T02:26:15.000Z | 2022-03-30T18:53:43.000Z | release/stubs.min/System/Windows/Controls/Primitives_parts/TickPlacement.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 28 | 2017-06-27T13:38:23.000Z | 2022-03-15T11:19:44.000Z | release/stubs.min/System/Windows/Controls/Primitives_parts/TickPlacement.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 67 | 2017-06-28T09:43:59.000Z | 2022-03-20T21:17:10.000Z | class TickPlacement(Enum,IComparable,IFormattable,IConvertible):
"""
Specifies the position of tick marks in a System.Windows.Controls.Slider control with respect to the System.Windows.Controls.Primitives.Track that the control implements.
enum TickPlacement,values: Both (3),BottomRight (2),None (0),TopLef... | 29.5 | 215 | 0.682426 | class TickPlacement(Enum,IComparable,IFormattable,IConvertible):
"""
Specifies the position of tick marks in a System.Windows.Controls.Slider control with respect to the System.Windows.Controls.Primitives.Track that the control implements.
enum TickPlacement,values: Both (3),BottomRight (2),None (0),TopLef... | false | true |
f7671b703667b61e1f54636e33c073e5996c140e | 1,345 | py | Python | 5-merge_sp500_data.py | lloydroc/stockcrawl | 68f69cde633bea844e9b070da7a9e45039639617 | [
"Apache-2.0"
] | null | null | null | 5-merge_sp500_data.py | lloydroc/stockcrawl | 68f69cde633bea844e9b070da7a9e45039639617 | [
"Apache-2.0"
] | null | null | null | 5-merge_sp500_data.py | lloydroc/stockcrawl | 68f69cde633bea844e9b070da7a9e45039639617 | [
"Apache-2.0"
] | null | null | null | # We will go through our S&P 500 JSON Data and merge it into CouchDB
import sys, argparse, os
import urllib.request
import requests
import json
numerrors = 0
def main(args):
global numerrors
chunklen=0
symbols=[]
sp500_json=args.infile.read()
sp500_symbols=json.loads(sp500_json)
args.infile.close()
for ... | 35.394737 | 132 | 0.714498 | import sys, argparse, os
import urllib.request
import requests
import json
numerrors = 0
def main(args):
global numerrors
chunklen=0
symbols=[]
sp500_json=args.infile.read()
sp500_symbols=json.loads(sp500_json)
args.infile.close()
for symbol in sp500_symbols:
url = args.couchdburl+symbol['_id']
... | true | true |
f7671c4a821503b4c249b520a13fd35595ac3dd2 | 2,551 | py | Python | agda/species_geo_coder/views.py | NBISweden/agda | a67e94b127ee7f97419152d5abe6a770bcee4f07 | [
"MIT"
] | 1 | 2015-03-09T22:43:39.000Z | 2015-03-09T22:43:39.000Z | agda/species_geo_coder/views.py | BILS/agda | a67e94b127ee7f97419152d5abe6a770bcee4f07 | [
"MIT"
] | 1 | 2018-09-29T22:16:02.000Z | 2018-10-01T07:08:38.000Z | agda/species_geo_coder/views.py | BILS/agda | a67e94b127ee7f97419152d5abe6a770bcee4f07 | [
"MIT"
] | null | null | null | import time
#from django.shortcuts import render
from django.views.generic import TemplateView, FormView
from django.shortcuts import redirect, render
from django.db import transaction
from agda.views import package_template_dict
from jobs.models import (JOB_STATUS_LEVEL_ACCEPTED,
JOB_STATUS_... | 38.651515 | 99 | 0.70835 | import time
from django.views.generic import TemplateView, FormView
from django.shortcuts import redirect, render
from django.db import transaction
from agda.views import package_template_dict
from jobs.models import (JOB_STATUS_LEVEL_ACCEPTED,
JOB_STATUS_LEVEL_FINISHED,
... | true | true |
f7671c4dc0b4b21e6f26d46aa36309ca2ecf2114 | 14,705 | py | Python | hanbai/hanbai/models.py | Checkroth/kurumahanbai | d7ab0a59161e104cc4701cb6ed3138f394999b9f | [
"MIT"
] | null | null | null | hanbai/hanbai/models.py | Checkroth/kurumahanbai | d7ab0a59161e104cc4701cb6ed3138f394999b9f | [
"MIT"
] | null | null | null | hanbai/hanbai/models.py | Checkroth/kurumahanbai | d7ab0a59161e104cc4701cb6ed3138f394999b9f | [
"MIT"
] | null | null | null | from django.core import validators
from django.db import models
class ExtraField(models.Model):
class FieldTypeChoices(models.IntegerChoices):
STRING = 1
INTEGER = 2
field_name = models.CharField(max_length=255, null=True, blank=True)
value_type = models.IntegerField(choices=FieldTypeChoi... | 38.294271 | 111 | 0.642775 | from django.core import validators
from django.db import models
class ExtraField(models.Model):
class FieldTypeChoices(models.IntegerChoices):
STRING = 1
INTEGER = 2
field_name = models.CharField(max_length=255, null=True, blank=True)
value_type = models.IntegerField(choices=FieldTypeChoi... | true | true |
f7671c538cc48146dd532949148f386eb8cbc3d7 | 4,238 | py | Python | model/currency.py | keremkoseoglu/Kifu | bed7a15f71e2345c654b1adab07a5edecdbae342 | [
"MIT"
] | null | null | null | model/currency.py | keremkoseoglu/Kifu | bed7a15f71e2345c654b1adab07a5edecdbae342 | [
"MIT"
] | 82 | 2020-06-25T09:45:01.000Z | 2022-03-31T09:35:31.000Z | model/currency.py | keremkoseoglu/Kifu | bed7a15f71e2345c654b1adab07a5edecdbae342 | [
"MIT"
] | null | null | null | """ Currency """
import json
import os
from datetime import datetime
import config
from util import date_time
from update import old_currency, currency_update
_CURR_CONV_FILE_PREFIX = "currency_conv"
_CURR_CONV_FILE_EXTENSION = "json"
_CURR_CONV_FILE = "currency_conv.json"
def save_currency_conv(conv_as_dict: {}):
... | 37.504425 | 99 | 0.663285 | import json
import os
from datetime import datetime
import config
from util import date_time
from update import old_currency, currency_update
_CURR_CONV_FILE_PREFIX = "currency_conv"
_CURR_CONV_FILE_EXTENSION = "json"
_CURR_CONV_FILE = "currency_conv.json"
def save_currency_conv(conv_as_dict: {}):
file_path = _g... | true | true |
f7671cbf9f451da5ab8b5052f58d2e834cb986c6 | 14,651 | py | Python | capstone/capapi/views/user_views.py | jcushman/capstone | ef3ced77f69aabe14c89ab67003a6e88736bf777 | [
"MIT"
] | null | null | null | capstone/capapi/views/user_views.py | jcushman/capstone | ef3ced77f69aabe14c89ab67003a6e88736bf777 | [
"MIT"
] | null | null | null | capstone/capapi/views/user_views.py | jcushman/capstone | ef3ced77f69aabe14c89ab67003a6e88736bf777 | [
"MIT"
] | null | null | null | from collections import OrderedDict
from django.conf import settings
from django.contrib.auth.decorators import login_required, user_passes_test
from django.core.exceptions import PermissionDenied
from django.core.mail import send_mail, EmailMessage
from django.db import transaction
from django.http import HttpRespons... | 42.964809 | 144 | 0.669988 | from collections import OrderedDict
from django.conf import settings
from django.contrib.auth.decorators import login_required, user_passes_test
from django.core.exceptions import PermissionDenied
from django.core.mail import send_mail, EmailMessage
from django.db import transaction
from django.http import HttpRespons... | true | true |
f7671d83cbb27d9db9f050b8e0270e7f5a443fd3 | 5,041 | py | Python | Python-ML/final_proj/unsupervised/k_means_sift.py | JasonFil/Python-ML | 74a4b127b24c186d1a62ee8c458f79aaf2eee89b | [
"AFL-3.0"
] | 4 | 2017-06-04T01:06:57.000Z | 2019-11-14T20:05:30.000Z | Python-ML/final_proj/unsupervised/k_means_sift.py | jasonfilippou/Python-ML | 74a4b127b24c186d1a62ee8c458f79aaf2eee89b | [
"AFL-3.0"
] | null | null | null | Python-ML/final_proj/unsupervised/k_means_sift.py | jasonfilippou/Python-ML | 74a4b127b24c186d1a62ee8c458f79aaf2eee89b | [
"AFL-3.0"
] | 5 | 2016-05-27T19:00:07.000Z | 2018-10-30T13:49:38.000Z | from __future__ import division
'''
Created on Dec 3, 2012
@author: jason
'''
from util.mlExceptions import *
import os
from inspect import stack
from scipy.io import loadmat
import pickle as pkl
from scipy.cluster.vq import *
from collections import Counter
from numpy.linalg import norm
import numpy as np
from evalu... | 43.08547 | 169 | 0.565761 | from __future__ import division
'''
Created on Dec 3, 2012
@author: jason
'''
from util.mlExceptions import *
import os
from inspect import stack
from scipy.io import loadmat
import pickle as pkl
from scipy.cluster.vq import *
from collections import Counter
from numpy.linalg import norm
import numpy as np
from evalu... | false | true |
f7671da667b185667bcdeb20666490b608042851 | 3,397 | py | Python | cvpods/layers/tree_filter_v2.py | hanqiu-hq/cvpods | 597fa669151fdad87c250fa118a9e3a555f4fb5e | [
"Apache-2.0"
] | null | null | null | cvpods/layers/tree_filter_v2.py | hanqiu-hq/cvpods | 597fa669151fdad87c250fa118a9e3a555f4fb5e | [
"Apache-2.0"
] | null | null | null | cvpods/layers/tree_filter_v2.py | hanqiu-hq/cvpods | 597fa669151fdad87c250fa118a9e3a555f4fb5e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (C) 2019-2021 Megvii Inc. All rights reserved.
import torch
import torch.nn as nn
import torch.nn.functional as F
from .tree_filter_core import MinimumSpanningTree, RandomSpanningTree, TreeFilter2D
class TreeFilterV2(nn.Module):
def __init__(self, guide_cha... | 37.744444 | 100 | 0.637327 |
import torch
import torch.nn as nn
import torch.nn.functional as F
from .tree_filter_core import MinimumSpanningTree, RandomSpanningTree, TreeFilter2D
class TreeFilterV2(nn.Module):
def __init__(self, guide_channels, in_channels, embed_channels, num_groups=1, eps=1e-8):
super(TreeFilterV2, self).__init_... | true | true |
f7671e25a120c7b066785086a5ad1dc06802d86d | 2,766 | py | Python | scraper/scraper.py | micort35/prestiology | 729d4558005e1c6d07ac5044ff10cbb1b7a522c6 | [
"MIT"
] | null | null | null | scraper/scraper.py | micort35/prestiology | 729d4558005e1c6d07ac5044ff10cbb1b7a522c6 | [
"MIT"
] | null | null | null | scraper/scraper.py | micort35/prestiology | 729d4558005e1c6d07ac5044ff10cbb1b7a522c6 | [
"MIT"
] | null | null | null | #!usr/bin/env/python
import sys
from enum import Enum
from datetime import timedelta, date
import psycopg2
from basketball_reference_web_scraper import client
from basketball_reference_web_scraper.data import Team
import auth
import log
from scraper_lib import daterange, benchmark
@benchmark
def parse_and_input(score,... | 29.425532 | 65 | 0.663774 | import sys
from enum import Enum
from datetime import timedelta, date
import psycopg2
from basketball_reference_web_scraper import client
from basketball_reference_web_scraper.data import Team
import auth
import log
from scraper_lib import daterange, benchmark
@benchmark
def parse_and_input(score, connection, gameday)... | true | true |
f7671e607fb1486f8e17f7ae0f8a4eee3f7dda90 | 1,037 | py | Python | __main__.py | live4dao/RLtrading | c1655a7bfe1220c1d7ae5c0d46814bf3884e6cdb | [
"MIT"
] | null | null | null | __main__.py | live4dao/RLtrading | c1655a7bfe1220c1d7ae5c0d46814bf3884e6cdb | [
"MIT"
] | null | null | null | __main__.py | live4dao/RLtrading | c1655a7bfe1220c1d7ae5c0d46814bf3884e6cdb | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import trading_env
from datetime import datetime
st = datetime.now()
## need to refactor the testcase
# df = pd.read_csv('trading_env/test/data/SGXTWsample.csv', index_col=0, parse_dates=['datetime'])
df = pd.read_hdf('D:\[AIA]\TradingGym\dataset\SGXTWsample.h5', 'STW')
env = t... | 34.566667 | 98 | 0.576663 | import numpy as np
import pandas as pd
import trading_env
from datetime import datetime
st = datetime.now()
df = pd.read_hdf('D:\[AIA]\TradingGym\dataset\SGXTWsample.h5', 'STW')
env = trading_env.make(env_id='training_v1', obs_data_len=256, step_len=128,
df=df, fee=0.1, max_position=5, deal_co... | true | true |
f7671e91db5aaea8ae21a0a7e49fe16822ac3587 | 3,132 | py | Python | scripts/run_sentence_indexer.py | MetaphorExtractionTools/metaphor-search | ca0ba6cda8d83eb9274eb2b9d7977df4a5374b18 | [
"MIT"
] | 2 | 2018-05-25T01:47:50.000Z | 2021-11-26T19:03:07.000Z | scripts/run_sentence_indexer.py | MetaphorExtractionTools/metaphor-search | ca0ba6cda8d83eb9274eb2b9d7977df4a5374b18 | [
"MIT"
] | null | null | null | scripts/run_sentence_indexer.py | MetaphorExtractionTools/metaphor-search | ca0ba6cda8d83eb9274eb2b9d7977df4a5374b18 | [
"MIT"
] | 1 | 2020-02-06T16:04:07.000Z | 2020-02-06T16:04:07.000Z | #!/usr/bin/env python
# coding: utf-8
# Author: Vladimir M. Zaytsev <zaytsev@usc.edu>
import os
import numpy
import shutil
import logging
import argparse
from sear.index import InvertedIndex # The index itself.
from sear.utils import IndexingPipeline # Utility which will control indexing p... | 27 | 111 | 0.707854 |
import os
import numpy
import shutil
import logging
import argparse
from sear.index import InvertedIndex from sear.utils import IndexingPipeline
from sear.storage import LdbStorage from sear.lexicon import DictLexicon
from metaphor.lfsent import LFSentenceP... | true | true |
f7671e92ec99574adf532b4d1ed573b50b6ad191 | 1,407 | py | Python | examples/camera/main.py | RiiotLabs/kivy | 71bd76b2d1eaf93d251f9bc9b2a5fe04306327e1 | [
"MIT"
] | null | null | null | examples/camera/main.py | RiiotLabs/kivy | 71bd76b2d1eaf93d251f9bc9b2a5fe04306327e1 | [
"MIT"
] | null | null | null | examples/camera/main.py | RiiotLabs/kivy | 71bd76b2d1eaf93d251f9bc9b2a5fe04306327e1 | [
"MIT"
] | null | null | null | '''
Camera Example
==============
This example demonstrates a simple use of the camera. It shows a window with
a buttoned labelled 'play' to turn the camera on and off. Note that
not finding a camera, perhaps because gstreamer is not installed, will
throw an exception during the kv language processing.
'''
# Uncomme... | 23.45 | 76 | 0.649609 |
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
import time
Builder.load_string('''
<CameraClick>:
orientation: 'vertical'
Camera:
id: camera
resolution: (640, 480)
play: False
ToggleButton:
text: 'Play'
on_press: came... | true | true |
f7671f18b5edfa250cadadda21b373b3b2369a34 | 669 | py | Python | manage.py | miguelalf/Backend-1 | 9179c78b0caec670273097c005c25ee462bb6791 | [
"MIT"
] | null | null | null | manage.py | miguelalf/Backend-1 | 9179c78b0caec670273097c005c25ee462bb6791 | [
"MIT"
] | null | null | null | manage.py | miguelalf/Backend-1 | 9179c78b0caec670273097c005c25ee462bb6791 | [
"MIT"
] | 3 | 2021-06-10T22:54:34.000Z | 2021-10-20T03:46:55.000Z | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'cryptotracker.settings')
try:
from django.core.management import execute_from_command_line
excep... | 29.086957 | 77 | 0.681614 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'cryptotracker.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
f7671f2709e868ded389e433898504de55a1ad59 | 3,490 | py | Python | ietf/utils/jstest.py | hassanakbar4/ietfdb-filter-repo | bb270a15a902b705395236df0f794271ef515daf | [
"BSD-3-Clause"
] | null | null | null | ietf/utils/jstest.py | hassanakbar4/ietfdb-filter-repo | bb270a15a902b705395236df0f794271ef515daf | [
"BSD-3-Clause"
] | 1 | 2022-03-11T08:20:11.000Z | 2022-03-11T08:21:53.000Z | ietf/utils/jstest.py | hassanakbar4/ietfdb-filter-repo | bb270a15a902b705395236df0f794271ef515daf | [
"BSD-3-Clause"
] | null | null | null | # Copyright The IETF Trust 2014-2021, All Rights Reserved
# -*- coding: utf-8 -*-
from django.urls import reverse as urlreverse
from unittest import skipIf
skip_selenium = False
skip_message = ""
try:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdr... | 34.215686 | 96 | 0.708023 |
from django.urls import reverse as urlreverse
from unittest import skipIf
skip_selenium = False
skip_message = ""
try:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.action_chain... | true | true |
f7672001e6184baa65bc25b0586dd9ba28e2429f | 3,330 | py | Python | src/nlp4musa2020/analytics.py | dbis-uibk/NLP4MusA2020 | 1d0ab42a7aea416110fbacd632e5bce359b863e8 | [
"BSD-3-Clause"
] | null | null | null | src/nlp4musa2020/analytics.py | dbis-uibk/NLP4MusA2020 | 1d0ab42a7aea416110fbacd632e5bce359b863e8 | [
"BSD-3-Clause"
] | null | null | null | src/nlp4musa2020/analytics.py | dbis-uibk/NLP4MusA2020 | 1d0ab42a7aea416110fbacd632e5bce359b863e8 | [
"BSD-3-Clause"
] | null | null | null | """Module providing common functions used for analytics."""
import os.path
from dbispipeline.analytics import extract_gridsearch_parameters
from dbispipeline.db import DB
import matplotlib.pyplot as plt
import pandas as pd
def get_results(project_name, filter_git_dirty=True):
"""Returns the results stored in the... | 32.019231 | 77 | 0.655255 | import os.path
from dbispipeline.analytics import extract_gridsearch_parameters
from dbispipeline.db import DB
import matplotlib.pyplot as plt
import pandas as pd
def get_results(project_name, filter_git_dirty=True):
results = pd.read_sql_table(table_name='results', con=DB.engine)
if filter_git_dirty:
... | true | true |
f767201496cb15d26ca0768e686af22c90af9108 | 9,960 | py | Python | homeassistant/components/modbus/base_platform.py | RavensburgOP/core | 0ea76e848b182ca0ebb0fdb54558f7f733898ad7 | [
"Apache-2.0"
] | 1 | 2019-08-28T00:54:28.000Z | 2019-08-28T00:54:28.000Z | homeassistant/components/modbus/base_platform.py | RavensburgOP/core | 0ea76e848b182ca0ebb0fdb54558f7f733898ad7 | [
"Apache-2.0"
] | 72 | 2020-08-03T07:31:01.000Z | 2022-03-31T06:11:49.000Z | homeassistant/components/modbus/base_platform.py | RavensburgOP/core | 0ea76e848b182ca0ebb0fdb54558f7f733898ad7 | [
"Apache-2.0"
] | null | null | null | """Base implementation for all modbus platforms."""
from __future__ import annotations
from abc import abstractmethod
from datetime import timedelta
import logging
import struct
from typing import Any
from homeassistant.const import (
CONF_ADDRESS,
CONF_COMMAND_OFF,
CONF_COMMAND_ON,
CONF_COUNT,
CO... | 36.086957 | 93 | 0.610442 | from __future__ import annotations
from abc import abstractmethod
from datetime import timedelta
import logging
import struct
from typing import Any
from homeassistant.const import (
CONF_ADDRESS,
CONF_COMMAND_OFF,
CONF_COMMAND_ON,
CONF_COUNT,
CONF_DELAY,
CONF_DEVICE_CLASS,
CONF_NAME,
... | true | true |
f767208a2edc8c86a79880a21840e893624fbfd3 | 12,028 | py | Python | catkin_ws/src/lane_filter/src/lane_filter_node.py | afiolmahon/ducky25 | c740931bee73526e0edb22f3a1f9bf3d71287b1a | [
"CC-BY-2.0"
] | null | null | null | catkin_ws/src/lane_filter/src/lane_filter_node.py | afiolmahon/ducky25 | c740931bee73526e0edb22f3a1f9bf3d71287b1a | [
"CC-BY-2.0"
] | null | null | null | catkin_ws/src/lane_filter/src/lane_filter_node.py | afiolmahon/ducky25 | c740931bee73526e0edb22f3a1f9bf3d71287b1a | [
"CC-BY-2.0"
] | null | null | null | #!/usr/bin/env python
import rospy
import numpy as np
from cv_bridge import CvBridge, CvBridgeError
from sensor_msgs.msg import Image
from std_msgs.msg import Float32
from duckietown_msgs.msg import SegmentList, Segment, Pixel, LanePose, BoolStamped, Twist2DStamped
from scipy.stats import multivariate_normal, entropy
f... | 41.619377 | 257 | 0.627286 | import rospy
import numpy as np
from cv_bridge import CvBridge, CvBridgeError
from sensor_msgs.msg import Image
from std_msgs.msg import Float32
from duckietown_msgs.msg import SegmentList, Segment, Pixel, LanePose, BoolStamped, Twist2DStamped
from scipy.stats import multivariate_normal, entropy
from scipy.ndimage.filt... | true | true |
f7672092d139a82cb89a9da0003f8e8150419919 | 1,002 | py | Python | session_module.py | zapstar/gae-facebook | 7906f6a04baf1ef390a9f0793d23698740882fbf | [
"MIT"
] | null | null | null | session_module.py | zapstar/gae-facebook | 7906f6a04baf1ef390a9f0793d23698740882fbf | [
"MIT"
] | null | null | null | session_module.py | zapstar/gae-facebook | 7906f6a04baf1ef390a9f0793d23698740882fbf | [
"MIT"
] | null | null | null | #Import sessions for session handling
import webapp2
from webapp2_extras import sessions
#This is needed to configure the session secret key
#Runs first in the whole application
session_config = {}
session_config['webapp2_extras.sessions'] = {
'secret_key': 'my-super-secret-key-somemorearbitarythingstosay'... | 34.551724 | 70 | 0.698603 | import webapp2
from webapp2_extras import sessions
session_config = {}
session_config['webapp2_extras.sessions'] = {
'secret_key': 'my-super-secret-key-somemorearbitarythingstosay',
}
class BaseSessionHandler(webapp2.RequestHandler):
def dispatch(self):
self.session_store = sessions.... | true | true |
f76721b88767c0b5702e3721600ad68a423acc31 | 570 | py | Python | api/tasks.py | IamMayankThakur/farm-bid | 0985fb01737fb82134af752c730d51ff943054c2 | [
"MIT"
] | null | null | null | api/tasks.py | IamMayankThakur/farm-bid | 0985fb01737fb82134af752c730d51ff943054c2 | [
"MIT"
] | null | null | null | api/tasks.py | IamMayankThakur/farm-bid | 0985fb01737fb82134af752c730d51ff943054c2 | [
"MIT"
] | null | null | null | from celery import task
from .models import Bid
from django.conf import settings
import requests
@task
def check_for_bid_confirmation(bid_id):
bid = Bid.objects.get(id=bid_id)
item = bid.item
item.buyer = bid.current_bidder
item.cost_sold = bid.current_highest
item.save()
bid.delete()
prin... | 24.782609 | 61 | 0.691228 | from celery import task
from .models import Bid
from django.conf import settings
import requests
@task
def check_for_bid_confirmation(bid_id):
bid = Bid.objects.get(id=bid_id)
item = bid.item
item.buyer = bid.current_bidder
item.cost_sold = bid.current_highest
item.save()
bid.delete()
prin... | true | true |
f76722814f9b31fdcc4310789c50c9c8e743260d | 675 | py | Python | WEEKS/wk19/sprint-prep/prac/gists/reverseNodesInKGroups.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | WEEKS/wk19/sprint-prep/prac/gists/reverseNodesInKGroups.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | WEEKS/wk19/sprint-prep/prac/gists/reverseNodesInKGroups.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | def reverseList(head, tail):
prev = None
while prev != tail:
prev, prev.next, head = head, prev, head.next
return prev
def reverseNodesInKGroups(l, k):
if k < 2:
return l
p = ListNode(-1)
p.next = l
ret = p
while True:
flag = True
tmp = p
for i ... | 18.75 | 53 | 0.422222 | def reverseList(head, tail):
prev = None
while prev != tail:
prev, prev.next, head = head, prev, head.next
return prev
def reverseNodesInKGroups(l, k):
if k < 2:
return l
p = ListNode(-1)
p.next = l
ret = p
while True:
flag = True
tmp = p
for i ... | true | true |
f76722cbd53446252251f3535edf61b177bbe846 | 85 | py | Python | tick/__init__.py | sumau/tick | 1b56924a35463e12f7775bc0aec182364f26f2c6 | [
"BSD-3-Clause"
] | 411 | 2017-03-30T15:22:05.000Z | 2022-03-27T01:58:34.000Z | tick/__init__.py | saurabhdash/tick | bbc561804eb1fdcb4c71b9e3e2d83a66e7b13a48 | [
"BSD-3-Clause"
] | 345 | 2017-04-13T14:53:20.000Z | 2022-03-26T00:46:22.000Z | tick/__init__.py | saurabhdash/tick | bbc561804eb1fdcb4c71b9e3e2d83a66e7b13a48 | [
"BSD-3-Clause"
] | 102 | 2017-04-25T11:47:53.000Z | 2022-02-15T11:45:49.000Z | # -*- coding: utf-8 -*-
"""tick module
"""
# License: BSD 3 clause
import tick.base
| 12.142857 | 23 | 0.6 |
import tick.base
| true | true |
f76725cd5388871cda8ad0e3a433f84a98548287 | 4,260 | py | Python | main.py | Lisennlp/distributed_train_pytorch | da43ac6b5f4484b5f7bc92e3c778539b9017cb82 | [
"Apache-2.0"
] | 10 | 2021-06-30T13:12:49.000Z | 2022-01-19T11:30:12.000Z | main.py | tonylibing/distributed_train_pytorch | da43ac6b5f4484b5f7bc92e3c778539b9017cb82 | [
"Apache-2.0"
] | 1 | 2021-12-20T07:07:52.000Z | 2021-12-23T03:29:58.000Z | main.py | tonylibing/distributed_train_pytorch | da43ac6b5f4484b5f7bc92e3c778539b9017cb82 | [
"Apache-2.0"
] | 4 | 2021-11-11T01:44:50.000Z | 2022-03-02T02:36:07.000Z | import argparse
import os
import random
import torch
from torch import distributed as dist
from torch.utils.data import DataLoader
from torch.nn.parallel import DistributedDataParallel as DDP
from torch.utils.data.distributed import DistributedSampler
import torch.nn as nn
import torch.nn.functional as F
import numpy ... | 32.030075 | 99 | 0.633333 | import argparse
import os
import random
import torch
from torch import distributed as dist
from torch.utils.data import DataLoader
from torch.nn.parallel import DistributedDataParallel as DDP
from torch.utils.data.distributed import DistributedSampler
import torch.nn as nn
import torch.nn.functional as F
import numpy ... | true | true |
f76726787085e28ad42422fc6f56e7067560f1a4 | 1,490 | py | Python | test/functional/wallet_fallbackfee.py | Bits-Coin/bits-coin | dd8220018f5582e76d43e8c52bd323524e495d8c | [
"MIT"
] | 2 | 2021-11-17T23:05:13.000Z | 2021-11-17T23:05:32.000Z | test/functional/wallet_fallbackfee.py | Bits-Coin/bits-coin | dd8220018f5582e76d43e8c52bd323524e495d8c | [
"MIT"
] | null | null | null | test/functional/wallet_fallbackfee.py | Bits-Coin/bits-coin | dd8220018f5582e76d43e8c52bd323524e495d8c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017-2018 The BitsCoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test wallet replace-by-fee capabilities in conjunction with the fallbackfee."""
from test_framework.te... | 48.064516 | 178 | 0.731544 | from test_framework.test_framework import BitsCoinTestFramework
from test_framework.util import assert_raises_rpc_error
class WalletRBFTest(BitsCoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.setup_clean_chain = True
def skip_test_if_missing_module(self):
self.sk... | true | true |
f7672719603fe1a02ab567be0bcfe946bdb2a09e | 302 | py | Python | conanfile.py | levenkov/alphabet | 0a23869649bf8416602462c2771370143f50e09e | [
"MIT"
] | null | null | null | conanfile.py | levenkov/alphabet | 0a23869649bf8416602462c2771370143f50e09e | [
"MIT"
] | null | null | null | conanfile.py | levenkov/alphabet | 0a23869649bf8416602462c2771370143f50e09e | [
"MIT"
] | null | null | null | from conans import ConanFile, CMake
class AbcConan(ConanFile):
generators = "cmake", "cmake_find_package"
requires = "boost/1.76.0"
def build(self):
cmake = self.cmake
cmake.configure()
cmake.build()
@property
def cmake(self):
return CMake(self)
| 18.875 | 46 | 0.619205 | from conans import ConanFile, CMake
class AbcConan(ConanFile):
generators = "cmake", "cmake_find_package"
requires = "boost/1.76.0"
def build(self):
cmake = self.cmake
cmake.configure()
cmake.build()
@property
def cmake(self):
return CMake(self)
| true | true |
f76727bc94b9259f1a0b37d6e913875d2f02f22c | 533 | py | Python | synbols/visualization.py | dvd42/synbols | 3f12a4d9354c7e05313fe0028a108b29409b7171 | [
"Apache-2.0"
] | 40 | 2020-09-11T23:38:48.000Z | 2022-03-05T15:20:02.000Z | synbols/visualization.py | dvd42/synbols | 3f12a4d9354c7e05313fe0028a108b29409b7171 | [
"Apache-2.0"
] | 10 | 2020-09-10T15:09:19.000Z | 2021-07-22T16:56:27.000Z | synbols/visualization.py | dvd42/synbols | 3f12a4d9354c7e05313fe0028a108b29409b7171 | [
"Apache-2.0"
] | 3 | 2020-09-17T12:09:41.000Z | 2021-08-31T09:59:41.000Z | from matplotlib import pyplot as plt
from .utils import make_img_grid
def plot_dataset(x, y, h_axis="char", v_axis="font", n_row=20, n_col=40, hide_axis=False):
img_grid, h_values, v_values = make_img_grid(x, y, h_axis, v_axis, n_row, n_col)
plt.tight_layout()
plt.imshow(img_grid)
plt.xlabel(h_axi... | 22.208333 | 90 | 0.675422 | from matplotlib import pyplot as plt
from .utils import make_img_grid
def plot_dataset(x, y, h_axis="char", v_axis="font", n_row=20, n_col=40, hide_axis=False):
img_grid, h_values, v_values = make_img_grid(x, y, h_axis, v_axis, n_row, n_col)
plt.tight_layout()
plt.imshow(img_grid)
plt.xlabel(h_axi... | true | true |
f7672824258e8e595fc8da8475d68bc89b8ae5ed | 1,496 | py | Python | user.py | KIRANRAJ6554/Telegram_VC_MusicBot | 1cde5c9c542370c4abcc7455af84ddef776a2a76 | [
"MIT"
] | null | null | null | user.py | KIRANRAJ6554/Telegram_VC_MusicBot | 1cde5c9c542370c4abcc7455af84ddef776a2a76 | [
"MIT"
] | null | null | null | user.py | KIRANRAJ6554/Telegram_VC_MusicBot | 1cde5c9c542370c4abcc7455af84ddef776a2a76 | [
"MIT"
] | 2 | 2021-11-12T18:15:02.000Z | 2022-01-25T08:57:29.000Z | #MIT License
#Copyright (c) 2021 Sangram Ghangale
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, pub... | 37.4 | 79 | 0.752674 |
from config import Config
from pyrogram import Client
from config import Config
REPLY_MESSAGE=Config.REPLY_MESSAGE
if REPLY_MESSAGE is not None:
USER = Client(
Config.SESSION,
Config.API_ID,
Config.API_HASH,
plugins=dict(root="userplugins")
)
else:
USER = Client(
... | true | true |
f767299211252b3099abb79bfe1a89b16ca79677 | 1,713 | py | Python | gradescrape/login.py | guineawheek/gradescrape | 88245c2a26decc499db2e8c5b75229b67fb6696b | [
"BSD-2-Clause"
] | null | null | null | gradescrape/login.py | guineawheek/gradescrape | 88245c2a26decc499db2e8c5b75229b67fb6696b | [
"BSD-2-Clause"
] | null | null | null | gradescrape/login.py | guineawheek/gradescrape | 88245c2a26decc499db2e8c5b75229b67fb6696b | [
"BSD-2-Clause"
] | null | null | null | # requires: selenium, geckodriver
# Somewhat deprecated. Only use if desparate.
import json
__all__ = ["interactive_school_login"]
def interactive_school_login(school="berkeley"):
"""
Uses Selenium to interactively grab tokens from an interactive saml login.
Returns the cookies obtained.
You can sa... | 30.589286 | 135 | 0.664915 | import json
__all__ = ["interactive_school_login"]
def interactive_school_login(school="berkeley"):
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import TimeoutException
driver = webdriver.Firefox()
print("Log into your Calne... | true | true |
f7672a8b6f38c44b1c3362f32af48a916bbc4c12 | 17,634 | py | Python | tensorflow/python/autograph/pyct/transpiler.py | ashutom/tensorflow-upstream | c16069c19de9e286dd664abb78d0ea421e9f32d4 | [
"Apache-2.0"
] | 11 | 2018-01-03T15:11:09.000Z | 2021-04-13T05:47:27.000Z | tensorflow/python/autograph/pyct/transpiler.py | CaptainGizzy21/tensorflow | 3457a2b122e50b4d44ceaaed5a663d635e5c22df | [
"Apache-2.0"
] | 1,056 | 2019-12-15T01:20:31.000Z | 2022-02-10T02:06:28.000Z | tensorflow/python/autograph/pyct/transpiler.py | CaptainGizzy21/tensorflow | 3457a2b122e50b4d44ceaaed5a663d635e5c22df | [
"Apache-2.0"
] | 10 | 2018-07-31T10:56:21.000Z | 2019-10-07T08:05:21.000Z | # Copyright 2016 The TensorFlow 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 applica... | 35.268 | 80 | 0.693093 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import inspect
import threading
import types
import gast
from tensorflow.python.autograph.pyct import cache
from tensorflow.python.autograph.pyct import inspect_utils
from tensorflow.python.autograph.pyct im... | true | true |
f7672c95a8b686ce0e4655b006ade954fd4cb034 | 929 | py | Python | examples/photoshop_session.py | MrTeferi/photoshop-python-api | 3467c345c836e0515af793d365edb83fe9166643 | [
"MIT"
] | 270 | 2020-04-11T22:41:20.000Z | 2022-03-29T09:16:43.000Z | examples/photoshop_session.py | MrTeferi/photoshop-python-api | 3467c345c836e0515af793d365edb83fe9166643 | [
"MIT"
] | 67 | 2020-04-18T08:12:34.000Z | 2022-03-31T16:51:56.000Z | examples/photoshop_session.py | MrTeferi/photoshop-python-api | 3467c345c836e0515af793d365edb83fe9166643 | [
"MIT"
] | 32 | 2020-05-13T10:51:04.000Z | 2022-03-19T02:53:43.000Z | """Add slate information dynamically."""
# Import built-in modules
from datetime import datetime
import os
from tempfile import mkdtemp
# Import third-party modules
import examples._psd_files as psd # Import from examples.
# Import local modules
from photoshop import Session
PSD_FILE = psd.get_psd_files()
file_pa... | 29.967742 | 75 | 0.715823 |
from datetime import datetime
import os
from tempfile import mkdtemp
import examples._psd_files as psd
from photoshop import Session
PSD_FILE = psd.get_psd_files()
file_path = PSD_FILE["slate_template.psd"]
with Session(file_path, action="open", auto_close=True) as ps:
layer_set = ps.active_document.layerSet... | true | true |
f7672f2f0049eef2780f51974740dbe6e4ef7c30 | 2,632 | py | Python | Medium/mysite/blog/migrations/0001_initial.py | MDRCS/Fullstack-Django | 20cbae6e1b70d7051662b579e7967061e529d71f | [
"MIT"
] | null | null | null | Medium/mysite/blog/migrations/0001_initial.py | MDRCS/Fullstack-Django | 20cbae6e1b70d7051662b579e7967061e529d71f | [
"MIT"
] | 19 | 2020-07-14T07:04:43.000Z | 2022-03-12T00:41:14.000Z | Medium/mysite/blog/migrations/0001_initial.py | MDRCS/Fullstack-Django | 20cbae6e1b70d7051662b579e7967061e529d71f | [
"MIT"
] | null | null | null | # Generated by Django 3.0.7 on 2020-07-01 18:26
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUT... | 41.125 | 190 | 0.573328 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
... | true | true |
f7672f68e9966f522d22fb52d8c5f70665ec9411 | 108,426 | py | Python | superset/views/core.py | datability-io/incubator-superset | ebb799140a20964802c0b427d8687ee1b45679b3 | [
"Apache-2.0",
"MIT"
] | 1 | 2019-02-05T04:53:37.000Z | 2019-02-05T04:53:37.000Z | superset/views/core.py | datability-io/incubator-superset | ebb799140a20964802c0b427d8687ee1b45679b3 | [
"Apache-2.0",
"MIT"
] | null | null | null | superset/views/core.py | datability-io/incubator-superset | ebb799140a20964802c0b427d8687ee1b45679b3 | [
"Apache-2.0",
"MIT"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.421229 | 90 | 0.583117 | from datetime import datetime, timedelta
import inspect
import logging
import os
import re
import time
import traceback
from urllib import parse
from flask import (
abort, flash, g, Markup, redirect, render_template, request, Response, url_for,
)
from flask_appbuilder import expose, SimpleFormView
from flask_appbu... | true | true |
f7672fe29948f798a23fafaed5d3ed86d5ae69ae | 681 | py | Python | src/visions/backends/python/types/uuid.py | bhumikapahariapuresoftware/visions | 8838d89b4f02e401112378b4662a779227ead9f8 | [
"BSD-4-Clause"
] | 142 | 2020-01-07T21:17:10.000Z | 2022-03-30T13:10:14.000Z | src/visions/backends/python/types/uuid.py | bhumikapahariapuresoftware/visions | 8838d89b4f02e401112378b4662a779227ead9f8 | [
"BSD-4-Clause"
] | 121 | 2020-01-07T02:26:38.000Z | 2022-03-29T17:18:19.000Z | src/visions/backends/python/types/uuid.py | bhumikapahariapuresoftware/visions | 8838d89b4f02e401112378b4662a779227ead9f8 | [
"BSD-4-Clause"
] | 18 | 2020-02-17T03:17:37.000Z | 2022-02-20T14:01:11.000Z | import uuid
from typing import Sequence
from visions.types.string import String
from visions.types.uuid import UUID
@UUID.contains_op.register
def uuid_contains(sequence: Sequence, state: dict) -> bool:
return all(isinstance(value, uuid.UUID) for value in sequence)
@UUID.register_transformer(String, Sequence)
... | 27.24 | 66 | 0.750367 | import uuid
from typing import Sequence
from visions.types.string import String
from visions.types.uuid import UUID
@UUID.contains_op.register
def uuid_contains(sequence: Sequence, state: dict) -> bool:
return all(isinstance(value, uuid.UUID) for value in sequence)
@UUID.register_transformer(String, Sequence)
... | true | true |
f76730466eb3e85f330f774c1474483668b42acd | 417 | py | Python | raddar/main.py | opayelle/raddar | c164813ea6dae0bfa51b6aa7f2afe0caa1e0d6fe | [
"MIT"
] | null | null | null | raddar/main.py | opayelle/raddar | c164813ea6dae0bfa51b6aa7f2afe0caa1e0d6fe | [
"MIT"
] | null | null | null | raddar/main.py | opayelle/raddar | c164813ea6dae0bfa51b6aa7f2afe0caa1e0d6fe | [
"MIT"
] | null | null | null | from fastapi import FastAPI
from raddar.api.api_v1.api import api_router
from raddar.db.database import engine
from raddar.models import models
from raddar.core.settings import settings
models.Base.metadata.create_all(bind=engine)
app = FastAPI()
# app = FastAPI(
# title=settings.PROJECT_NAME, openapi_url=f"{se... | 24.529412 | 84 | 0.798561 | from fastapi import FastAPI
from raddar.api.api_v1.api import api_router
from raddar.db.database import engine
from raddar.models import models
from raddar.core.settings import settings
models.Base.metadata.create_all(bind=engine)
app = FastAPI()
app.include_router(api_router, prefix=settings.API_V1_STR)
| true | true |
f76730e358ba666549c163ec440d56e8b9753f3d | 2,275 | py | Python | SSL/dataloader/samplers.py | rucmlcv/IEPT_FSL | 54b0a58b5928771ef8dcc6dcd6f4314739ffe14a | [
"MIT"
] | 20 | 2021-06-28T06:33:05.000Z | 2022-03-31T13:12:26.000Z | SSL/dataloader/samplers.py | rucmlcv/IEPT_FSL | 54b0a58b5928771ef8dcc6dcd6f4314739ffe14a | [
"MIT"
] | 2 | 2021-08-06T07:21:39.000Z | 2022-03-31T01:52:26.000Z | SSL/dataloader/samplers.py | rucmlcv/IEPT_FSL | 54b0a58b5928771ef8dcc6dcd6f4314739ffe14a | [
"MIT"
] | 3 | 2021-06-28T07:21:53.000Z | 2022-02-14T14:16:41.000Z | import torch
import numpy as np
class CategoriesSamplerBak():
def __init__(self, label, n_batch, n_cls, n_per): #n_batch 为 一个epoch的episode数亩
self.n_batch = n_batch
self.n_cls = n_cls
self.n_per = n_per
self.n_step = 0
self.mark = {}
self.r_clses = None
... | 26.453488 | 82 | 0.512527 | import torch
import numpy as np
class CategoriesSamplerBak():
def __init__(self, label, n_batch, n_cls, n_per):
self.n_batch = n_batch
self.n_cls = n_cls
self.n_per = n_per
self.n_step = 0
self.mark = {}
self.r_clses = None
label = np.array(label)... | true | true |
f767320e5a3fdb8cc7304a27a05fb262c62cccf0 | 143 | py | Python | Python_URI/1013.py | matheus258/Python_URI | 2b9b393bab710e060fb4be953b0b9171c5dc89d4 | [
"MIT"
] | null | null | null | Python_URI/1013.py | matheus258/Python_URI | 2b9b393bab710e060fb4be953b0b9171c5dc89d4 | [
"MIT"
] | null | null | null | Python_URI/1013.py | matheus258/Python_URI | 2b9b393bab710e060fb4be953b0b9171c5dc89d4 | [
"MIT"
] | null | null | null | valores = input().split()
A = int(valores[0])
B = int(valores[1])
C = int(valores[2])
maior = max(A, B, C)
print(str(maior)+' eh o maior')
| 15.888889 | 33 | 0.594406 | valores = input().split()
A = int(valores[0])
B = int(valores[1])
C = int(valores[2])
maior = max(A, B, C)
print(str(maior)+' eh o maior')
| true | true |
f76732810fc604a140d6eecbb79bc93c35a18770 | 75,752 | py | Python | build/lib/histcensusgis/polygons/ed.py | graziul/hist-census-gis | 558bf38cd0e444b5a91133dd70c88210da3cbbc9 | [
"MIT"
] | 4 | 2017-05-15T20:54:25.000Z | 2019-01-30T19:04:24.000Z | build/lib/histcensusgis/polygons/ed.py | graziul/hist-census-gis | 558bf38cd0e444b5a91133dd70c88210da3cbbc9 | [
"MIT"
] | null | null | null | build/lib/histcensusgis/polygons/ed.py | graziul/hist-census-gis | 558bf38cd0e444b5a91133dd70c88210da3cbbc9 | [
"MIT"
] | 1 | 2017-07-12T18:06:19.000Z | 2017-07-12T18:06:19.000Z | # -*- coding: utf-8 -*-
#
# EDguess.py - combines multiple automated approaches to identifying EDs into one shapefile
#
from histcensusgis.points.geocode import check_matt_dependencies, initial_geocode
from histcensusgis.microdata.misc import create_addresses
from histcensusgis.s4utils.AmoryUtils import *
from histce... | 37.334648 | 367 | 0.69717 |
from histcensusgis.points.geocode import check_matt_dependencies, initial_geocode
from histcensusgis.microdata.misc import create_addresses
from histcensusgis.s4utils.AmoryUtils import *
from histcensusgis.s4utils.IOutils import *
from histcensusgis.text.standardize import *
from histcensusgis.polygons.block import c... | false | true |
f7673333c1ab5a2a57f37e81cbb95e8b8922bad4 | 13,536 | py | Python | pymesos/process.py | DailyDreaming/toil-pymesos | e6438e5c48b25ef2e99adb0da07808ccc371b726 | [
"BSD-3-Clause"
] | 2 | 2020-04-10T14:45:00.000Z | 2020-08-14T16:38:32.000Z | pymesos/process.py | DailyDreaming/toil-pymesos | e6438e5c48b25ef2e99adb0da07808ccc371b726 | [
"BSD-3-Clause"
] | null | null | null | pymesos/process.py | DailyDreaming/toil-pymesos | e6438e5c48b25ef2e99adb0da07808ccc371b726 | [
"BSD-3-Clause"
] | 1 | 2020-04-09T00:35:17.000Z | 2020-04-09T00:35:17.000Z | import os
import re
import sys
import json
import time
import math
import errno
import random
import select
import signal
import socket
import logging
from six import reraise
from six.moves import _thread as thread
from six.moves.http_client import OK, TEMPORARY_REDIRECT, SERVICE_UNAVAILABLE
from six.moves.urllib.parse... | 30.624434 | 79 | 0.492686 | import os
import re
import sys
import json
import time
import math
import errno
import random
import select
import signal
import socket
import logging
from six import reraise
from six.moves import _thread as thread
from six.moves.http_client import OK, TEMPORARY_REDIRECT, SERVICE_UNAVAILABLE
from six.moves.urllib.parse... | true | true |
f7673366afb9e4028c9c8cf97ce0cf65cdd191a7 | 147,091 | py | Python | src/scaffoldmaker/meshtypes/meshtype_3d_stomach1.py | zekh167/scaffoldmaker | de77f0ad424d90d04e3ea182071cc0a4cc9086c8 | [
"Apache-2.0"
] | null | null | null | src/scaffoldmaker/meshtypes/meshtype_3d_stomach1.py | zekh167/scaffoldmaker | de77f0ad424d90d04e3ea182071cc0a4cc9086c8 | [
"Apache-2.0"
] | null | null | null | src/scaffoldmaker/meshtypes/meshtype_3d_stomach1.py | zekh167/scaffoldmaker | de77f0ad424d90d04e3ea182071cc0a4cc9086c8 | [
"Apache-2.0"
] | null | null | null | """
Generates a 3-D stomach mesh along the central line, with variable
numbers of elements around esophagus and duodenum, along and through
wall, with variable radius and thickness along.
"""
from __future__ import division
import math
import copy
from scaffoldmaker.annotation.annotationgroup import AnnotationGroup, m... | 58.161724 | 232 | 0.572265 |
from __future__ import division
import math
import copy
from scaffoldmaker.annotation.annotationgroup import AnnotationGroup, mergeAnnotationGroups, \
getAnnotationGroupForTerm, findOrCreateAnnotationGroupForTerm
from scaffoldmaker.annotation.stomach_terms import get_stomach_term
from opencmiss.utils.zinc.field im... | true | true |
f767338b4dfe7bfe1cb4d65765f3afedf0920b29 | 2,870 | py | Python | tests/datana/code_processing/test_num_axes_counter.py | rbavishi/databutler | 222263672dae8b519d0592a6bbe68a01dc4ce95d | [
"BSD-2-Clause"
] | null | null | null | tests/datana/code_processing/test_num_axes_counter.py | rbavishi/databutler | 222263672dae8b519d0592a6bbe68a01dc4ce95d | [
"BSD-2-Clause"
] | 1 | 2022-02-11T06:19:45.000Z | 2022-02-11T06:19:45.000Z | tests/datana/code_processing/test_num_axes_counter.py | rbavishi/databutler | 222263672dae8b519d0592a6bbe68a01dc4ce95d | [
"BSD-2-Clause"
] | null | null | null | import textwrap
import unittest
from databutler.datana.generic.corpus.code import DatanaFunction
from databutler.datana.viz.corpus.code_processors import VizMplAxesCounter
from databutler.utils import multiprocess
from databutler.utils.libversioning import modified_lib_env
def _runner(func: DatanaFunction):
# N... | 37.272727 | 108 | 0.607666 | import textwrap
import unittest
from databutler.datana.generic.corpus.code import DatanaFunction
from databutler.datana.viz.corpus.code_processors import VizMplAxesCounter
from databutler.utils import multiprocess
from databutler.utils.libversioning import modified_lib_env
def _runner(func: DatanaFunction):
... | true | true |
f76733927117be89a8cdef2ebe814ed821758380 | 1,364 | py | Python | leetcode/math_rotate_fn.py | ngovindaraj/Python | edbcd302533bef81aa0c01e902e6081df58f383c | [
"MIT"
] | null | null | null | leetcode/math_rotate_fn.py | ngovindaraj/Python | edbcd302533bef81aa0c01e902e6081df58f383c | [
"MIT"
] | null | null | null | leetcode/math_rotate_fn.py | ngovindaraj/Python | edbcd302533bef81aa0c01e902e6081df58f383c | [
"MIT"
] | null | null | null | # @file Rotate Function
# @brief Calculate the maximum value of F(0), F(1), ..., F(n-1).
# https://leetcode.com/problems/rotate-function/
'''
Given an array of integers A and let n to be its length.
Assume Bk to be an array obtained by rotating the array A k positions clock-wise, we define a "rotation function" F o... | 29.652174 | 131 | 0.494868 |
def maxRotateFunction(self, A):
sum, f, ans = 0, 0, 0
for i in range(len(A)):
sum += A[i]
f += i * A[i]
ans = f for toRemoveIdx in range(len(A)-1, 0, -1):
f = f + sum - len(A) * A[toRemoveIdx]
ans = max(ans, f)
... | true | true |
f767354ac0186e98e580453a8ac2dce635698a1a | 4,255 | py | Python | tests/conversion/sequential/test_conv2d_model_same_padding.py | jianwang-ntu/deeplift_tf2.0 | 957511e3e307fdb93f65bf54cc2b5214e5374f49 | [
"MIT"
] | null | null | null | tests/conversion/sequential/test_conv2d_model_same_padding.py | jianwang-ntu/deeplift_tf2.0 | 957511e3e307fdb93f65bf54cc2b5214e5374f49 | [
"MIT"
] | null | null | null | tests/conversion/sequential/test_conv2d_model_same_padding.py | jianwang-ntu/deeplift_tf2.0 | 957511e3e307fdb93f65bf54cc2b5214e5374f49 | [
"MIT"
] | null | null | null | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import unittest
from unittest import skip
import sys
import os
import numpy as np
np.random.seed(1234)
from deeplift.conversion import kerasapi_conversion as kc
import deeplift.layers as layers
from deeplift.lay... | 43.418367 | 78 | 0.596005 | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import unittest
from unittest import skip
import sys
import os
import numpy as np
np.random.seed(1234)
from deeplift.conversion import kerasapi_conversion as kc
import deeplift.layers as layers
from deeplift.lay... | true | true |
f767369ef418fae6ee447de0618b7434429673cc | 3,788 | py | Python | kospeech/optim/adamp.py | Rhcsky/KoSpeech | dbff78140d150dcc71d14d65f81c011847e9574d | [
"Apache-2.0"
] | null | null | null | kospeech/optim/adamp.py | Rhcsky/KoSpeech | dbff78140d150dcc71d14d65f81c011847e9574d | [
"Apache-2.0"
] | null | null | null | kospeech/optim/adamp.py | Rhcsky/KoSpeech | dbff78140d150dcc71d14d65f81c011847e9574d | [
"Apache-2.0"
] | null | null | null | # AdamP
# Copyright (c) 2020-present NAVER Corp.
# MIT license
import torch
from torch.optim.optimizer import Optimizer
import math
class AdamP(Optimizer):
"""
Paper: "AdamP: Slowing Down the Slowdown for Momentum Optimizers on Scale-invariant Weights"
Copied from https://github.com/clovaai... | 34.436364 | 110 | 0.507128 |
import torch
from torch.optim.optimizer import Optimizer
import math
class AdamP(Optimizer):
def __init__(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-8,
weight_decay=0, delta=0.1, wd_ratio=0.1, nesterov=False):
defaults = dict(lr=lr, betas=betas, eps=eps, weight_decay=weig... | true | true |
f76738ac0b6122c60d51c7b5c73afc63d9dde6e6 | 7,902 | py | Python | tests/test_mst.py | jlmaurer/PyRate | bf1a3d916f1c83e7a0dda3ecc15858f8f1e4ee84 | [
"Apache-2.0"
] | 1 | 2018-11-01T04:45:19.000Z | 2018-11-01T04:45:19.000Z | tests/test_mst.py | bingo456/PyRate | bf1a3d916f1c83e7a0dda3ecc15858f8f1e4ee84 | [
"Apache-2.0"
] | null | null | null | tests/test_mst.py | bingo456/PyRate | bf1a3d916f1c83e7a0dda3ecc15858f8f1e4ee84 | [
"Apache-2.0"
] | 1 | 2020-12-31T00:34:35.000Z | 2020-12-31T00:34:35.000Z | # This Python module is part of the PyRate software package.
#
# Copyright 2017 Geoscience Australia
#
# 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/... | 35.918182 | 82 | 0.631992 |
import glob
import os
import shutil
import subprocess
import tempfile
import unittest
from itertools import product
from numpy import empty, array, nan, isnan, sum as nsum
import numpy as np
from tests.common import MockIfg, small5_mock_ifgs, small_data_setup
from pyrate import algorithm
from pyrate import config as... | true | true |
f767396492ef0018d49d69390e8a126ab7ff5d89 | 298 | py | Python | rh/config/docs.py | sihaysistema/rh | a6b0829e8ba98544cc9389fcfd7fe637ac857c9e | [
"MIT"
] | null | null | null | rh/config/docs.py | sihaysistema/rh | a6b0829e8ba98544cc9389fcfd7fe637ac857c9e | [
"MIT"
] | 5 | 2019-05-31T23:32:09.000Z | 2022-03-16T03:38:19.000Z | rh/config/docs.py | sihaysistema/rh | a6b0829e8ba98544cc9389fcfd7fe637ac857c9e | [
"MIT"
] | null | null | null | """
Configuration for docs
"""
# source_link = "https://github.com/[org_name]/rh"
# docs_base_url = "https://[org_name].github.io/rh"
# headline = "App that does everything"
# sub_heading = "Yes, you got that right the first time, everything"
def get_context(context):
context.brand_html = "RH"
| 24.833333 | 68 | 0.708054 |
def get_context(context):
context.brand_html = "RH"
| true | true |
f767399db54778d7efdf6346313f9796289ca9b4 | 6,550 | py | Python | crawl/bazel.py | dylanShark/pomgen | 311dc718e4796b0b03de65a318e264df9a44bbde | [
"BSD-3-Clause"
] | null | null | null | crawl/bazel.py | dylanShark/pomgen | 311dc718e4796b0b03de65a318e264df9a44bbde | [
"BSD-3-Clause"
] | null | null | null | crawl/bazel.py | dylanShark/pomgen | 311dc718e4796b0b03de65a318e264df9a44bbde | [
"BSD-3-Clause"
] | null | null | null | """
Copyright (c) 2018, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
This module has methods that return information about the monorepo structure.
Whenever possible, the cod... | 37.215909 | 152 | 0.661679 |
from common import mdfiles
from common.os_util import run_cmd
from common import logger
from crawl import dependency
import os
import json
def query_java_library_deps_attributes(repository_root_path, target_pattern):
if target_pattern.endswith("..."):
raise Exception("target_pattern must be more specific... | true | true |
f7673a7730237877d2f8b198dc7725b231f62d64 | 1,547 | py | Python | AICloudAlbum/urls.py | NeKoSaNnn/AICloudAlbum | 2ed6936bf6126f37eb4cca384ba8731850e98880 | [
"MIT"
] | 2 | 2021-04-10T14:03:08.000Z | 2021-08-31T09:39:43.000Z | AICloudAlbum/urls.py | NeKoSaNnn/AICloudAlbum | 2ed6936bf6126f37eb4cca384ba8731850e98880 | [
"MIT"
] | null | null | null | AICloudAlbum/urls.py | NeKoSaNnn/AICloudAlbum | 2ed6936bf6126f37eb4cca384ba8731850e98880 | [
"MIT"
] | 1 | 2021-08-15T10:25:46.000Z | 2021-08-15T10:25:46.000Z | """AICloudAlbum URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-... | 35.159091 | 78 | 0.720103 | from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include, re_path
from django.contrib.staticfiles.views import serve
from Album import views
from AICloudAlbum import settings
def return_static(request, path, insecure=True, **kwargs):
return serve(request, ... | true | true |
f7673ae10e7de6de3c23b3b3523fbe6ea9e77e97 | 173 | py | Python | 1_languages/python/src/types_tuple.py | praisetompane/3_programming | dd3e2e89a36a613d895fdbdd9c03845cb648fddf | [
"MIT"
] | null | null | null | 1_languages/python/src/types_tuple.py | praisetompane/3_programming | dd3e2e89a36a613d895fdbdd9c03845cb648fddf | [
"MIT"
] | null | null | null | 1_languages/python/src/types_tuple.py | praisetompane/3_programming | dd3e2e89a36a613d895fdbdd9c03845cb648fddf | [
"MIT"
] | null | null | null | '''
immutable
'''
letters = ("a", "b", "c", "d", "c")
print(letters.count("c"))
print(letters.index("d"))
coordinates = (94, 6, 7)
x, y, z = coordinates
print(x, y, z) | 15.727273 | 35 | 0.543353 | letters = ("a", "b", "c", "d", "c")
print(letters.count("c"))
print(letters.index("d"))
coordinates = (94, 6, 7)
x, y, z = coordinates
print(x, y, z) | true | true |
f7673bebb4734c7f3097c1f12e5c4b1cd402e321 | 1,636 | py | Python | nmigen_boards/tinyfpga_bx.py | AsuMagic/nmigen-boards | 5591cd589ef53869878bda91cf835e00c73a3c02 | [
"BSD-2-Clause"
] | 1 | 2021-02-22T22:12:14.000Z | 2021-02-22T22:12:14.000Z | nmigen_boards/tinyfpga_bx.py | AsuMagic/nmigen-boards | 5591cd589ef53869878bda91cf835e00c73a3c02 | [
"BSD-2-Clause"
] | null | null | null | nmigen_boards/tinyfpga_bx.py | AsuMagic/nmigen-boards | 5591cd589ef53869878bda91cf835e00c73a3c02 | [
"BSD-2-Clause"
] | null | null | null | import os
import subprocess
from nmigen.build import *
from nmigen.vendor.lattice_ice40 import *
from .resources import *
__all__ = ["TinyFPGABXPlatform"]
class TinyFPGABXPlatform(LatticeICE40Platform):
device = "iCE40LP8K"
package = "CM81"
default_clk = "clk16"
resources = [
Res... | 30.296296 | 75 | 0.558068 | import os
import subprocess
from nmigen.build import *
from nmigen.vendor.lattice_ice40 import *
from .resources import *
__all__ = ["TinyFPGABXPlatform"]
class TinyFPGABXPlatform(LatticeICE40Platform):
device = "iCE40LP8K"
package = "CM81"
default_clk = "clk16"
resources = [
Res... | true | true |
f7673bf32c3bb3b4d6f97039d8dd0306452e0617 | 3,436 | py | Python | transactions.py | just-anohaker/entanmopy | be90aa54b673aa3a19028ecaca5edb791a848e37 | [
"MIT"
] | null | null | null | transactions.py | just-anohaker/entanmopy | be90aa54b673aa3a19028ecaca5edb791a848e37 | [
"MIT"
] | null | null | null | transactions.py | just-anohaker/entanmopy | be90aa54b673aa3a19028ecaca5edb791a848e37 | [
"MIT"
] | 1 | 2019-04-16T05:27:33.000Z | 2019-04-16T05:27:33.000Z | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
import http_helper as http
_kPaths = {
# get
'getTransaction': '/api/transactions/get',
# get
'getTransactions': '/api/transactions',
# get
'getUnconfirmedTransaction': '/api/transactions/unconfirmed/get',
# get
'getUnconfirmedTransaction... | 36.553191 | 237 | 0.671711 |
import http_helper as http
_kPaths = {
'getTransaction': '/api/transactions/get',
'getTransactions': '/api/transactions',
'getUnconfirmedTransaction': '/api/transactions/unconfirmed/get',
'getUnconfirmedTransactions': '/api/transactions/unconfirmed',
'add': '/api/transactions',... | true | true |
f7673c369eabda83ca7cad7388acca461536d5d3 | 1,025 | py | Python | word_tools/merriam_provider.py | ncdulo/word_tools | b3a9043bfb5fa1c14fd2494b9bae3f125dbbecc5 | [
"MIT"
] | 3 | 2020-03-15T23:24:48.000Z | 2020-04-23T17:50:17.000Z | word_tools/merriam_provider.py | ncdulo/word_tools | b3a9043bfb5fa1c14fd2494b9bae3f125dbbecc5 | [
"MIT"
] | 12 | 2020-03-26T00:55:52.000Z | 2021-12-13T20:36:17.000Z | word_tools/merriam_provider.py | ncdulo/word_tools | b3a9043bfb5fa1c14fd2494b9bae3f125dbbecc5 | [
"MIT"
] | null | null | null | from .lookup_provider import LookupProvider
class MerriamProvider(LookupProvider):
'''Concrete provider which provides web results from Merriam-Webster
dictionary.
'''
def lookup(self, word, limit=0):
'''Yield str results for `word` up to `limit`. When `limit == 0`,
return all results.... | 33.064516 | 76 | 0.642927 | from .lookup_provider import LookupProvider
class MerriamProvider(LookupProvider):
def lookup(self, word, limit=0):
soup = self.url_to_soup(
f'http://www.merriam-webster.com/dictionary/{word}'
)
for definition in soup.find_all('span', class_='dt', limit=limit):
... | true | true |
f7673cac2e53142af5ed2434c6a614b68c062378 | 801 | py | Python | challenges/queue_and_stack/queue_with_stacks/queue_with_stacks/queue_with_stacks.py | bayan-alkhatib/data-structures-and-algorithms-401 | c22e0adf159392a8925f07a36b3083654d3a7002 | [
"MIT"
] | null | null | null | challenges/queue_and_stack/queue_with_stacks/queue_with_stacks/queue_with_stacks.py | bayan-alkhatib/data-structures-and-algorithms-401 | c22e0adf159392a8925f07a36b3083654d3a7002 | [
"MIT"
] | 11 | 2021-06-14T00:14:54.000Z | 2021-06-30T00:08:30.000Z | challenges/queue_and_stack/queue_with_stacks/queue_with_stacks/queue_with_stacks.py | bayan-alkhatib/data-structures-and-algorithms-401 | c22e0adf159392a8925f07a36b3083654d3a7002 | [
"MIT"
] | 1 | 2021-07-26T11:08:29.000Z | 2021-07-26T11:08:29.000Z | from queue_with_stacks.stack_and_queue import Stack
class PseudoQueue:
def __init__(self):
self.front=Stack()
self.rear=Stack()
def enqueue(self,value):
if value!= None:
self.front.push(value)
return self.front.top.value
else:
return Fals... | 19.536585 | 53 | 0.516854 | from queue_with_stacks.stack_and_queue import Stack
class PseudoQueue:
def __init__(self):
self.front=Stack()
self.rear=Stack()
def enqueue(self,value):
if value!= None:
self.front.push(value)
return self.front.top.value
else:
return Fals... | true | true |
f7673e0b7c21166a722cfa00d49f437f9cd35828 | 64,480 | py | Python | lib/sqlalchemy/orm/util.py | pje1740/sqlalchemy | 28138ee6fbc1273f1bf16699927e09db81ae7870 | [
"MIT"
] | null | null | null | lib/sqlalchemy/orm/util.py | pje1740/sqlalchemy | 28138ee6fbc1273f1bf16699927e09db81ae7870 | [
"MIT"
] | null | null | null | lib/sqlalchemy/orm/util.py | pje1740/sqlalchemy | 28138ee6fbc1273f1bf16699927e09db81ae7870 | [
"MIT"
] | null | null | null | # orm/util.py
# Copyright (C) 2005-2020 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import re
import types
import weakref
from . import attributes # noqa
from .base impo... | 33.723849 | 79 | 0.628753 |
import re
import types
import weakref
from . import attributes from .base import _class_to_mapper from .base import _never_set from .base import _none_set from .base import attribute_str from .base import class_mapper from .base import InspectionAttr from .base import instance_str from .base import object_ma... | true | true |
f7673e8c2b209d6e7c4ae678ce4aad7e07adcc55 | 4,910 | py | Python | pendulum/locales/en/locale.py | shammellee/pendulum | bb179c8fb6ef92b7bfc471a46338abbfac9fafca | [
"MIT"
] | 1 | 2018-11-25T03:10:22.000Z | 2018-11-25T03:10:22.000Z | pendulum/locales/en/locale.py | shammellee/pendulum | bb179c8fb6ef92b7bfc471a46338abbfac9fafca | [
"MIT"
] | null | null | null | pendulum/locales/en/locale.py | shammellee/pendulum | bb179c8fb6ef92b7bfc471a46338abbfac9fafca | [
"MIT"
] | 1 | 2020-07-24T17:37:18.000Z | 2020-07-24T17:37:18.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
en locale file.
It has been generated automatically and must not be modified directly.
"""
from .custom import translations as custom_translations
locale = {
"plural": lambda n: "one"
if ((n == n and ((n == 1))) and (0 == 0 and ((0 == 0)))... | 32.091503 | 85 | 0.316701 | from __future__ import unicode_literals
from .custom import translations as custom_translations
locale = {
"plural": lambda n: "one"
if ((n == n and ((n == 1))) and (0 == 0 and ((0 == 0))))
else "other",
"ordinal": lambda n: "few"
if (
((n % 10) == (n % 10) and (((n % 10) == 3)))
... | true | true |
f7673f3059939994d3fe88a825143c806e4bd878 | 1,712 | py | Python | app/core/migrations/0001_initial.py | ALogvinov/recipe-app-api | 3399462bde85a2ef2ad2a6017340f2305867f2c1 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | ALogvinov/recipe-app-api | 3399462bde85a2ef2ad2a6017340f2305867f2c1 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | ALogvinov/recipe-app-api | 3399462bde85a2ef2ad2a6017340f2305867f2c1 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-07-02 16:38
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
... | 50.352941 | 266 | 0.639603 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.Bi... | true | true |
f7673f5685ba0b424517dcd15c7f057a45d1c077 | 7,445 | py | Python | pandas/core/window/expanding.py | ohad83/pandas | c5576293859f4351e508471811948e9a1dac4a30 | [
"BSD-3-Clause"
] | 2 | 2019-12-31T14:22:54.000Z | 2019-12-31T14:23:42.000Z | pandas/core/window/expanding.py | ohad83/pandas | c5576293859f4351e508471811948e9a1dac4a30 | [
"BSD-3-Clause"
] | null | null | null | pandas/core/window/expanding.py | ohad83/pandas | c5576293859f4351e508471811948e9a1dac4a30 | [
"BSD-3-Clause"
] | 2 | 2019-12-21T21:17:43.000Z | 2019-12-26T10:34:36.000Z | from textwrap import dedent
from pandas.compat.numpy import function as nv
from pandas.util._decorators import Appender, Substitution
from pandas.core.window.common import WindowGroupByMixin, _doc_template, _shared_docs
from pandas.core.window.rolling import _Rolling_and_Expanding
class Expanding(_Rolling_and_Expan... | 28.524904 | 85 | 0.606985 | from textwrap import dedent
from pandas.compat.numpy import function as nv
from pandas.util._decorators import Appender, Substitution
from pandas.core.window.common import WindowGroupByMixin, _doc_template, _shared_docs
from pandas.core.window.rolling import _Rolling_and_Expanding
class Expanding(_Rolling_and_Expan... | true | true |
f767402ec291af3ac13feb9e658c386e455648af | 1,097 | py | Python | adapter/sites/open/blueking/component/apis/bk_paas.py | TencentBlueKing/bk-chatbot | da37fb2197142eae32158cdb5c2b658100133fff | [
"MIT"
] | 11 | 2021-05-27T11:45:02.000Z | 2022-03-29T15:03:28.000Z | adapter/sites/open/blueking/component/apis/bk_paas.py | hchicken/bk-chatbot | da37fb2197142eae32158cdb5c2b658100133fff | [
"MIT"
] | 2 | 2021-08-16T03:59:19.000Z | 2021-09-29T09:31:39.000Z | adapter/sites/open/blueking/component/apis/bk_paas.py | hchicken/bk-chatbot | da37fb2197142eae32158cdb5c2b658100133fff | [
"MIT"
] | 12 | 2021-05-27T11:59:18.000Z | 2022-03-17T07:21:53.000Z | """
TencentBlueKing is pleased to support the open source community by making
蓝鲸智云PaaS平台社区版 (BlueKing PaaSCommunity Edition) available.
Copyright (C) 2017-2018 THL A29 Limited,
a Tencent company. All rights reserved.
Licensed under the MIT License (the "License");
you may not use this file except in compliance with the... | 35.387097 | 74 | 0.732908 |
from ..base import ComponentAPI
class CollectionsBkPaas(object):
def __init__(self, client):
self.client = client
self.get_app_info = ComponentAPI(
client=self.client,
method='GET',
path='/api/c/compapi{bk_api_ver}/bk_paas/get_app_info/',
descript... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.