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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7701e8722a863d8d48d33537386dd4bd8be58d8 | 126,961 | py | Python | salt/states/git.py | tomdoherty/salt | f87d5d7abbf9777773c4d91fdafecb8b1a728e76 | [
"Apache-2.0"
] | 1 | 2022-03-12T00:03:19.000Z | 2022-03-12T00:03:19.000Z | salt/states/git.py | tomdoherty/salt | f87d5d7abbf9777773c4d91fdafecb8b1a728e76 | [
"Apache-2.0"
] | 2 | 2022-03-02T16:11:35.000Z | 2022-03-03T08:04:30.000Z | salt/states/git.py | tomdoherty/salt | f87d5d7abbf9777773c4d91fdafecb8b1a728e76 | [
"Apache-2.0"
] | null | null | null | """
States to manage git repositories and git configuration
.. important::
Before using git over ssh, make sure your remote host fingerprint exists in
your ``~/.ssh/known_hosts`` file.
.. versionchanged:: 2015.8.8
This state module now requires git 1.6.5 (released 10 October 2009) or
newer.
"""
impor... | 38.695824 | 112 | 0.489197 |
import errno
import logging
import os
import re
import string
import salt.utils.args
import salt.utils.files
import salt.utils.url
import salt.utils.versions
from salt.exceptions import CommandExecutionError
from salt.utils.versions import LooseVersion as _LooseVersion
log = logging.getLogger(__name__)
def __virtu... | true | true |
f770203d2b58852331f8076852e0732e19be62e3 | 1,777 | py | Python | fn_exchange/setup.py | rudimeyer/resilient-community-apps | 7a46841ba41fa7a1c421d4b392b0a3ca9e36bd00 | [
"MIT"
] | 1 | 2020-08-25T03:43:07.000Z | 2020-08-25T03:43:07.000Z | fn_exchange/setup.py | rudimeyer/resilient-community-apps | 7a46841ba41fa7a1c421d4b392b0a3ca9e36bd00 | [
"MIT"
] | 1 | 2019-07-08T16:57:48.000Z | 2019-07-08T16:57:48.000Z | fn_exchange/setup.py | rudimeyer/resilient-community-apps | 7a46841ba41fa7a1c421d4b392b0a3ca9e36bd00 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name='fn_exchange',
version='1.0.0',
license='MIT',
author='IBM Resilient',
author_email='support@resilientsystems.com',
description="Resilient Circuits Components for 'fn_exchange'",
long_desc... | 48.027027 | 164 | 0.745076 |
from setuptools import setup, find_packages
setup(
name='fn_exchange',
version='1.0.0',
license='MIT',
author='IBM Resilient',
author_email='support@resilientsystems.com',
description="Resilient Circuits Components for 'fn_exchange'",
long_description="Resilient Circuits Components for 'fn... | true | true |
f770210d3dca96e0ffe9dc70ae8d5343ae091005 | 1,353 | py | Python | PythonBaseDemo/CommonModules/10.6/re_test.py | CypHelp/TestNewWorldDemo | ee6f73df05756f191c1c56250fa290461fdd1b9a | [
"Apache-2.0"
] | null | null | null | PythonBaseDemo/CommonModules/10.6/re_test.py | CypHelp/TestNewWorldDemo | ee6f73df05756f191c1c56250fa290461fdd1b9a | [
"Apache-2.0"
] | null | null | null | PythonBaseDemo/CommonModules/10.6/re_test.py | CypHelp/TestNewWorldDemo | ee6f73df05756f191c1c56250fa290461fdd1b9a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#########################################################################
# 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> #
# author yeeku.H.lee kongyeeku@163.com #
# #
# version 1.0 ... | 54.12 | 73 | 0.27864 | import re
pa = re.compile('fkit')
print(pa.match('www.fkit.org', 4).span()) print(pa.match('www.fkit.org', 4, 6)) print(pa.fullmatch('www.fkit.org', 4, 8).span()) | true | true |
f77021c9145ade7d9589a56a74262ad7bfc7bf4c | 4,181 | py | Python | app/gui.py | Simon-Charest/blackjack | b82450a07f10532e4bd6f8f1aa9b4940f99bb1e2 | [
"MIT"
] | null | null | null | app/gui.py | Simon-Charest/blackjack | b82450a07f10532e4bd6f8f1aa9b4940f99bb1e2 | [
"MIT"
] | null | null | null | app/gui.py | Simon-Charest/blackjack | b82450a07f10532e4bd6f8f1aa9b4940f99bb1e2 | [
"MIT"
] | null | null | null | from app import constant, game
from tkinter import *
import main
import os
def run():
# Display application
root = Tk()
root.configure(background=constant.BACKGROUND)
root.geometry(f'{constant.WIDTH}x{constant.HEIGHT}')
root.resizable(0, 0) # Prevent resizing and disable maximize button
root.... | 26.974194 | 110 | 0.664195 | from app import constant, game
from tkinter import *
import main
import os
def run():
root = Tk()
root.configure(background=constant.BACKGROUND)
root.geometry(f'{constant.WIDTH}x{constant.HEIGHT}')
root.resizable(0, 0) root.title(main.__project__)
root.tk.call('wm', 'iconphoto', root._w, ... | true | true |
f77021de72b247b64741e73119eb6aaf7689291b | 1,226 | py | Python | nn/block/upsample_blocks.py | Frognar/Super-Resolution | 406b909d71e156aa11ee589698744e3ad9abfee7 | [
"MIT"
] | 1 | 2020-11-13T12:04:38.000Z | 2020-11-13T12:04:38.000Z | nn/block/upsample_blocks.py | Frognar/Super-Resolution | 406b909d71e156aa11ee589698744e3ad9abfee7 | [
"MIT"
] | null | null | null | nn/block/upsample_blocks.py | Frognar/Super-Resolution | 406b909d71e156aa11ee589698744e3ad9abfee7 | [
"MIT"
] | null | null | null | import torch.nn as nn
from torch.nn.functional import interpolate
class PixelShuffleUpscaleBlock(nn.Module):
def __init__(self, in_channels=64, kernel_size=3, upscale_factor=2):
super().__init__()
self.block = nn.Sequential(
nn.Conv2d(in_channels=in_channels,
out... | 34.055556 | 80 | 0.646819 | import torch.nn as nn
from torch.nn.functional import interpolate
class PixelShuffleUpscaleBlock(nn.Module):
def __init__(self, in_channels=64, kernel_size=3, upscale_factor=2):
super().__init__()
self.block = nn.Sequential(
nn.Conv2d(in_channels=in_channels,
out... | true | true |
f77022a4d731b24f7d2100f3ebf7f8629245f959 | 11,438 | py | Python | covid/wallet/wallet_puzzle_store.py | pinksheetscrypto/covid-blockchain | 6360f93be99129898d349a3ad8414069c567988c | [
"Apache-2.0"
] | 14 | 2021-07-28T09:56:07.000Z | 2022-02-09T04:28:14.000Z | covid/wallet/wallet_puzzle_store.py | pinksheetscrypto/covid-blockchain | 6360f93be99129898d349a3ad8414069c567988c | [
"Apache-2.0"
] | 23 | 2021-07-28T10:16:56.000Z | 2022-03-26T10:43:53.000Z | covid/wallet/wallet_puzzle_store.py | pinksheetscrypto/covid-blockchain | 6360f93be99129898d349a3ad8414069c567988c | [
"Apache-2.0"
] | 9 | 2021-07-28T02:41:24.000Z | 2022-03-15T08:32:49.000Z | import asyncio
import logging
from typing import List, Optional, Set, Tuple
import aiosqlite
from blspy import G1Element
from covid.types.blockchain_format.sized_bytes import bytes32
from covid.util.db_wrapper import DBWrapper
from covid.util.ints import uint32
from covid.wallet.derivation_record import DerivationRec... | 32.867816 | 117 | 0.599056 | import asyncio
import logging
from typing import List, Optional, Set, Tuple
import aiosqlite
from blspy import G1Element
from covid.types.blockchain_format.sized_bytes import bytes32
from covid.util.db_wrapper import DBWrapper
from covid.util.ints import uint32
from covid.wallet.derivation_record import DerivationRec... | true | true |
f77024c1794847b0bfbedcbf615f1fde7c8cf685 | 10,059 | py | Python | kaznet/apps/users/tests/test_models.py | onaio/kaznet-web | 53da428d5e62e40c5d38d84c3f3ee06071dd779b | [
"Apache-2.0"
] | 1 | 2019-10-03T12:18:15.000Z | 2019-10-03T12:18:15.000Z | kaznet/apps/users/tests/test_models.py | onaio/kaznet-web | 53da428d5e62e40c5d38d84c3f3ee06071dd779b | [
"Apache-2.0"
] | 63 | 2018-10-31T12:57:36.000Z | 2020-04-27T20:18:22.000Z | kaznet/apps/users/tests/test_models.py | onaio/kaznet-web | 53da428d5e62e40c5d38d84c3f3ee06071dd779b | [
"Apache-2.0"
] | 3 | 2019-08-05T09:10:03.000Z | 2020-01-05T21:24:49.000Z | """
Test for UserProfile model
"""
import random
import statistics
import pytz
from model_mommy import mommy
from rest_framework.authtoken.models import Token
from kaznet.apps.main.tests.base import MainTestBase
from kaznet.apps.users.models import UserProfile
from kaznet.apps.main.models import Submission
from kazne... | 34.44863 | 79 | 0.556715 | import random
import statistics
import pytz
from model_mommy import mommy
from rest_framework.authtoken.models import Token
from kaznet.apps.main.tests.base import MainTestBase
from kaznet.apps.users.models import UserProfile
from kaznet.apps.main.models import Submission
from kaznet.apps.users.tests.base import get_... | true | true |
f77025a9ef4e621ab07815cea510cf33071d55da | 776 | py | Python | Utils/ble_scanner.py | FHantke/FitnessTrackerAnalysisTool | 0844d3da44805d559023dd0518f0e9aa819804d7 | [
"Unlicense",
"MIT"
] | 2 | 2020-09-10T08:44:06.000Z | 2021-11-02T14:56:25.000Z | Utils/ble_scanner.py | FHantke/FitnessTrackerAnalysisTool | 0844d3da44805d559023dd0518f0e9aa819804d7 | [
"Unlicense",
"MIT"
] | null | null | null | Utils/ble_scanner.py | FHantke/FitnessTrackerAnalysisTool | 0844d3da44805d559023dd0518f0e9aa819804d7 | [
"Unlicense",
"MIT"
] | null | null | null | from bluepy.btle import Scanner
def getDevices(full_info):
"""
The method searches BLE devices around in the and prints them.
SUDO is required.
:param full_info: The method prints all device information if true, it prints just the MAC and name if false.
"""
scanner = Scanner()
devices = sc... | 32.333333 | 113 | 0.609536 | from bluepy.btle import Scanner
def getDevices(full_info):
scanner = Scanner()
devices = scanner.scan()
print("Found {} devices".format(len(devices)))
for dev in devices:
if full_info:
print("Device {} ({}), RSSI={} dB".format(dev.addr, dev.addrType, dev.rssi))
for (adt... | true | true |
f77025d802c1149b5d54ccdf01bacefd4305c3b6 | 965 | py | Python | P1476.py | Muntaha-Islam0019/Leetcode-Solutions | 0bc56ce43a6d8ad10461b69078166a2a5b913e7f | [
"MIT"
] | null | null | null | P1476.py | Muntaha-Islam0019/Leetcode-Solutions | 0bc56ce43a6d8ad10461b69078166a2a5b913e7f | [
"MIT"
] | null | null | null | P1476.py | Muntaha-Islam0019/Leetcode-Solutions | 0bc56ce43a6d8ad10461b69078166a2a5b913e7f | [
"MIT"
] | null | null | null | class SubrectangleQueries:
def __init__(self, rectangle: List[List[int]]):
self.rectangle=rectangle
self.pos=[]
def updateSubrectangle(self, row1: int, col1: int, row2: int, col2: int, newValue: int) -> None:
self.pos.append([row1,col1,row2,col2,newValue])
... | 30.15625 | 100 | 0.560622 | class SubrectangleQueries:
def __init__(self, rectangle: List[List[int]]):
self.rectangle=rectangle
self.pos=[]
def updateSubrectangle(self, row1: int, col1: int, row2: int, col2: int, newValue: int) -> None:
self.pos.append([row1,col1,row2,col2,newValue])
... | true | true |
f7702614d327b318c9394fdeb0dd95d3e5460dca | 14,009 | py | Python | st2common/tests/unit/test_executions_util.py | padamel/files4coding | 3a0479cc9244efd632d14a48c8dc6fd1367edf3e | [
"Apache-2.0"
] | null | null | null | st2common/tests/unit/test_executions_util.py | padamel/files4coding | 3a0479cc9244efd632d14a48c8dc6fd1367edf3e | [
"Apache-2.0"
] | 2 | 2021-09-19T19:48:15.000Z | 2021-09-19T19:48:16.000Z | st2common/tests/unit/test_executions_util.py | padamel/files4coding | 3a0479cc9244efd632d14a48c8dc6fd1367edf3e | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 41.082111 | 87 | 0.694696 |
from __future__ import absolute_import
import mock
import six
from st2common.constants import action as action_constants
from st2common.models.api.action import RunnerTypeAPI, ActionAPI, LiveActionAPI
from st2common.models.api.trigger import TriggerTypeAPI, TriggerAPI, TriggerInstanceAPI
from st2common.models.api.rul... | true | true |
f770268a050a1d0761aca5f7dda8290a9c51c284 | 2,901 | py | Python | File/Upload/upload_matching_files.py | petebunting/rsgis_scripts | b35b0403cdfad6c63824d4f8c038f190cdb5978d | [
"MIT"
] | 4 | 2020-09-16T10:45:15.000Z | 2021-05-06T04:34:32.000Z | File/Upload/upload_matching_files.py | petebunting/rsgis_scripts | b35b0403cdfad6c63824d4f8c038f190cdb5978d | [
"MIT"
] | null | null | null | File/Upload/upload_matching_files.py | petebunting/rsgis_scripts | b35b0403cdfad6c63824d4f8c038f190cdb5978d | [
"MIT"
] | 2 | 2020-07-06T18:03:40.000Z | 2022-02-15T12:45:34.000Z | #!/usr/bin/env python
"""
upload_matching_files.py
Recursivly search for files, given in a text file and upload to FTP server.
Dan Clewley - 11/04/2015
"""
from __future__ import print_function
import subprocess
import argparse
import sys
import os
# Fill in details of FTP Server here
FTP_ADDRESS = ''
FTP_USER = ... | 31.532609 | 107 | 0.597725 |
from __future__ import print_function
import subprocess
import argparse
import sys
import os
FTP_ADDRESS = ''
FTP_USER = ''
FTP_PASSWORD = ''
def get_matching_file_paths(in_filelist, search_dir):
match_list = []
with open(in_filelist,'rU') as f:
check_file_list = f.read().split('\n')
s... | true | true |
f77026a5f82e7408a31329ef510f3e798e3c83c3 | 5,283 | py | Python | backend/backend/settings.py | andrenaught/medicoral | 46e1801b79987e1f7aa97ba9076e5f81dd63a3de | [
"MIT"
] | 1 | 2021-12-27T20:04:47.000Z | 2021-12-27T20:04:47.000Z | backend/backend/settings.py | andrenaught/medicoral | 46e1801b79987e1f7aa97ba9076e5f81dd63a3de | [
"MIT"
] | null | null | null | backend/backend/settings.py | andrenaught/medicoral | 46e1801b79987e1f7aa97ba9076e5f81dd63a3de | [
"MIT"
] | null | null | null | """
Django settings for backend project.
Generated by 'django-admin startproject' using Django 3.2.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
import envir... | 28.101064 | 114 | 0.702442 |
import environ
import os
from pathlib import Path
env = environ.Env(DEBUG=(bool, False), PROD=(
bool, False), ALLOWED_HOSTS=(list, []), SECURE_SSL_REDIRECT=(bool, False))
environ.Env.read_env()
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = env('SECRET_KEY')
DEBUG = env('DEBUG')
PROD = env('... | true | true |
f77026ca7697ff889746aa21ae67e309b22abaf8 | 7,591 | py | Python | TrainingExtensions/common/src/python/aimet_common/quantsim_config/quantsim_config_schema.py | styler00dollar/Colab-docker-aimet | 9e70d1e3729be8e890bc58e1f5af30a706a15e96 | [
"BSD-3-Clause"
] | 945 | 2020-04-30T02:23:55.000Z | 2022-03-31T08:44:32.000Z | TrainingExtensions/common/src/python/aimet_common/quantsim_config/quantsim_config_schema.py | seaun163/aimet | de94e5522e0c9250fb422d064b77ef9ecc70f239 | [
"BSD-3-Clause"
] | 563 | 2020-05-01T03:07:22.000Z | 2022-03-30T05:35:58.000Z | TrainingExtensions/common/src/python/aimet_common/quantsim_config/quantsim_config_schema.py | seaun163/aimet | de94e5522e0c9250fb422d064b77ef9ecc70f239 | [
"BSD-3-Clause"
] | 186 | 2020-04-30T00:55:26.000Z | 2022-03-30T09:54:51.000Z | # /usr/bin/env python3.5
# -*- mode: python -*-
# =============================================================================
# @@-COPYRIGHT-START-@@
#
# Copyright (c) 2020, Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification,... | 38.532995 | 96 | 0.375708 |
QUANTSIM_CONFIG_SCHEMA = {
"type": "object",
"properties": {
"defaults": {
"type": "object",
"properties": {
"ops": {
"type": "object",
"properties": {
"is_input_quantized": {
... | true | true |
f77026e1ac91ccf5dc52881acfc927fc51e2bcf7 | 207 | py | Python | carla_manual_control/setup.py | VILMA-LMA/ros-bridge | e635635c2657b81d914596bec289f49bbde910e5 | [
"MIT"
] | 205 | 2018-05-14T16:37:06.000Z | 2022-03-26T21:32:29.000Z | ros/src/ros_carla_bridge/carla_manual_control/setup.py | xmeng17/ALVNS | 8d891600af3d851add27a10ae45cf3c2108bb87c | [
"MIT"
] | 19 | 2018-05-27T21:06:52.000Z | 2021-09-08T00:37:46.000Z | ros/src/ros_carla_bridge/carla_manual_control/setup.py | xmeng17/ALVNS | 8d891600af3d851add27a10ae45cf3c2108bb87c | [
"MIT"
] | 73 | 2018-09-13T05:04:47.000Z | 2022-02-26T14:51:02.000Z | from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
d = generate_distutils_setup(
packages=['carla_manual_control'],
package_dir={'': 'src'}
)
setup(**d)
| 18.818182 | 60 | 0.758454 | from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
d = generate_distutils_setup(
packages=['carla_manual_control'],
package_dir={'': 'src'}
)
setup(**d)
| true | true |
f77028780d3d2857ef1e088fa2839ef79fd19a0c | 11,621 | py | Python | build/lib/azimuth/metrics.py | mayavanand/RMMAFinalProject | 60a5c1d4af4aad8362a7ee8a15e86c0716c588e5 | [
"BSD-3-Clause"
] | 3 | 2017-10-21T23:15:14.000Z | 2017-10-23T00:45:58.000Z | build/lib/azimuth/metrics.py | mayavanand/RMMAFinalProject | 60a5c1d4af4aad8362a7ee8a15e86c0716c588e5 | [
"BSD-3-Clause"
] | null | null | null | build/lib/azimuth/metrics.py | mayavanand/RMMAFinalProject | 60a5c1d4af4aad8362a7ee8a15e86c0716c588e5 | [
"BSD-3-Clause"
] | null | null | null | """
from https://gist.github.com/bwhite/3726239
Information Retrieval metrics
Useful Resources:
http://www.cs.utexas.edu/~mooney/ir-course/slides/Evaluation.ppt
http://www.nii.ac.jp/TechReports/05-014E.pdf
http://www.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf
http://hal.archives-ouvertes.fr/doc... | 30.824934 | 118 | 0.606402 | """
from https://gist.github.com/bwhite/3726239
Information Retrieval metrics
Useful Resources:
http://www.cs.utexas.edu/~mooney/ir-course/slides/Evaluation.ppt
http://www.nii.ac.jp/TechReports/05-014E.pdf
http://www.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf
http://hal.archives-ouvertes.fr/doc... | false | true |
f77028ec1f7880e05cbd6a26f758129a913b7290 | 4,925 | py | Python | SipMask-VIS/configs/faster_rcnn_r101_fpn_1x.py | anirudh-chakravarthy/SipMask | fc82b12c13abb091e271eb4f1b6734da18234443 | [
"MIT"
] | 390 | 2019-08-16T10:38:24.000Z | 2022-03-31T14:13:18.000Z | SipMask-VIS/configs/faster_rcnn_r101_fpn_1x.py | anirudh-chakravarthy/SipMask | fc82b12c13abb091e271eb4f1b6734da18234443 | [
"MIT"
] | 60 | 2020-07-30T03:55:01.000Z | 2022-03-01T00:06:21.000Z | SipMask-VIS/configs/faster_rcnn_r101_fpn_1x.py | anirudh-chakravarthy/SipMask | fc82b12c13abb091e271eb4f1b6734da18234443 | [
"MIT"
] | 56 | 2020-07-30T01:49:31.000Z | 2022-02-25T06:46:47.000Z | # model settings
model = dict(
type='FasterRCNN',
pretrained='torchvision://resnet101',
backbone=dict(
type='ResNet',
depth=101,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
style='pytorch'),
neck=dict(
type='FPN',
in_channels=[... | 29.315476 | 78 | 0.587817 | model = dict(
type='FasterRCNN',
pretrained='torchvision://resnet101',
backbone=dict(
type='ResNet',
depth=101,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
style='pytorch'),
neck=dict(
type='FPN',
in_channels=[256, 512, 1024, 2... | true | true |
f7702910959c0ed71e7c0fa1ab06164463b22ece | 9,304 | py | Python | awswrangler/neptune/client.py | mateogianolio/aws-data-wrangler | da0bcdad90f5d3a389000473d27d3325a565441a | [
"Apache-2.0"
] | null | null | null | awswrangler/neptune/client.py | mateogianolio/aws-data-wrangler | da0bcdad90f5d3a389000473d27d3325a565441a | [
"Apache-2.0"
] | null | null | null | awswrangler/neptune/client.py | mateogianolio/aws-data-wrangler | da0bcdad90f5d3a389000473d27d3325a565441a | [
"Apache-2.0"
] | null | null | null | """Amazon NeptuneClient Module."""
import logging
from typing import Any, Dict, List, Optional
import boto3
import requests
from botocore.auth import SigV4Auth
from botocore.awsrequest import AWSRequest
from gremlin_python.driver import client
from SPARQLWrapper import SPARQLWrapper
from awswrangler import exception... | 33.710145 | 116 | 0.593186 |
import logging
from typing import Any, Dict, List, Optional
import boto3
import requests
from botocore.auth import SigV4Auth
from botocore.awsrequest import AWSRequest
from gremlin_python.driver import client
from SPARQLWrapper import SPARQLWrapper
from awswrangler import exceptions
from awswrangler.neptune.gremlin_... | true | true |
f77029f56e05348c68bdfe52f8ff2541114e354c | 895 | py | Python | app/you_get/extractors/mixcloud.py | Deteriorator/GUI-YouGet | ec2cd7e88061045a210aee2b6c817df82b7146c0 | [
"MIT"
] | 85 | 2018-07-31T04:02:48.000Z | 2022-01-06T15:40:26.000Z | app/you_get/extractors/mixcloud.py | Deteriorator/GUI-YouGet | ec2cd7e88061045a210aee2b6c817df82b7146c0 | [
"MIT"
] | null | null | null | app/you_get/extractors/mixcloud.py | Deteriorator/GUI-YouGet | ec2cd7e88061045a210aee2b6c817df82b7146c0 | [
"MIT"
] | 12 | 2018-12-01T08:56:09.000Z | 2021-12-18T04:29:19.000Z | #!/usr/bin/env python
__all__ = ['mixcloud_download']
from ..common import *
def mixcloud_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
html = get_html(url, faker=True)
title = r1(r'<meta property="og:title" content="([^"]*)"', html)
preview_url = r1(r'm-preview=\"([^\"]+)\"', htm... | 29.833333 | 82 | 0.611173 |
__all__ = ['mixcloud_download']
from ..common import *
def mixcloud_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
html = get_html(url, faker=True)
title = r1(r'<meta property="og:title" content="([^"]*)"', html)
preview_url = r1(r'm-preview=\"([^\"]+)\"', html)
preview = r1(r'... | true | true |
f7702bcbe718caa7b9350bb6aa9d40685fcfda9f | 291 | py | Python | Code_Python/Exercicio-05/decisao-idade-acertos-juntos.py | gabrielf7/code-exercises | b3a8661fadc133395f3c6fb7e926317acf7fa539 | [
"MIT"
] | 1 | 2020-07-19T16:35:51.000Z | 2020-07-19T16:35:51.000Z | Code_Python/Exercicio-05/decisao-idade-acertos-juntos.py | gabrielf7/codigos-em-C-uteis | b155d2771291a14e8b112a0f1aa32c58254e406e | [
"MIT"
] | null | null | null | Code_Python/Exercicio-05/decisao-idade-acertos-juntos.py | gabrielf7/codigos-em-C-uteis | b155d2771291a14e8b112a0f1aa32c58254e406e | [
"MIT"
] | null | null | null |
import os
idade = int(input("Digite sua Idade: \n"))
acertos = int(input("Digite a Nota da Prova: \n"))
if idade >= 18 != acertos >= 21:
print("Você foi Habilitado para receber a CNH")
else:
print("Você não foi Habilitado para receber a CNH")
input("Pressione <enter> para sair") | 24.25 | 55 | 0.67354 |
import os
idade = int(input("Digite sua Idade: \n"))
acertos = int(input("Digite a Nota da Prova: \n"))
if idade >= 18 != acertos >= 21:
print("Você foi Habilitado para receber a CNH")
else:
print("Você não foi Habilitado para receber a CNH")
input("Pressione <enter> para sair") | true | true |
f7702bcdf99aa555edf77f6949641d063b31d3dd | 554 | py | Python | app/handlers/main_group_start.py | TheBoysCoding/sandworm-bot | 538392d7cc9e5f5c77334480c5f7cd861ef54f4d | [
"MIT"
] | null | null | null | app/handlers/main_group_start.py | TheBoysCoding/sandworm-bot | 538392d7cc9e5f5c77334480c5f7cd861ef54f4d | [
"MIT"
] | null | null | null | app/handlers/main_group_start.py | TheBoysCoding/sandworm-bot | 538392d7cc9e5f5c77334480c5f7cd861ef54f4d | [
"MIT"
] | null | null | null | from typing import List
from aiogram.types import Message, BotCommand
from app.misc.command_description import CommandDescription
def register_main_group_start(storage: List[CommandDescription]):
async def cmd_help(message: Message):
help_message = "".join(f"/{command.command} - {command.description}\n" f... | 30.777778 | 102 | 0.680505 | from typing import List
from aiogram.types import Message, BotCommand
from app.misc.command_description import CommandDescription
def register_main_group_start(storage: List[CommandDescription]):
async def cmd_help(message: Message):
help_message = "".join(f"/{command.command} - {command.description}\n" f... | true | true |
f7702c3059877cbbe676e3f6f54675987a978579 | 17,086 | py | Python | packages/python/plotly/plotly/graph_objs/surface/contours/_z.py | eranws/plotly.py | 5b0e8d3ccab55fe1a6e4ba123cfc9d718a9ffc5a | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/graph_objs/surface/contours/_z.py | eranws/plotly.py | 5b0e8d3ccab55fe1a6e4ba123cfc9d718a9ffc5a | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/graph_objs/surface/contours/_z.py | eranws/plotly.py | 5b0e8d3ccab55fe1a6e4ba123cfc9d718a9ffc5a | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Z(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "surface.contours"
_path_str = "surface.contours.z"
_valid_props = {
"color",
"end... | 32.544762 | 82 | 0.544773 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Z(_BaseTraceHierarchyType):
_parent_path_str = "surface.contours"
_path_str = "surface.contours.z"
_valid_props = {
"color",
"end",
"highlight",
"highlight... | true | true |
f7702ce742ffd18bc773560e25556a959ebb5fef | 7,659 | py | Python | py/testdir_single_jvm/test_rfview_score.py | vkuznet/h2o | e08f7014f228cbaecfb21f57379970e6a3ac0756 | [
"Apache-2.0"
] | null | null | null | py/testdir_single_jvm/test_rfview_score.py | vkuznet/h2o | e08f7014f228cbaecfb21f57379970e6a3ac0756 | [
"Apache-2.0"
] | null | null | null | py/testdir_single_jvm/test_rfview_score.py | vkuznet/h2o | e08f7014f228cbaecfb21f57379970e6a3ac0756 | [
"Apache-2.0"
] | null | null | null | import unittest, random, sys, time
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_rf, h2o_hosts, h2o_import as h2i
# we can pass ntree thru kwargs if we don't use the "trees" parameter in runRF
# only classes 1-7 in the 55th col
# don't allow None on ntree..causes 50 tree default!
print "Temporarily not usi... | 46.418182 | 148 | 0.621491 | import unittest, random, sys, time
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_rf, h2o_hosts, h2o_import as h2i
# only classes 1-7 in the 55th col
# don't allow None on ntree..causes 50 tree default!
print "Temporarily not using bin_limit=1 to 4"
paramDict = {
'response_variable': [None,54],
... | false | true |
f7702d73c8b71d9347426d0303928cf226d3427f | 240 | py | Python | nodes/0.9.x/python/WallType.Kind.py | jdehotin/Clockworkfordynamo | 59226ea8292c57acfa1aa476efd40f0e78c9b965 | [
"MIT"
] | 147 | 2016-02-24T16:37:03.000Z | 2022-02-18T12:10:34.000Z | nodes/0.9.x/python/WallType.Kind.py | jdehotin/Clockworkfordynamo | 59226ea8292c57acfa1aa476efd40f0e78c9b965 | [
"MIT"
] | 269 | 2016-02-25T14:04:14.000Z | 2022-03-26T07:30:53.000Z | nodes/0.9.x/python/WallType.Kind.py | jdehotin/Clockworkfordynamo | 59226ea8292c57acfa1aa476efd40f0e78c9b965 | [
"MIT"
] | 89 | 2016-03-16T18:21:56.000Z | 2022-02-03T14:34:30.000Z | import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
walltypes = UnwrapElement(IN[0])
kindlist = list()
for item in walltypes:
try:
kindlist.append(str(item.Kind))
except:
kindlist.append('No Wall')
OUT = kindlist | 20 | 33 | 0.7375 | import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
walltypes = UnwrapElement(IN[0])
kindlist = list()
for item in walltypes:
try:
kindlist.append(str(item.Kind))
except:
kindlist.append('No Wall')
OUT = kindlist | true | true |
f7702e88b846a158b42d075d57c82532127516f6 | 2,914 | py | Python | tests/src/Health_Card_Index/home_page_functional_test.py | sreenivas8084/cQube | 3352a13f41679d707979e287d1880f0723b27510 | [
"MIT"
] | null | null | null | tests/src/Health_Card_Index/home_page_functional_test.py | sreenivas8084/cQube | 3352a13f41679d707979e287d1880f0723b27510 | [
"MIT"
] | 2 | 2022-02-01T00:55:12.000Z | 2022-03-29T22:29:09.000Z | tests/src/Health_Card_Index/home_page_functional_test.py | SreenivasNimmagadda/cQube | 3352a13f41679d707979e287d1880f0723b27510 | [
"MIT"
] | null | null | null | import time
import unittest
from Health_Card_Index.check_healthcard_home_screen import health_card_homepage
from reuse_func import GetData
class Health_card_functionalTest(unittest.TestCase):
@classmethod
def setUpClass(self):
self.data = GetData()
self.driver = self.data.get_driver()
... | 36.886076 | 80 | 0.702471 | import time
import unittest
from Health_Card_Index.check_healthcard_home_screen import health_card_homepage
from reuse_func import GetData
class Health_card_functionalTest(unittest.TestCase):
@classmethod
def setUpClass(self):
self.data = GetData()
self.driver = self.data.get_driver()
... | true | true |
f7702ea498753744e585fd3ea2837e6644b16cd3 | 24 | py | Python | rummage/lib/gui/controls/__init__.py | RobbiNespu/Rummage | f2240fcbd3941ff4d31621a7460c65b13a0140d4 | [
"MIT"
] | 55 | 2015-02-15T08:17:55.000Z | 2022-03-11T11:55:39.000Z | rummage/lib/gui/controls/__init__.py | RobbiNespu/Rummage | f2240fcbd3941ff4d31621a7460c65b13a0140d4 | [
"MIT"
] | 264 | 2015-01-29T20:27:40.000Z | 2022-03-03T04:08:48.000Z | rummage/lib/gui/controls/__init__.py | RobbiNespu/Rummage | f2240fcbd3941ff4d31621a7460c65b13a0140d4 | [
"MIT"
] | 12 | 2017-08-30T22:54:20.000Z | 2022-03-21T01:05:50.000Z | """General controls."""
| 12 | 23 | 0.625 | true | true | |
f7702ecb55eb83efb6691f98a638b9db9fc8dd56 | 1,671 | py | Python | Optimizers/adam/code/adam.py | TannerGilbert/Machine-Learning-Explained | 5309f44a38ce862f3f177e8d5de2e60eea44637b | [
"MIT"
] | 24 | 2020-09-14T18:55:13.000Z | 2022-03-22T22:14:30.000Z | Optimizers/adam/code/adam.py | TannerGilbert/Machine-Learning-Explained | 5309f44a38ce862f3f177e8d5de2e60eea44637b | [
"MIT"
] | null | null | null | Optimizers/adam/code/adam.py | TannerGilbert/Machine-Learning-Explained | 5309f44a38ce862f3f177e8d5de2e60eea44637b | [
"MIT"
] | 6 | 2021-02-06T15:34:27.000Z | 2022-01-31T23:16:07.000Z | # based on https://ruder.io/optimizing-gradient-descent/#adam
# and https://github.com/eriklindernoren/ML-From-Scratch/blob/master/mlfromscratch/deep_learning/optimizers.py#L106
import numpy as np
class Adam:
"""Adam - Adaptive Moment Estimation
Parameters:
-----------
learning_rate: float = 0.001
... | 37.133333 | 128 | 0.631957 |
import numpy as np
class Adam:
def __init__(self, learning_rate: float = 0.001, beta_1: float = 0.9, beta_2: float = 0.999, epsilon: float = 1e-7) -> None:
self.learning_rate = learning_rate
self.epsilon = epsilon
self.beta_1 = beta_1
self.beta_2 = beta_2
self.t = 0
... | true | true |
f7702fd8dac0b23343e984ffb5949f617fed454a | 4,335 | py | Python | tests/api/test_pagination.py | angry-tony/ceph-lcm-decapod | 535944d3ee384c3a7c4af82f74041b0a7792433f | [
"Apache-2.0"
] | 41 | 2016-11-03T16:40:17.000Z | 2019-05-23T08:39:17.000Z | tests/api/test_pagination.py | Mirantis/ceph-lcm | fad9bad0b94f2ef608362953583b10a54a841d24 | [
"Apache-2.0"
] | 30 | 2016-10-14T10:54:46.000Z | 2017-10-20T15:58:01.000Z | tests/api/test_pagination.py | angry-tony/ceph-lcm-decapod | 535944d3ee384c3a7c4af82f74041b0a7792433f | [
"Apache-2.0"
] | 28 | 2016-09-17T01:17:36.000Z | 2019-07-05T03:32:54.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2016 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 27.611465 | 71 | 0.540715 |
import json
import pytest
from decapod_api import pagination
from decapod_common import config
CONF = config.make_api_config()
def test_defaults():
result = pagination.make_pagination({})
assert result == {
"page": 1,
"per_page": CONF["api"]["pagination_per_page"],
"filter": {},... | true | true |
f770306e39c5e0d4bd55160787b2f6ee90c6e7d8 | 1,359 | py | Python | manage.py | meko0019/Stellar-SMS | 604cca2db37d6b0b566979784e8d46826746c17b | [
"MIT"
] | null | null | null | manage.py | meko0019/Stellar-SMS | 604cca2db37d6b0b566979784e8d46826746c17b | [
"MIT"
] | 4 | 2019-06-26T16:21:45.000Z | 2021-06-01T23:41:34.000Z | manage.py | meko0019/Stellar-SMS | 604cca2db37d6b0b566979784e8d46826746c17b | [
"MIT"
] | null | null | null | import os
import sys
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
base_dir = os.path.dirname(os.path.abspath(__file__))
def main():
command = sys.argv[1]
if command == "db":
from client.database import db
from client.factory import create_app
a... | 23.431034 | 87 | 0.552612 | import os
import sys
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
base_dir = os.path.dirname(os.path.abspath(__file__))
def main():
command = sys.argv[1]
if command == "db":
from client.database import db
from client.factory import create_app
a... | true | true |
f77031f0a9927c7b041dd78f97ad39f7a6641e3b | 10,647 | py | Python | models/neural_net.py | mustelideos/td-opswtw-competition-rl | afbd6603b74f09c133d5d68e587fc93387ca93ba | [
"MIT"
] | 1 | 2022-03-08T14:06:35.000Z | 2022-03-08T14:06:35.000Z | models/neural_net.py | mustelideos/td-opswtw-competition-rl | afbd6603b74f09c133d5d68e587fc93387ca93ba | [
"MIT"
] | null | null | null | models/neural_net.py | mustelideos/td-opswtw-competition-rl | afbd6603b74f09c133d5d68e587fc93387ca93ba | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
from torch.utils.checkpoint import checkpoint
import math
import numpy as np
# ------------------------------------------------------------------------------
# Transformer model from: https://github.com/JayParks/transforme... | 40.48289 | 139 | 0.639147 | import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
from torch.utils.checkpoint import checkpoint
import math
import numpy as np
class ScaledDotProductAttention(nn.Module):
def __init__(self, d_k):
super(ScaledDotProductAttention, self).__init__()
self... | true | true |
f77033333a988c28ea46121655ec9d21f01fafd1 | 791 | py | Python | hdp_api/routes/color.py | OlivierLoison/HyperAPI | eec71f36afb8a8a37f12ca6d9055f26da4958926 | [
"BSD-3-Clause"
] | null | null | null | hdp_api/routes/color.py | OlivierLoison/HyperAPI | eec71f36afb8a8a37f12ca6d9055f26da4958926 | [
"BSD-3-Clause"
] | null | null | null | hdp_api/routes/color.py | OlivierLoison/HyperAPI | eec71f36afb8a8a37f12ca6d9055f26da4958926 | [
"BSD-3-Clause"
] | null | null | null | from HyperAPI.hdp_api.routes import Resource, Route
class Color(Resource):
name = "Color"
class _getColors(Route):
name = "get Project Color sList"
httpMethod = Route.GET
path = "/projects/{project_ID}/colors"
_path_keys = {
'project_ID': Route.VALIDATOR_OBJECTID,
... | 26.366667 | 53 | 0.589128 | from HyperAPI.hdp_api.routes import Resource, Route
class Color(Resource):
name = "Color"
class _getColors(Route):
name = "get Project Color sList"
httpMethod = Route.GET
path = "/projects/{project_ID}/colors"
_path_keys = {
'project_ID': Route.VALIDATOR_OBJECTID,
... | true | true |
f770338293764b4b4db17c8dd3a1696c25680ad5 | 3,730 | py | Python | tabebot/pipelines.py | wakamezake/tabebot | e9452902a344b072cf4c04b87470bbdec1571bc9 | [
"MIT"
] | null | null | null | tabebot/pipelines.py | wakamezake/tabebot | e9452902a344b072cf4c04b87470bbdec1571bc9 | [
"MIT"
] | null | null | null | tabebot/pipelines.py | wakamezake/tabebot | e9452902a344b072cf4c04b87470bbdec1571bc9 | [
"MIT"
] | null | null | null | # Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/topics/item-pipeline.html
import json
from collections import defaultdict
from scrapy import signals
from scrapy.exporters import BaseItemExporter
from scrapy.exceptions import DropItem
f... | 33.00885 | 84 | 0.642895 | # See: http://doc.scrapy.org/topics/item-pipeline.html
import json
from collections import defaultdict
from scrapy import signals
from scrapy.exporters import BaseItemExporter
from scrapy.exceptions import DropItem
from scrapy.xlib.pydispatch import dispatcher
from tabebot.items import BusinessItem, ReviewItem, User... | true | true |
f77033cbb83c6f9e3ad34cf3e62f898ee8491120 | 382 | py | Python | blog/templatetags/blog_tags.py | triumph1001/gitblogproject | b60d9df71cd450feaa978e3ae11209e52358b059 | [
"Apache-2.0"
] | null | null | null | blog/templatetags/blog_tags.py | triumph1001/gitblogproject | b60d9df71cd450feaa978e3ae11209e52358b059 | [
"Apache-2.0"
] | null | null | null | blog/templatetags/blog_tags.py | triumph1001/gitblogproject | b60d9df71cd450feaa978e3ae11209e52358b059 | [
"Apache-2.0"
] | null | null | null | from django import template
from ..models import Post,Category
register = template.Library()
@register.simple_tag
def get_recent_posts(num=5):
return Post.objects.all().order_by('-created_time')[:num]
@register.simple_tag
def archives():
return Post.objects.dates('created_time', 'month', order='DESC')
@register.s... | 23.875 | 65 | 0.772251 | from django import template
from ..models import Post,Category
register = template.Library()
@register.simple_tag
def get_recent_posts(num=5):
return Post.objects.all().order_by('-created_time')[:num]
@register.simple_tag
def archives():
return Post.objects.dates('created_time', 'month', order='DESC')
@register.s... | true | true |
f77034150b3e01dd9335959c062df273bbe8b154 | 1,651 | py | Python | experimental/python/gui/object_data.py | Drahflow/Embroidermodder | 5fe2bed6407845e9d183aee40095b3f778a5b559 | [
"Zlib"
] | null | null | null | experimental/python/gui/object_data.py | Drahflow/Embroidermodder | 5fe2bed6407845e9d183aee40095b3f778a5b559 | [
"Zlib"
] | null | null | null | experimental/python/gui/object_data.py | Drahflow/Embroidermodder | 5fe2bed6407845e9d183aee40095b3f778a5b559 | [
"Zlib"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
===============================
|module_summary| object_data.py
===============================
TOWRITE
"""
OBJ_TYPE_NULL = 0
""":NOTE: Allow this enum to evaluate false"""
OBJ_TYPE_BASE = 100000
""":NOTE: Values >= 65536 ensure compatibility wit... | 22.310811 | 75 | 0.62447 |
OBJ_TYPE_NULL = 0
OBJ_TYPE_BASE = 100000
OBJ_TYPE_ARC = 100001
OBJ_TYPE_BLOCK = 100002
OBJ_TYPE_CIRCLE = 100003
OBJ_TYPE_DIMALIGNED = 100004
OBJ_TYPE_DIMANGULAR = 100005
OBJ_TYPE_DIMARCLENGTH = 100006
OBJ_TYPE_DIMDIAMETER = 100007
OBJ_TYPE_DIMLEADER = 100008
OBJ_TYPE... | true | true |
f770347d7a15cbd4c51afba18af5abffa705e354 | 2,766 | py | Python | example/drone/drone.py | Justin900429/GC-Detection | 3869cad8a36dc67380d5b3509e6d7fab2980f367 | [
"MIT"
] | 4 | 2021-02-20T09:49:52.000Z | 2021-02-24T06:56:54.000Z | example/drone/drone.py | Justin900429/object_detection | 3869cad8a36dc67380d5b3509e6d7fab2980f367 | [
"MIT"
] | null | null | null | example/drone/drone.py | Justin900429/object_detection | 3869cad8a36dc67380d5b3509e6d7fab2980f367 | [
"MIT"
] | 1 | 2021-02-20T13:51:03.000Z | 2021-02-20T13:51:03.000Z | from djitellopy import Tello
import gcdetection
# Connect to tello using djitellopy package
tello = Tello(host="172.20.10.8")
tello.connect()
# Open the tello's camera
tello.streamon()
# Start the app
detect_window = gcdetection.Interface()
class Control:
"""Class for controlling the tello with keypress
T... | 24.052174 | 72 | 0.681851 | from djitellopy import Tello
import gcdetection
tello = Tello(host="172.20.10.8")
tello.connect()
tello.streamon()
# Start the app
detect_window = gcdetection.Interface()
class Control:
@staticmethod
def takeoff(event):
tello.takeoff()
@staticmethod
def land(event):
tello.land()
... | true | true |
f77034eed8ceaef3892726026fcb8a46f16ff396 | 26,011 | py | Python | src/azure-cli-core/azure/cli/core/__init__.py | techiechap/azure-cli | 497abe7661a686818a0dc20692ef8419e9b2124f | [
"MIT"
] | null | null | null | src/azure-cli-core/azure/cli/core/__init__.py | techiechap/azure-cli | 497abe7661a686818a0dc20692ef8419e9b2124f | [
"MIT"
] | null | null | null | src/azure-cli-core/azure/cli/core/__init__.py | techiechap/azure-cli | 497abe7661a686818a0dc20692ef8419e9b2124f | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 49.734226 | 120 | 0.638461 | from __future__ import print_function
__version__ = "2.0.63"
import os
import sys
import timeit
import six
from knack.cli import CLI
from knack.commands import CLICommandsLoader
from knack.completion import ARGCOMPLETE_ENV_NAME
from knack.introspection import extract_args_from_signature, extract_full_summary_from_s... | true | true |
f7703548e443af07b5be55af02ff3236b61a01a9 | 28,617 | py | Python | tests/unittest_namedopetope.py | altaris/opetopy | 285ba1d4c7ed94af2e0a76815e553d56498cff60 | [
"MIT"
] | 14 | 2018-09-28T14:31:07.000Z | 2021-03-10T16:40:04.000Z | tests/unittest_namedopetope.py | altaris/opetopy | 285ba1d4c7ed94af2e0a76815e553d56498cff60 | [
"MIT"
] | 6 | 2018-10-16T14:49:05.000Z | 2018-11-21T10:53:23.000Z | tests/unittest_namedopetope.py | altaris/opetopy | 285ba1d4c7ed94af2e0a76815e553d56498cff60 | [
"MIT"
] | 1 | 2021-05-06T12:37:13.000Z | 2021-05-06T12:37:13.000Z | import unittest
import sys
sys.path.insert(0, "../")
from opetopy.common import DerivationError
from opetopy import NamedOpetope
class Test_NamedOpetope_Variable(unittest.TestCase):
def setUp(self):
self.a0 = NamedOpetope.Variable("a", 0)
self.b0 = NamedOpetope.Variable("b", 0)
self.c... | 46.380875 | 79 | 0.608415 | import unittest
import sys
sys.path.insert(0, "../")
from opetopy.common import DerivationError
from opetopy import NamedOpetope
class Test_NamedOpetope_Variable(unittest.TestCase):
def setUp(self):
self.a0 = NamedOpetope.Variable("a", 0)
self.b0 = NamedOpetope.Variable("b", 0)
self.c... | true | true |
f7703632d17080fe2d727faa0c38d10cdc73dc94 | 1,672 | py | Python | docs/components_page/components/collapse/multiple.py | glsdown/dash-bootstrap-components | 0ebea4f7de43975f6e3a2958359c4480ae1d4927 | [
"Apache-2.0"
] | 776 | 2019-02-07T19:36:59.000Z | 2022-03-31T05:53:04.000Z | docs/components_page/components/collapse/multiple.py | glsdown/dash-bootstrap-components | 0ebea4f7de43975f6e3a2958359c4480ae1d4927 | [
"Apache-2.0"
] | 350 | 2019-02-05T10:42:19.000Z | 2022-03-31T19:23:35.000Z | docs/components_page/components/collapse/multiple.py | glsdown/dash-bootstrap-components | 0ebea4f7de43975f6e3a2958359c4480ae1d4927 | [
"Apache-2.0"
] | 219 | 2019-02-10T13:46:25.000Z | 2022-03-23T17:03:39.000Z | import dash_bootstrap_components as dbc
from dash import Input, Output, State, html
collapses = html.Div(
[
dbc.Button(
"Toggle left",
color="primary",
id="left",
className="me-1",
n_clicks=0,
),
dbc.Button(
"Toggle rig... | 26.125 | 74 | 0.458732 | import dash_bootstrap_components as dbc
from dash import Input, Output, State, html
collapses = html.Div(
[
dbc.Button(
"Toggle left",
color="primary",
id="left",
className="me-1",
n_clicks=0,
),
dbc.Button(
"Toggle rig... | true | true |
f7703661d5dcb5c572c92d5fa5b9daaa3ace038d | 4,556 | py | Python | src/Pharmacopedia.py | arthur-dysart/ArthurDysartPC | 54080141d927b2e7ca28e75be14a956e94c42d82 | [
"MIT"
] | 1 | 2018-10-16T09:29:34.000Z | 2018-10-16T09:29:34.000Z | src/Pharmacopedia.py | arthur-dysart/ArthurDysartPC | 54080141d927b2e7ca28e75be14a956e94c42d82 | [
"MIT"
] | null | null | null | src/Pharmacopedia.py | arthur-dysart/ArthurDysartPC | 54080141d927b2e7ca28e75be14a956e94c42d82 | [
"MIT"
] | 1 | 2020-12-27T09:36:30.000Z | 2020-12-27T09:36:30.000Z | # -*- coding: utf-8 -*-
"""
Pharmacopedia.Py v1.0
Pharmacy Counting Project
Arhur D. Dysart
DESCRIPTION
Analyzes and organizes medical pharmacy data. Using data from the Centers for
Medicare & Medicaid Services, this script calculates: (1) total number of
prescribers and (2) total prescriber expenditure for all list... | 33.255474 | 79 | 0.71137 |
import sys
import DysartImport as ad1
import DysartAnalysis as ad2
import DysartExport as ad3
sys.tracebacklimit = None
warning_display = False
cost_usd = True
safe_char = [
"A","B","C","D","E","F","G","H","I","J","K","L","M",
"N","O","P","Q","R","S","T","U","V","W","X","Y","Z",
"a","b","c","d","e"... | true | true |
f7703705dfb28eac594d765b5ba7d4dd8b0d1905 | 1,430 | py | Python | tests/test_examples.py | guyms/pyansys | 7a9182a7c44098d9b99a0d1eb2fd183b7256ac01 | [
"MIT"
] | 1 | 2019-04-16T14:49:28.000Z | 2019-04-16T14:49:28.000Z | tests/test_examples.py | AdrlVmadriel/pyansys | 3f97f970546f7cdf1f301f683c9a6bdcd92357c2 | [
"MIT"
] | null | null | null | tests/test_examples.py | AdrlVmadriel/pyansys | 3f97f970546f7cdf1f301f683c9a6bdcd92357c2 | [
"MIT"
] | null | null | null | import pytest
import pyansys
from pyansys import examples
from vtki.plotting import running_xserver
import os
@pytest.mark.skipif(not running_xserver(), reason="Requires active X Server")
def test_show_hex_archive():
examples.show_hex_archive(off_screen=True)
def test_load_result():
examples.load_result()
... | 29.183673 | 77 | 0.770629 | import pytest
import pyansys
from pyansys import examples
from vtki.plotting import running_xserver
import os
@pytest.mark.skipif(not running_xserver(), reason="Requires active X Server")
def test_show_hex_archive():
examples.show_hex_archive(off_screen=True)
def test_load_result():
examples.load_result()
... | true | true |
f7703a015d40c7315e70c3ff652ae3322f23f629 | 562 | py | Python | words.py | iamywang/words-statistics | 3254cbe087a70cd519e06c933ea754fa98a0001d | [
"MIT"
] | 1 | 2019-10-28T10:01:45.000Z | 2019-10-28T10:01:45.000Z | words.py | iamywang/words-statistics | 3254cbe087a70cd519e06c933ea754fa98a0001d | [
"MIT"
] | null | null | null | words.py | iamywang/words-statistics | 3254cbe087a70cd519e06c933ea754fa98a0001d | [
"MIT"
] | null | null | null | # Python 词频统计
with open('a.txt', 'r') as f:
str = f.read()
str = str.replace(",", " ")
str = str.replace(".", " ")
str = str.replace("!", " ")
str = str.replace("?", " ")
str = str.replace(":", " ")
str = str.replace(";", " ")
str = str.replace("\'", " ")
str = str.replace("/", " ")
str_list = str.split()
str_dict ... | 25.545455 | 52 | 0.548043 | with open('a.txt', 'r') as f:
str = f.read()
str = str.replace(",", " ")
str = str.replace(".", " ")
str = str.replace("!", " ")
str = str.replace("?", " ")
str = str.replace(":", " ")
str = str.replace(";", " ")
str = str.replace("\'", " ")
str = str.replace("/", " ")
str_list = str.split()
str_dict = {}
for i in ... | true | true |
f7703ad4efa0c5e220148d9a68e2a64d1a871cdc | 635 | py | Python | backend/blog/core/models.py | wandss/blog | 1b1cb68b175a57b871a21f1c887a0159d0d71c9f | [
"MIT"
] | null | null | null | backend/blog/core/models.py | wandss/blog | 1b1cb68b175a57b871a21f1c887a0159d0d71c9f | [
"MIT"
] | 18 | 2021-08-23T15:28:59.000Z | 2021-12-15T03:14:15.000Z | backend/blog/core/models.py | wandss/blog | 1b1cb68b175a57b871a21f1c887a0159d0d71c9f | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth import get_user_model
from uuid import uuid4
User = get_user_model()
class Post(models.Model):
post_id = models.UUIDField(primary_key=True, default=uuid4, editable=False)
title = models.CharField(max_length=50)
tag = models.CharField(max_length=50, n... | 30.238095 | 85 | 0.746457 | from django.db import models
from django.contrib.auth import get_user_model
from uuid import uuid4
User = get_user_model()
class Post(models.Model):
post_id = models.UUIDField(primary_key=True, default=uuid4, editable=False)
title = models.CharField(max_length=50)
tag = models.CharField(max_length=50, n... | true | true |
f7703d0183e494da3ae039a1d74f8b13ddbcd3be | 779 | py | Python | WebMirror/management/rss_parser_funcs/feed_parse_extractWwwWastedproductionsCom.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 193 | 2016-08-02T22:04:35.000Z | 2022-03-09T20:45:41.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractWwwWastedproductionsCom.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 533 | 2016-08-23T20:48:23.000Z | 2022-03-28T15:55:13.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractWwwWastedproductionsCom.py | rrosajp/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 19 | 2015-08-13T18:01:08.000Z | 2021-07-12T17:13:09.000Z | def extractWwwWastedproductionsCom(item):
'''
Parser for 'www.wastedproductions.com'
'''
badwords = [
'#ninerwrimo',
'#NaNoWriMo',
'#ThursdayTales',
'#StoryCubes',
]
if any([bad in item['tags'] for bad in badwords]):
return None
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item[... | 24.34375 | 104 | 0.614891 | def extractWwwWastedproductionsCom(item):
badwords = [
'#ninerwrimo',
'#NaNoWriMo',
'#ThursdayTales',
'#StoryCubes',
]
if any([bad in item['tags'] for bad in badwords]):
return None
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in ite... | true | true |
f7703d4bb6e110dd91abf1071143e2d5b8e4d9c0 | 609 | py | Python | app/__init__.py | indomitable-core/News-API | 3f554920a5479e71038596ef70a988efcec95fce | [
"MIT"
] | null | null | null | app/__init__.py | indomitable-core/News-API | 3f554920a5479e71038596ef70a988efcec95fce | [
"MIT"
] | null | null | null | app/__init__.py | indomitable-core/News-API | 3f554920a5479e71038596ef70a988efcec95fce | [
"MIT"
] | null | null | null | from flask import Flask
from .config import DevConfig
from flask_bootstrap import Bootstrap
# Initializing application
app = Flask(__name__, instance_relative_config=True)
# setting up configuration
app.config.from_object(DevConfig)
app.config.from_pyfile('config.py')
# initialize Flask Extension
bootstrap = Bootstr... | 26.478261 | 53 | 0.738916 | from flask import Flask
from .config import DevConfig
from flask_bootstrap import Bootstrap
app = Flask(__name__, instance_relative_config=True)
app.config.from_object(DevConfig)
app.config.from_pyfile('config.py')
bootstrap = Bootstrap(app)
@app.template_filter()
def format_datetime(value, format='medium'):
if... | true | true |
f7703d9ffd53431fcab01c3790c6c6b1347972ef | 5,317 | py | Python | Python Project Filter-Detect-GUI/various_functions.py | JulienL3vesque/Hexoskin_RnD_OSM | b524430d6f4b2b300d119b6a1586141e6c2d14a3 | [
"MIT"
] | null | null | null | Python Project Filter-Detect-GUI/various_functions.py | JulienL3vesque/Hexoskin_RnD_OSM | b524430d6f4b2b300d119b6a1586141e6c2d14a3 | [
"MIT"
] | null | null | null | Python Project Filter-Detect-GUI/various_functions.py | JulienL3vesque/Hexoskin_RnD_OSM | b524430d6f4b2b300d119b6a1586141e6c2d14a3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue May 30 13:06:52 2017
@author: Mostafa Hammoud
This script contains various functions that will be used
"""
import numpy as np
import operator
from os import listdir
from os.path import isfile, join
from matplotlib import pyplot as plt
"""
This function takes the R waves that... | 31.093567 | 80 | 0.589054 |
import numpy as np
import operator
from os import listdir
from os.path import isfile, join
from matplotlib import pyplot as plt
def fix_r(peaks,long_filt_ecg):
for i in range (0,len(peaks)):
temp_range = np.arange(peaks[i] - 10,peaks[i] + 10)
# significant S wave
... | true | true |
f7703e0d50b7c6592b5e2bde7a87be4ee77687bc | 14,626 | py | Python | example/circulation_closed_loop.py | michelebucelli/cardioemulator | 0ce8d5fce017a7251865ab01fdf3d0653490b60f | [
"MIT"
] | null | null | null | example/circulation_closed_loop.py | michelebucelli/cardioemulator | 0ce8d5fce017a7251865ab01fdf3d0653490b60f | [
"MIT"
] | null | null | null | example/circulation_closed_loop.py | michelebucelli/cardioemulator | 0ce8d5fce017a7251865ab01fdf3d0653490b60f | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import json
import csv
import time
from scipy.integrate import RK45, solve_ivp
class circulation_closed_loop:
"""
Closed loop circulation model.
References
----------
F. Regazzoni, M. Salvador, P. C. Africa, M. Fedele, L. Dede', A. Quarteroni,
"A cardiac ... | 49.245791 | 197 | 0.557842 | import numpy as np
import pandas as pd
import json
import csv
import time
from scipy.integrate import RK45, solve_ivp
class circulation_closed_loop:
def __init__(self, options = dict()):
if isinstance(options, str):
with open(options, mode='r', newline='') as inputfile:
option... | true | true |
f7703fd1d5533b12ec8174b612602d675200f450 | 1,756 | py | Python | ass1/rsc/stp_header.py | suryaavala/network | 291b59dce961448b2a9b92b6a0754ec994a6fb91 | [
"MIT"
] | null | null | null | ass1/rsc/stp_header.py | suryaavala/network | 291b59dce961448b2a9b92b6a0754ec994a6fb91 | [
"MIT"
] | null | null | null | ass1/rsc/stp_header.py | suryaavala/network | 291b59dce961448b2a9b92b6a0754ec994a6fb91 | [
"MIT"
] | null | null | null | #STP header feilds
#list, fields containing following keys
#dict, head containing key, value pairs
#1. source port #
#2. dest port #
#3. seq_nb
#4. ack_nb
#5. ACK
#6. SYN
#7. FIN
#8. RST
#example ['1234', '1234', '100000', '4294967295', '4294967295', '0', '1', '1', '1']
#max len of header = 46 bytes
#b'1234+1234+10000... | 24.054795 | 123 | 0.571185 |
class header:
def __init__(self):
self.fields = ["sport","dport","seq_nb","ack_nb","ACK","SYN","FIN","RST"]
self.head = {}
for f in self.fields:
self.head[f] = "0"
return
def get_head(self):
return self.head
def get_fields(self):
retur... | true | true |
f7704019036a093139d780203b6e9059ed19524f | 1,312 | py | Python | 7_dynamic_programming/med/knapsack_recursive_med.py | itsEmShoji/TCScurriculum | bd27c8c2b26032e9e6f92a50b40ec19d45301988 | [
"MIT"
] | null | null | null | 7_dynamic_programming/med/knapsack_recursive_med.py | itsEmShoji/TCScurriculum | bd27c8c2b26032e9e6f92a50b40ec19d45301988 | [
"MIT"
] | null | null | null | 7_dynamic_programming/med/knapsack_recursive_med.py | itsEmShoji/TCScurriculum | bd27c8c2b26032e9e6f92a50b40ec19d45301988 | [
"MIT"
] | null | null | null | # TODO: import
# REQUIRES: num_items >= 0, capacity >= 0,
# size of item_values >= num_items,
# size of item_weights >= num_items,
# item_values are all >= 0, item_weights are all >= 0
# EFFECTS: Computes the max value that can be obtained by picking
# from a set of num_items items without exceed... | 32 | 65 | 0.648628 |
def knapSack(capacity, item_weights, item_values, num_items):
return max(item_values[num_items-1] +
knapSack(capacity-item_weights[num_items-1],
item_weights, item_values, num_items-1),
knapSack(capacity, item_weights, item_valu... | true | true |
f77041272a16a7d7d5a08fe76a612deca5b5b1d7 | 1,536 | py | Python | sdk/cognitiveservices/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/_spell_check_client_enums.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/cognitiveservices/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/_spell_check_client_enums.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/cognitiveservices/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/_spell_check_client_enums.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 27.428571 | 76 | 0.666667 |
from enum import Enum
class ErrorType(str, Enum):
unknown_token = "UnknownToken"
repeated_token = "RepeatedToken"
class ErrorCode(str, Enum):
none = "None"
server_error = "ServerError"
invalid_request = "InvalidRequest"
rate_limit_exceeded = "RateLimitExceeded"
invalid_authorization =... | true | true |
f7704171c8056421e4f5b92992850cfc33835085 | 1,875 | py | Python | scripts/artifacts/appleMapsSearchHistory.py | xperylabhub/iLEAPP | fd1b301bf2094387f51ccdbd10ed233ce9abd687 | [
"MIT"
] | 1 | 2020-10-30T22:11:32.000Z | 2020-10-30T22:11:32.000Z | scripts/artifacts/appleMapsSearchHistory.py | xperylabhub/iLEAPP | fd1b301bf2094387f51ccdbd10ed233ce9abd687 | [
"MIT"
] | null | null | null | scripts/artifacts/appleMapsSearchHistory.py | xperylabhub/iLEAPP | fd1b301bf2094387f51ccdbd10ed233ce9abd687 | [
"MIT"
] | null | null | null | import plistlib
from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv, timeline, is_platform_windows
def get_appleMapsSearchHistory(files_found, report_folder, seeker):
data_list = []
for file_found in files_found:
file_found = str(file_found)
with... | 44.642857 | 93 | 0.654933 | import plistlib
from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv, timeline, is_platform_windows
def get_appleMapsSearchHistory(files_found, report_folder, seeker):
data_list = []
for file_found in files_found:
file_found = str(file_found)
with... | true | true |
f77041c575a856595d27cf23c225aa3626a614f9 | 5,952 | py | Python | nipype/external/fsl_imglob.py | sebastientourbier/nipype | 99c5904176481520c5bf42a501aae1a12184e672 | [
"Apache-2.0"
] | 2 | 2019-01-25T18:20:51.000Z | 2019-07-30T20:51:51.000Z | nipype/external/fsl_imglob.py | sebastientourbier/nipype | 99c5904176481520c5bf42a501aae1a12184e672 | [
"Apache-2.0"
] | null | null | null | nipype/external/fsl_imglob.py | sebastientourbier/nipype | 99c5904176481520c5bf42a501aae1a12184e672 | [
"Apache-2.0"
] | 2 | 2018-01-25T19:48:17.000Z | 2019-01-25T18:20:52.000Z | #!/usr/bin/env python
# imglob - expand list of image filenames
# Stephen Smith, Mark Jenkinson and Matthew Webster FMRIB Image Analysis Group
# Copyright (C) 2009 University of Oxford
# Part of FSL - FMRIB's Software Library
# http://www.fmrib.ox.ac.uk/fsl
# fsl@fmrib.ox.ac.uk
#
# Developed at FMRIB (Oxf... | 41.333333 | 124 | 0.702117 | # http://www.fmrib.ox.ac.uk/fsl
# fsl@fmrib.ox.ac.uk
#
# Developed at FMRIB (Oxford Centre for Functional Magnetic Resonance
# Imaging of the Brain), Department of Clinical Neurology, Oxford
# University, Oxford, UK
#
#
# LICENCE
#
# FMRIB Software Library, Release 5.0 (c) 2012, The University of
# Oxfo... | true | true |
f77043213fa50dbd26e927a80ab3808a566aed5d | 1,584 | py | Python | jts/backend/faq/migrations/0001_initial.py | goupaz/babylon | 4e638d02705469061e563fec349676d8faa9f648 | [
"MIT"
] | 1 | 2019-08-08T09:03:17.000Z | 2019-08-08T09:03:17.000Z | backend/faq/migrations/0001_initial.py | goupaz/website | ce1bc8b6c52ee0815a7b98842ec3bde0c20e0add | [
"Apache-2.0"
] | 2 | 2020-10-09T19:16:09.000Z | 2020-10-10T20:40:41.000Z | jts/backend/faq/migrations/0001_initial.py | goupaz/babylon-hackathon | 4e638d02705469061e563fec349676d8faa9f648 | [
"MIT"
] | 1 | 2019-07-21T01:42:21.000Z | 2019-07-21T01:42:21.000Z | # Generated by Django 2.2 on 2019-10-09 18:19
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Faq',
fields=[
... | 36 | 124 | 0.551768 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Faq',
fields=[
('id', models.AutoField(auto_created=True, ... | true | true |
f77043c0c8fa91acde7fae56788d72db3b1057f3 | 12,394 | py | Python | main.py | kim95175/detr | 342947185153e1f599b47da423a0c49329bbe055 | [
"Apache-2.0"
] | null | null | null | main.py | kim95175/detr | 342947185153e1f599b47da423a0c49329bbe055 | [
"Apache-2.0"
] | null | null | null | main.py | kim95175/detr | 342947185153e1f599b47da423a0c49329bbe055 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import argparse
import datetime
import json
import random
import time
from pathlib import Path
import numpy as np
import torch
from torch.utils.data import DataLoader, DistributedSampler
import datasets
import util.misc as utils
from datasets impo... | 46.246269 | 168 | 0.643214 | import argparse
import datetime
import json
import random
import time
from pathlib import Path
import numpy as np
import torch
from torch.utils.data import DataLoader, DistributedSampler
import datasets
import util.misc as utils
from datasets import build_dataset, get_coco_api_from_dataset
from engine import evaluate... | true | true |
f770447098bd2aa22ddbc381d64fd149b2593999 | 4,020 | py | Python | autogluon/taxi_trip_duration.py | oguzhangur96/automl-benchmark | 785b4d762164dd251b7c5e63131579113c2dc2c2 | [
"MIT"
] | null | null | null | autogluon/taxi_trip_duration.py | oguzhangur96/automl-benchmark | 785b4d762164dd251b7c5e63131579113c2dc2c2 | [
"MIT"
] | null | null | null | autogluon/taxi_trip_duration.py | oguzhangur96/automl-benchmark | 785b4d762164dd251b7c5e63131579113c2dc2c2 | [
"MIT"
] | null | null | null | # %% [markdown]
# This is a simple notebook for Autogluon AutoMl prediction.
# MLflow used as tracking tool since experiments take long time complete
# and it is hard to manage too many experiments.
#%%
# Importing necessary libraries
import os
import re
import random
import string
import math
import pandas as pd
impor... | 41.875 | 121 | 0.666169 | import os
import re
import random
import string
import math
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_log_error
from autogluon import TabularPrediction as task
import mlflow
from sklearn.metrics import mean_squared_error
from aut... | true | true |
f7704504a24eb1e94e64c0e17b90de6b5e607503 | 32,241 | py | Python | src/engine/SCons/SConfTests.py | edobez/scons | 722228995b223b4507ebb686b48f94b9f7a8380c | [
"MIT"
] | null | null | null | src/engine/SCons/SConfTests.py | edobez/scons | 722228995b223b4507ebb686b48f94b9f7a8380c | [
"MIT"
] | 4 | 2019-04-11T16:27:45.000Z | 2019-04-11T23:56:30.000Z | src/engine/SCons/SConfTests.py | edobez/scons | 722228995b223b4507ebb686b48f94b9f7a8380c | [
"MIT"
] | null | null | null | #
# __COPYRIGHT__
#
# 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, publish,
# distribute, sublicen... | 40.30125 | 114 | 0.536491 |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import SCons.compat
import io
import os
import re
import sys
from types import *
import unittest
import TestCmd
sys.stdout = io.StringIO()
if sys.platform == 'win32':
existing_lib = "msvcrt"
else:
existing_lib = "m"
class SConfTestCase(unittes... | true | true |
f770451dc7fbbadd026f2a4a180fff9a30b68bd3 | 10,438 | py | Python | indico/modules/events/timetable/forms.py | kadet1090/indico | 36a1036017bdce5c910e889fea7017f18a1dd026 | [
"MIT"
] | 1 | 2021-08-11T19:13:18.000Z | 2021-08-11T19:13:18.000Z | indico/modules/events/timetable/forms.py | kadet1090/indico | 36a1036017bdce5c910e889fea7017f18a1dd026 | [
"MIT"
] | null | null | null | indico/modules/events/timetable/forms.py | kadet1090/indico | 36a1036017bdce5c910e889fea7017f18a1dd026 | [
"MIT"
] | null | null | null | # This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from datetime import datetime, timedelta
from flask import reque... | 50.669903 | 116 | 0.648592 |
from __future__ import unicode_literals
from datetime import datetime, timedelta
from flask import request
from pytz import utc
from wtforms.fields import BooleanField, HiddenField, IntegerField, SelectField, StringField, TextAreaField
from wtforms.validators import DataRequired, InputRequired, NumberRange, Validati... | true | true |
f7704533b11e08d23d4e4cc2986d0d2a06c0eb1d | 9,481 | py | Python | mmflow/datasets/flyingthings3d_subset.py | ArlenCHEN/mmflow | 8e26e8dd049376d90c569ab6009c36b9af11ff10 | [
"Apache-2.0"
] | 481 | 2021-11-16T07:04:23.000Z | 2022-03-31T22:21:21.000Z | mmflow/datasets/flyingthings3d_subset.py | ArlenCHEN/mmflow | 8e26e8dd049376d90c569ab6009c36b9af11ff10 | [
"Apache-2.0"
] | 72 | 2021-11-16T12:25:55.000Z | 2022-03-28T13:10:45.000Z | mmflow/datasets/flyingthings3d_subset.py | ArlenCHEN/mmflow | 8e26e8dd049376d90c569ab6009c36b9af11ff10 | [
"Apache-2.0"
] | 48 | 2021-11-16T06:48:46.000Z | 2022-03-30T12:46:40.000Z | # Copyright (c) OpenMMLab. All rights reserved.
import os
import os.path as osp
import re
from typing import Optional, Sequence, Union
from .base_dataset import BaseDataset
from .builder import DATASETS
# these files contain nan, so exclude them.
exclude_files = dict(
left_into_future=[
'0004573.flo',
... | 37.772908 | 79 | 0.557747 | import os
import os.path as osp
import re
from typing import Optional, Sequence, Union
from .base_dataset import BaseDataset
from .builder import DATASETS
exclude_files = dict(
left_into_future=[
'0004573.flo',
'0006336.flo',
'0016948.flo',
'0015148.flo',
'0006922.flo',
... | true | true |
f770462ba478a4652458809ee2d2eac6ab35914a | 4,372 | py | Python | xlsxwriter/test/worksheet/test_cond_format14.py | totdiao/XlsxWriter | 3d65858d8933bddb8262d500bcc2005f28fde645 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/worksheet/test_cond_format14.py | totdiao/XlsxWriter | 3d65858d8933bddb8262d500bcc2005f28fde645 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/worksheet/test_cond_format14.py | totdiao/XlsxWriter | 3d65858d8933bddb8262d500bcc2005f28fde645 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ..helperfunctions import _xml_to_list
from ...worksheet import Worksheet
class TestAss... | 33.374046 | 171 | 0.35064 |
import unittest
from ...compatibility import StringIO
from ..helperfunctions import _xml_to_list
from ...worksheet import Worksheet
class TestAssembleWorksheet(unittest.TestCase):
def test_assemble_xml_file(self):
self.maxDiff = None
fh = StringIO()
worksheet = Worksheet()
worksh... | true | true |
f7704645007f0b0ef1c213d635db6c05df981f6e | 4,236 | py | Python | continuum/task_set.py | lebrice/continuum | 7fa9048361b5821b61fa8ec1ac535c2438329626 | [
"MIT"
] | null | null | null | continuum/task_set.py | lebrice/continuum | 7fa9048361b5821b61fa8ec1ac535c2438329626 | [
"MIT"
] | null | null | null | continuum/task_set.py | lebrice/continuum | 7fa9048361b5821b61fa8ec1ac535c2438329626 | [
"MIT"
] | null | null | null | from typing import Tuple, Union
import numpy as np
from PIL import Image
from torch.utils.data import Dataset as TorchDataset
from torchvision import transforms
from continuum.viz import plot
class TaskSet(TorchDataset):
"""A task dataset returned by the CLLoader.
:param x: The data, either image-arrays or... | 33.09375 | 98 | 0.620633 | from typing import Tuple, Union
import numpy as np
from PIL import Image
from torch.utils.data import Dataset as TorchDataset
from torchvision import transforms
from continuum.viz import plot
class TaskSet(TorchDataset):
def __init__(
self,
x: np.ndarray,
y: np.ndarray,
t: np.nd... | true | true |
f7704788b1e123ef8b63a36fb171ad42187a9603 | 619 | py | Python | sign_up2.py | ashik39/Python-workouts | 4ace5c0d0e3c754d0c9ac7bb73b6f7a6b326300d | [
"bzip2-1.0.6"
] | null | null | null | sign_up2.py | ashik39/Python-workouts | 4ace5c0d0e3c754d0c9ac7bb73b6f7a6b326300d | [
"bzip2-1.0.6"
] | null | null | null | sign_up2.py | ashik39/Python-workouts | 4ace5c0d0e3c754d0c9ac7bb73b6f7a6b326300d | [
"bzip2-1.0.6"
] | null | null | null | print("\n**Username should be characters\n\n**Password should be numbers")
def verify():
print("SIGN UP")
u=str(input("User name : "))
p=int(input("\nPassword : "))
print("SIGN IN")
username=str(input("\nUser name : "))
paw=int(input("Password : "))
if username==u and paw==p :
... | 29.47619 | 75 | 0.573506 | print("\n**Username should be characters\n\n**Password should be numbers")
def verify():
print("SIGN UP")
u=str(input("User name : "))
p=int(input("\nPassword : "))
print("SIGN IN")
username=str(input("\nUser name : "))
paw=int(input("Password : "))
if username==u and paw==p :
... | true | true |
f77048ff648c3614d22dae70ae799121bdab08b5 | 429 | py | Python | 567. Permutation in String.py | rohitpatwa/leetcode | f4826763e8f154cac9134d53b154b8299acd39a8 | [
"Xnet",
"X11",
"CECILL-B"
] | 1 | 2020-07-15T20:48:27.000Z | 2020-07-15T20:48:27.000Z | 567. Permutation in String.py | rohitpatwa/leetcode | f4826763e8f154cac9134d53b154b8299acd39a8 | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | 567. Permutation in String.py | rohitpatwa/leetcode | f4826763e8f154cac9134d53b154b8299acd39a8 | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | # l = len(s1). Slide over a window of size l on s2 and keep creating counters. If ctr_s1==ctr_s2: return true.
class Solution:
def checkInclusion(self, s1: str, s2: str) -> bool:
l = len(s1)
if len(s2) < l:
return False
for i in range(len(s2) - l + 1):
subst... | 33 | 110 | 0.529138 |
class Solution:
def checkInclusion(self, s1: str, s2: str) -> bool:
l = len(s1)
if len(s2) < l:
return False
for i in range(len(s2) - l + 1):
substr = s2[i:i+l]
if Counter(s1) == Counter(substr):
return True
return False | true | true |
f7704911c0d03711a457db631e9ababaa472b729 | 429 | py | Python | view_model/stream_viewmodel.py | ghhernandes/brdevstreamers | 32a0cd87943dcfe76ec8863c05b4a03d52814b96 | [
"Apache-2.0"
] | 16 | 2022-02-15T12:11:09.000Z | 2022-03-01T01:59:41.000Z | view_model/stream_viewmodel.py | ghhernandes/brdevstreamers | 32a0cd87943dcfe76ec8863c05b4a03d52814b96 | [
"Apache-2.0"
] | 2 | 2022-02-23T20:53:01.000Z | 2022-02-28T17:22:10.000Z | view_model/stream_viewmodel.py | ghhernandes/brdevstreamers | 32a0cd87943dcfe76ec8863c05b4a03d52814b96 | [
"Apache-2.0"
] | 7 | 2022-02-16T17:37:13.000Z | 2022-03-01T02:00:17.000Z | from typing import List, Optional
from view_model.user_viewmodel import UserOutViewModel
class StreamViewModel(UserOutViewModel):
id: Optional[str]
user_id: Optional[str]
user_name: Optional[str]
title: Optional[str]
viewer_count: Optional[int]
started_at: Optional[str]
thumbnail_url: Opt... | 25.235294 | 54 | 0.741259 | from typing import List, Optional
from view_model.user_viewmodel import UserOutViewModel
class StreamViewModel(UserOutViewModel):
id: Optional[str]
user_id: Optional[str]
user_name: Optional[str]
title: Optional[str]
viewer_count: Optional[int]
started_at: Optional[str]
thumbnail_url: Opt... | true | true |
f7704b334054afa6f7dbd290d69cbd9eed4eb968 | 23 | py | Python | mycli/__init__.py | Arvind2222/mycli | 808d1ddc94351919e93867a79f7db46e8455c58f | [
"BSD-3-Clause"
] | 1 | 2019-03-13T11:40:25.000Z | 2019-03-13T11:40:25.000Z | mycli/__init__.py | amzyang/mycli | d659e13655bebcb9b7ea8c5184187ce1549aea9e | [
"BSD-3-Clause"
] | null | null | null | mycli/__init__.py | amzyang/mycli | d659e13655bebcb9b7ea8c5184187ce1549aea9e | [
"BSD-3-Clause"
] | null | null | null | __version__ = '1.24.3'
| 11.5 | 22 | 0.652174 | __version__ = '1.24.3'
| true | true |
f7704b3dce5cd94981cb7391a19b755c0df22b68 | 304 | py | Python | test/socket_client.py | suxb201/Socks5_DNS_Test | a1cb8b5d8d998c6a029dc0b329418ecbb9a2fc72 | [
"MIT"
] | 1 | 2020-11-09T02:08:04.000Z | 2020-11-09T02:08:04.000Z | test/socket_client.py | suxb201/Socks5_DNS_Test | a1cb8b5d8d998c6a029dc0b329418ecbb9a2fc72 | [
"MIT"
] | null | null | null | test/socket_client.py | suxb201/Socks5_DNS_Test | a1cb8b5d8d998c6a029dc0b329418ecbb9a2fc72 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import socket
HOST = '127.0.0.1' # 服务器的主机名或者 IP 地址
PORT = 10009 # 服务器使用的端口
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
print(s)
s.connect((HOST, PORT))
s.sendall(b'Hello, world')
print(s)
data = s.recv(1024)
print('Received', repr(data))
| 19 | 60 | 0.651316 |
import socket
HOST = '127.0.0.1' PORT = 10009
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
print(s)
s.connect((HOST, PORT))
s.sendall(b'Hello, world')
print(s)
data = s.recv(1024)
print('Received', repr(data))
| true | true |
f7704b71a82010531d15d2240462b3841b7a638b | 3,706 | py | Python | commands/bonobo_etl.py | klmcwhirter/py-etl-explore | bb11fbb7214b6653cf438afe4e114348f262b338 | [
"MIT"
] | null | null | null | commands/bonobo_etl.py | klmcwhirter/py-etl-explore | bb11fbb7214b6653cf438afe4e114348f262b338 | [
"MIT"
] | null | null | null | commands/bonobo_etl.py | klmcwhirter/py-etl-explore | bb11fbb7214b6653cf438afe4e114348f262b338 | [
"MIT"
] | null | null | null | """a simple ETL modulle
Usage:
bonobo_etl.py load [--conn=<conn-string>] [--file=<file>] [-v | --verbose]
Options:
--conn=<conn-string> The connection string to use. e.g., sqlite:///data/outbound/pandas_etl.db [default: sqlite:///:memory:]
--file=<file> The input file to process [default: data/inboun... | 29.887097 | 127 | 0.592553 |
import csv
import logging
import sys
from datetime import datetime
import bonobo
from bonobo.config import use
from docopt import docopt
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from models.weather import Weather
csv.register_dialect('pipe_delim', delimiter='|')
class BonoboEtl... | true | true |
f7704c0d30ffab544bc3519d835a40c101110ab0 | 128,504 | py | Python | tests/components/alexa/test_smart_home.py | claret-srl/core | 317068a3784648defadead1c2e6e8de29e20b696 | [
"Apache-2.0"
] | null | null | null | tests/components/alexa/test_smart_home.py | claret-srl/core | 317068a3784648defadead1c2e6e8de29e20b696 | [
"Apache-2.0"
] | null | null | null | tests/components/alexa/test_smart_home.py | claret-srl/core | 317068a3784648defadead1c2e6e8de29e20b696 | [
"Apache-2.0"
] | null | null | null | """Test for smart home alexa support."""
from unittest.mock import patch
import pytest
from homeassistant.components.alexa import messages, smart_home
import homeassistant.components.camera as camera
from homeassistant.components.cover import DEVICE_CLASS_GATE
from homeassistant.components.media_player.const import ... | 32.42594 | 106 | 0.630938 |
from unittest.mock import patch
import pytest
from homeassistant.components.alexa import messages, smart_home
import homeassistant.components.camera as camera
from homeassistant.components.cover import DEVICE_CLASS_GATE
from homeassistant.components.media_player.const import (
SUPPORT_NEXT_TRACK,
SUPPORT_PAU... | true | true |
f7704c8b3a1398e5a50200dfcaea35c49b1b189a | 9,648 | py | Python | conans/client/rest/uploader_downloader.py | akemimadoka/conan | 272be061082ddf73f1f5d71bf98f50273d7f3cba | [
"MIT"
] | null | null | null | conans/client/rest/uploader_downloader.py | akemimadoka/conan | 272be061082ddf73f1f5d71bf98f50273d7f3cba | [
"MIT"
] | null | null | null | conans/client/rest/uploader_downloader.py | akemimadoka/conan | 272be061082ddf73f1f5d71bf98f50273d7f3cba | [
"MIT"
] | null | null | null | import os
import traceback
import time
from conans.util import progress_bar
from conans.client.rest import response_to_str
from conans.errors import AuthenticationException, ConanConnectionError, ConanException, \
NotFoundException, ForbiddenException, RequestErrorException
from conans.util.files import mkdir, sav... | 40.537815 | 101 | 0.596186 | import os
import traceback
import time
from conans.util import progress_bar
from conans.client.rest import response_to_str
from conans.errors import AuthenticationException, ConanConnectionError, ConanException, \
NotFoundException, ForbiddenException, RequestErrorException
from conans.util.files import mkdir, sav... | true | true |
f7704ddd76d348cb9162fb19c49dd4eac1c655aa | 6,039 | py | Python | tests/contrib/sensors/test_file_sensor.py | InigoSJ/airflow | 8b97a387dc30d8c88390d500ec99333798c20f1c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2019-09-06T09:55:18.000Z | 2019-09-06T09:55:18.000Z | tests/contrib/sensors/test_file_sensor.py | InigoSJ/airflow | 8b97a387dc30d8c88390d500ec99333798c20f1c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | tests/contrib/sensors/test_file_sensor.py | InigoSJ/airflow | 8b97a387dc30d8c88390d500ec99333798c20f1c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 31.128866 | 76 | 0.578076 |
import unittest
import shutil
import tempfile
import os.path
from airflow import models, DAG
from airflow.exceptions import AirflowSensorTimeout
from airflow.contrib.sensors.file_sensor import FileSensor
from airflow.settings import Session
from airflow.utils.timezone import datetime
TEST_DAG_ID = 'unit_tests'
DEFAU... | true | true |
f7704eb97bb7c349aa75f52b7a7e297262e5b46c | 16,295 | py | Python | scripts/devops_tasks/common_tasks.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1 | 2021-04-26T21:15:01.000Z | 2021-04-26T21:15:01.000Z | scripts/devops_tasks/common_tasks.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2 | 2021-08-24T15:32:30.000Z | 2021-08-24T23:21:34.000Z | scripts/devops_tasks/common_tasks.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1 | 2016-04-19T22:15:47.000Z | 2016-04-19T22:15:47.000Z | #!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------... | 33.667355 | 157 | 0.667567 |
import glob
from subprocess import check_call, CalledProcessError
import os
import errno
import shutil
import sys
import logging
import ast
import textwrap
import io
import re
import fnmatch
from pkg_resources import parse_version, parse_requirements, Requirement, WorkingSet, working_set
from packaging.specifiers ... | true | true |
f7704ef489e603d1b12ffb5225ef868665c53164 | 487 | py | Python | examples/serve/demo/resample_in_time.py | SabineEmbacher/xcube | 25863c713a27f1ecf6efb25ee0de8d322ab295bc | [
"MIT"
] | 97 | 2018-06-26T13:02:55.000Z | 2022-03-26T21:03:13.000Z | examples/serve/demo/resample_in_time.py | SabineEmbacher/xcube | 25863c713a27f1ecf6efb25ee0de8d322ab295bc | [
"MIT"
] | 524 | 2018-11-09T12:00:08.000Z | 2022-03-31T17:00:13.000Z | examples/serve/demo/resample_in_time.py | SabineEmbacher/xcube | 25863c713a27f1ecf6efb25ee0de8d322ab295bc | [
"MIT"
] | 15 | 2019-07-09T08:46:03.000Z | 2022-02-07T18:47:34.000Z | import xarray as xr
def compute_dataset(ds, period='1W', incl_stdev=False):
if incl_stdev:
resample_obj = ds.resample(time=period)
ds_mean = resample_obj.mean(dim='time')
ds_std = resample_obj.std(dim='time').rename(name_dict={name: f"{name}_stdev" for name in ds.data_vars})
ds_mer... | 34.785714 | 112 | 0.663244 | import xarray as xr
def compute_dataset(ds, period='1W', incl_stdev=False):
if incl_stdev:
resample_obj = ds.resample(time=period)
ds_mean = resample_obj.mean(dim='time')
ds_std = resample_obj.std(dim='time').rename(name_dict={name: f"{name}_stdev" for name in ds.data_vars})
ds_mer... | true | true |
f7704efa3c66d5373f3d0e73beecd42d9a15ead6 | 221 | py | Python | gluoncv/utils/metrics/__init__.py | islinwh/gluon-cv | 669b1ac169ad26c6df06ab26592de2baf109fe44 | [
"Apache-2.0"
] | 36 | 2019-12-25T04:59:49.000Z | 2022-03-17T07:24:49.000Z | gluoncv/utils/metrics/__init__.py | islinwh/gluon-cv | 669b1ac169ad26c6df06ab26592de2baf109fe44 | [
"Apache-2.0"
] | 1 | 2019-01-18T06:42:59.000Z | 2019-01-18T12:26:11.000Z | gluoncv/utils/metrics/__init__.py | islinwh/gluon-cv | 669b1ac169ad26c6df06ab26592de2baf109fe44 | [
"Apache-2.0"
] | 9 | 2019-12-25T05:00:33.000Z | 2021-10-01T14:23:51.000Z | """Custom evaluation metrics"""
from __future__ import absolute_import
from .coco_detection import COCODetectionMetric
from .voc_detection import VOCMApMetric, VOC07MApMetric
from .segmentation import SegmentationMetric
| 31.571429 | 55 | 0.859729 | from __future__ import absolute_import
from .coco_detection import COCODetectionMetric
from .voc_detection import VOCMApMetric, VOC07MApMetric
from .segmentation import SegmentationMetric
| true | true |
f7704f4e1d75e91970458931bb266ceafe6b81f4 | 816 | py | Python | Train_Evaluate_KTH_VideoBlockClassifier.py | CeeBeeTree/KTH-Action-Recognition | ec3a1290f13e7dc83b0db3dd5806ebd0c9c23a85 | [
"MIT"
] | null | null | null | Train_Evaluate_KTH_VideoBlockClassifier.py | CeeBeeTree/KTH-Action-Recognition | ec3a1290f13e7dc83b0db3dd5806ebd0c9c23a85 | [
"MIT"
] | null | null | null | Train_Evaluate_KTH_VideoBlockClassifier.py | CeeBeeTree/KTH-Action-Recognition | ec3a1290f13e7dc83b0db3dd5806ebd0c9c23a85 | [
"MIT"
] | null | null | null | from KTH_DataModule import KTH_DataModule
from KTH_VideoBlockClassifier import KTH_VideoBlockClassifier
import pytorch_lightning as pl
from argparse import ArgumentParser
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("--data_path", type=str, default="/data", dest="data_path")
... | 32.64 | 92 | 0.721814 | from KTH_DataModule import KTH_DataModule
from KTH_VideoBlockClassifier import KTH_VideoBlockClassifier
import pytorch_lightning as pl
from argparse import ArgumentParser
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("--data_path", type=str, default="/data", dest="data_path")
... | true | true |
f7704fcc2b00d6331bf8977e7701dbc115c59335 | 40 | py | Python | tagalog/shipper/shipper_error.py | alphagov/tagalog | 96336539214a96bd05d600c77c37205eca5cdb48 | [
"MIT"
] | 2 | 2015-03-12T07:33:38.000Z | 2015-04-27T13:18:01.000Z | tagalog/shipper/shipper_error.py | alphagov/tagalog | 96336539214a96bd05d600c77c37205eca5cdb48 | [
"MIT"
] | null | null | null | tagalog/shipper/shipper_error.py | alphagov/tagalog | 96336539214a96bd05d600c77c37205eca5cdb48 | [
"MIT"
] | 3 | 2015-03-12T07:33:41.000Z | 2021-04-10T20:56:14.000Z | class ShipperError(Exception):
pass
| 13.333333 | 30 | 0.75 | class ShipperError(Exception):
pass
| true | true |
f7705129333c96d988e0360b0d44932ec6a29a8b | 1,598 | py | Python | wire/helpers/getelement.py | MisterBianco/Wire | 43f9e818d79d96b541f399672a142f19f6489020 | [
"MIT"
] | 2 | 2019-04-15T06:39:03.000Z | 2021-03-18T04:06:27.000Z | wire/helpers/getelement.py | MisterBianco/Wire | 43f9e818d79d96b541f399672a142f19f6489020 | [
"MIT"
] | 155 | 2019-04-05T02:52:16.000Z | 2021-07-30T12:14:52.000Z | wire/helpers/getelement.py | MisterBianco/Wire | 43f9e818d79d96b541f399672a142f19f6489020 | [
"MIT"
] | 1 | 2020-06-29T18:12:50.000Z | 2020-06-29T18:12:50.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from typing import List
import functools
from wire.element import ToElementConverter
from wire.helpers import identifiers
from wire.helpers import logging
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions... | 30.150943 | 79 | 0.642678 |
from typing import List
import functools
from wire.element import ToElementConverter
from wire.helpers import identifiers
from wire.helpers import logging
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import T... | true | true |
f770514002d77e278c2502103a9a6cb520f1fcbe | 324 | py | Python | bluebottle/projects/migrations/0009_merge.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 10 | 2015-05-28T18:26:40.000Z | 2021-09-06T10:07:03.000Z | bluebottle/projects/migrations/0009_merge.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 762 | 2015-01-15T10:00:59.000Z | 2022-03-31T15:35:14.000Z | bluebottle/projects/migrations/0009_merge.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 9 | 2015-02-20T13:19:30.000Z | 2022-03-08T14:09:17.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-10-06 08:39
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0008_fix_project_type'),
('projects', '0008_merge'),
]
operations = [
... | 19.058824 | 47 | 0.648148 | from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0008_fix_project_type'),
('projects', '0008_merge'),
]
operations = [
]
| true | true |
f77051bad026e04df291b9342d6901b1af3569ef | 2,385 | py | Python | utils/memory.py | FerdinandEiteneuer/ReinforcementLearning | 15c75d7f984bd0a8a25b9df822113d8837aa4a93 | [
"MIT"
] | 1 | 2020-12-12T15:27:52.000Z | 2020-12-12T15:27:52.000Z | utils/memory.py | FerdinandEiteneuer/ReinforcementLearning | 15c75d7f984bd0a8a25b9df822113d8837aa4a93 | [
"MIT"
] | null | null | null | utils/memory.py | FerdinandEiteneuer/ReinforcementLearning | 15c75d7f984bd0a8a25b9df822113d8837aa4a93 | [
"MIT"
] | null | null | null | """
Memory
"""
import numpy as np
import os
from utils import export
@export
class NumpyArrayMemory:
"""
Datastructure for all the experiences (states, actions, rewards, next_states)
the agent saw.
"""
def __init__(self, size, input_shape, nb_actions, data_dir):
self.data_dir = data_dir
... | 26.5 | 82 | 0.592872 | import numpy as np
import os
from utils import export
@export
class NumpyArrayMemory:
def __init__(self, size, input_shape, nb_actions, data_dir):
self.data_dir = data_dir
if data_dir is not None:
self.memory_path = os.path.join(data_dir, 'memory.npy')
self.size = size
... | true | true |
f770520528077c23fe8dd3b8fe9d8b3f02ec1800 | 1,735 | py | Python | src/osint_sources/scraper.py | daed5/SpyScrap | 02ddd87436dfa71fc47b6ff72f83a3c7671548e5 | [
"MIT"
] | 45 | 2020-12-02T11:37:39.000Z | 2022-03-25T01:56:58.000Z | src/osint_sources/scraper.py | daed5/SpyScrap | 02ddd87436dfa71fc47b6ff72f83a3c7671548e5 | [
"MIT"
] | 7 | 2020-11-30T17:09:31.000Z | 2022-02-27T10:53:48.000Z | src/osint_sources/scraper.py | daed5/SpyScrap | 02ddd87436dfa71fc47b6ff72f83a3c7671548e5 | [
"MIT"
] | 13 | 2021-03-17T01:43:17.000Z | 2022-02-03T16:30:07.000Z | import csv
from osint_sources.tinder import *
from osint_sources.model import *
from osint_sources.google import *
from osint_sources.twitter import *
from osint_sources.facebook import *
from osint_sources.instagram import *
from osint_sources.boe import *
from osint_sources.yandex import *
def tinder(token):
#sta... | 23.767123 | 68 | 0.756772 | import csv
from osint_sources.tinder import *
from osint_sources.model import *
from osint_sources.google import *
from osint_sources.twitter import *
from osint_sources.facebook import *
from osint_sources.instagram import *
from osint_sources.boe import *
from osint_sources.yandex import *
def tinder(token):
sca... | true | true |
f77052d597f1067e96343720bcbf01ac9f933ed3 | 34,405 | py | Python | plugins/quote/quote.py | JimmyPesto/nio-smith | b4576421661a6decbfc5779bc4e8d51c5297a3ab | [
"Apache-2.0"
] | null | null | null | plugins/quote/quote.py | JimmyPesto/nio-smith | b4576421661a6decbfc5779bc4e8d51c5297a3ab | [
"Apache-2.0"
] | null | null | null | plugins/quote/quote.py | JimmyPesto/nio-smith | b4576421661a6decbfc5779bc4e8d51c5297a3ab | [
"Apache-2.0"
] | null | null | null | from nio import AsyncClient, UnknownEvent
from core.plugin import Plugin
from typing import Dict, List, Tuple
import time
import random
import re
from shlex import split
from sys import maxsize
import logging
logger = logging.getLogger(__name__)
quote_attributes: List[str] = ["user", "members"]
"""valid attributes t... | 35.396091 | 151 | 0.586136 | from nio import AsyncClient, UnknownEvent
from core.plugin import Plugin
from typing import Dict, List, Tuple
import time
import random
import re
from shlex import split
from sys import maxsize
import logging
logger = logging.getLogger(__name__)
quote_attributes: List[str] = ["user", "members"]
current_version: int... | true | true |
f7705390ccbe9f8aaed78be7d96ae8ff79d1b896 | 8,559 | py | Python | mars/deploy/oscar/cmdline.py | ConanoutlooklvTBS/mars | 7030566fd9e9fc02b6b4064ef7bd86f6c24a2f60 | [
"Apache-2.0"
] | 2,413 | 2018-12-06T09:37:11.000Z | 2022-03-30T15:47:39.000Z | mars/deploy/oscar/cmdline.py | ConanoutlooklvTBS/mars | 7030566fd9e9fc02b6b4064ef7bd86f6c24a2f60 | [
"Apache-2.0"
] | 1,335 | 2018-12-07T03:06:18.000Z | 2022-03-31T11:45:57.000Z | mars/deploy/oscar/cmdline.py | ConanoutlooklvTBS/mars | 7030566fd9e9fc02b6b4064ef7bd86f6c24a2f60 | [
"Apache-2.0"
] | 329 | 2018-12-07T03:12:41.000Z | 2022-03-29T21:49:57.000Z | # Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# 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 a... | 37.375546 | 97 | 0.625073 |
import argparse
import asyncio
import faulthandler
import glob
import importlib
import json
import os
import sys
import tempfile
from typing import List
import psutil
from ..utils import load_service_config_file, get_third_party_modules_from_config
_is_windows: bool = sys.platform.startswith('win')
if not _is_wind... | true | true |
f77053df666d6cfee963850d33c130b1501189a8 | 9,947 | py | Python | cwltool/pathmapper.py | wtsi-hgi/cwltool | 6d3e9f0b0f2c4fb78b76eb4270451f29515322f3 | [
"Apache-2.0"
] | 2 | 2017-07-06T13:25:23.000Z | 2017-07-06T13:26:15.000Z | cwltool/pathmapper.py | igormusinov/cwl_parser_python3 | 5b2cd24496c424fbe0923d6b1f715076fab1ca4c | [
"Apache-2.0"
] | 1 | 2018-05-10T06:45:21.000Z | 2018-05-10T06:45:21.000Z | cwltool/pathmapper.py | wtsi-hgi/cwltool | 6d3e9f0b0f2c4fb78b76eb4270451f29515322f3 | [
"Apache-2.0"
] | null | null | null | import collections
import logging
import os
import stat
import uuid
from functools import partial
from typing import Any, Callable, Iterable, Set, Text, Tuple, Union
import schema_salad.validate as validate
from schema_salad.ref_resolver import uri_file_path
from schema_salad.sourceline import SourceLine
from six.move... | 40.108871 | 130 | 0.601287 | import collections
import logging
import os
import stat
import uuid
from functools import partial
from typing import Any, Callable, Iterable, Set, Text, Tuple, Union
import schema_salad.validate as validate
from schema_salad.ref_resolver import uri_file_path
from schema_salad.sourceline import SourceLine
from six.move... | true | true |
f7705480cb24de27b5f99198d8d0cede57181df8 | 806 | py | Python | 17tensorflow/mnist/__init__.py | KEVINYZY/python-tutorial | ae43536908eb8af56c34865f52a6e8644edc4fa3 | [
"Apache-2.0"
] | 2 | 2021-01-04T10:44:44.000Z | 2022-02-13T07:53:41.000Z | 17tensorflow/mnist/__init__.py | zm79287/python-tutorial | d0f7348e1da4ff954e3add66e1aae55d599283ee | [
"Apache-2.0"
] | null | null | null | 17tensorflow/mnist/__init__.py | zm79287/python-tutorial | d0f7348e1da4ff954e3add66e1aae55d599283ee | [
"Apache-2.0"
] | 2 | 2019-02-28T07:53:30.000Z | 2021-07-28T07:11:20.000Z | # -*- coding: utf-8 -*-
# Author: XuMing <shibing624@126.com>
# Data: 17/10/10
# Brief:
import tensorflow as tf
import numpy as np
# 使用 NumPy 生成假数据(phony data), 总共 100 个点.
x_data = np.float32(np.random.rand(2, 100)) # 随机输入
y_data = np.dot([0.100, 0.200], x_data) + 0.300
# 构造一个线性模型
#
b = tf.Variable(tf.zeros([1]))
W ... | 22.388889 | 53 | 0.648883 | import tensorflow as tf
import numpy as np
x_data = np.float32(np.random.rand(2, 100)) y_data = np.dot([0.100, 0.200], x_data) + 0.300
b = tf.Variable(tf.zeros([1]))
W = tf.Variable(tf.random_uniform([1, 2], -1.0, 1.0))
y = tf.matmul(W, x_data) + b
loss = tf.reduce_mean(tf.square(y - y_data))
optimizer = tf.train.Gr... | true | true |
f77056a195269ea9f36df13335fe921988184dcf | 476 | py | Python | EOSS/engineer/urls.py | seakers/daphne_brain | 8bf1ccff4c2cce468721e390aa970fee172ca548 | [
"MIT"
] | null | null | null | EOSS/engineer/urls.py | seakers/daphne_brain | 8bf1ccff4c2cce468721e390aa970fee172ca548 | [
"MIT"
] | 2 | 2019-09-22T19:14:20.000Z | 2020-01-22T20:49:37.000Z | EOSS/engineer/urls.py | seakers/daphne_brain | 8bf1ccff4c2cce468721e390aa970fee172ca548 | [
"MIT"
] | 1 | 2018-03-30T19:34:30.000Z | 2018-03-30T19:34:30.000Z | from django.urls import path
from . import views
urlpatterns = [
path('get-orbit-list', views.GetOrbitList.as_view()),
path('get-instrument-list', views.GetInstrumentList.as_view()),
path('evaluate-architecture', views.EvaluateArchitecture.as_view()),
path('run-local-search', views.RunLocalSearc... | 29.75 | 76 | 0.722689 | from django.urls import path
from . import views
urlpatterns = [
path('get-orbit-list', views.GetOrbitList.as_view()),
path('get-instrument-list', views.GetInstrumentList.as_view()),
path('evaluate-architecture', views.EvaluateArchitecture.as_view()),
path('run-local-search', views.RunLocalSearc... | true | true |
f770589df0a31fcecdb564485195a7980f0d12f9 | 2,251 | py | Python | mtsoo_noisy/tasks.py | thanhbok26b/mtsoo-noisy | 9b36d75e5be3d0e0fd05f95137c37550d89f40b5 | [
"MIT"
] | null | null | null | mtsoo_noisy/tasks.py | thanhbok26b/mtsoo-noisy | 9b36d75e5be3d0e0fd05f95137c37550d89f40b5 | [
"MIT"
] | null | null | null | mtsoo_noisy/tasks.py | thanhbok26b/mtsoo-noisy | 9b36d75e5be3d0e0fd05f95137c37550d89f40b5 | [
"MIT"
] | null | null | null | from .functions import *
from scipy.io import loadmat
import os
DIRNAME = os.path.dirname(__file__)
class CI_HS:
def __init__(self):
mat = loadmat(os.path.join(DIRNAME, 'data/CI_H.mat'))
self.M1 = mat['Rotation_Task1']
self.M2 = mat['Rotation_Task2']
self.functions = [self.f1, sel... | 27.45122 | 76 | 0.581519 | from .functions import *
from scipy.io import loadmat
import os
DIRNAME = os.path.dirname(__file__)
class CI_HS:
def __init__(self):
mat = loadmat(os.path.join(DIRNAME, 'data/CI_H.mat'))
self.M1 = mat['Rotation_Task1']
self.M2 = mat['Rotation_Task2']
self.functions = [self.f1, sel... | true | true |
f7705928335fc012596490c26a1062ed96d1a44e | 11,010 | py | Python | src/sage/schemes/elliptic_curves/modular_parametrization.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | 5 | 2015-01-04T07:15:06.000Z | 2022-03-04T15:15:18.000Z | src/sage/schemes/elliptic_curves/modular_parametrization.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | null | null | null | src/sage/schemes/elliptic_curves/modular_parametrization.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | 10 | 2016-09-28T13:12:40.000Z | 2022-02-12T09:28:34.000Z | # -*- coding: utf-8 -*-
r"""
Modular parametrization of elliptic curves over `\QQ`
By the work of Taylor--Wiles et al. it is known that there
is a surjective morphism
.. math::
\phi_E: X_0(N) \rightarrow E.
from the modular curve `X_0(N)`, where `N` is the conductor of `E`.
The map sends the cusp `\infty` to th... | 38.631579 | 226 | 0.567302 | r"""
Modular parametrization of elliptic curves over `\QQ`
By the work of Taylor--Wiles et al. it is known that there
is a surjective morphism
.. math::
\phi_E: X_0(N) \rightarrow E.
from the modular curve `X_0(N)`, where `N` is the conductor of `E`.
The map sends the cusp `\infty` to the origin of `E`.
EXMAPL... | false | true |
f7705948fa6f00a8e37e2d6d09e4c5f5865a6693 | 852 | py | Python | install.py | anthrotype/dialogKit | f63226001359bf9044f92c7f87fb3eccc35d9e9e | [
"MIT"
] | 21 | 2015-01-16T05:10:02.000Z | 2021-06-11T20:48:15.000Z | install.py | anthrotype/dialogKit | f63226001359bf9044f92c7f87fb3eccc35d9e9e | [
"MIT"
] | 1 | 2019-09-09T12:10:27.000Z | 2020-05-22T10:12:14.000Z | install.py | anthrotype/dialogKit | f63226001359bf9044f92c7f87fb3eccc35d9e9e | [
"MIT"
] | 3 | 2015-05-07T19:35:50.000Z | 2016-01-14T02:31:53.000Z | """Install script for the dialogKit Package.
This script installs a _link_ to the current location
of dialogKit. It does not copy anything. It also means that
if you move your dialogKit folder, you'll have to run the
install script again.
"""
from distutils.sysconfig import get_python_lib
import os, sys
def instal... | 29.37931 | 94 | 0.742958 | """Install script for the dialogKit Package.
This script installs a _link_ to the current location
of dialogKit. It does not copy anything. It also means that
if you move your dialogKit folder, you'll have to run the
install script again.
"""
from distutils.sysconfig import get_python_lib
import os, sys
def instal... | false | true |
f770595a6f8d98dbab79790ddd9945bb574f54de | 1,248 | py | Python | pysimplegui/DemoPrograms/Demo_Button_Click.py | konsan1101/py-etc | bcca13119b0d2453866988404fd1c4976f55d4d5 | [
"MIT"
] | null | null | null | pysimplegui/DemoPrograms/Demo_Button_Click.py | konsan1101/py-etc | bcca13119b0d2453866988404fd1c4976f55d4d5 | [
"MIT"
] | 2 | 2020-06-06T00:30:56.000Z | 2021-06-10T22:30:37.000Z | pysimplegui/DemoPrograms/Demo_Button_Click.py | konsan1101/py-etc | bcca13119b0d2453866988404fd1c4976f55d4d5 | [
"MIT"
] | null | null | null | import PySimpleGUI as sg
from random import randint
sg.theme('Dark Blue 3')
layout = [ [sg.Text('Temperature'), sg.T(' '*30), sg.Text(size=(8,1), key='-TEMP OUT-')],
[sg.Text('Set Temp'), sg.T(' '*8), sg.Input(size=(8,1), key='-IN-'), sg.T(' '*10), sg.Button('Set')],
[sg.Button('Off'), sg.T('... | 39 | 137 | 0.58734 | import PySimpleGUI as sg
from random import randint
sg.theme('Dark Blue 3')
layout = [ [sg.Text('Temperature'), sg.T(' '*30), sg.Text(size=(8,1), key='-TEMP OUT-')],
[sg.Text('Set Temp'), sg.T(' '*8), sg.Input(size=(8,1), key='-IN-'), sg.T(' '*10), sg.Button('Set')],
[sg.Button('Off'), sg.T('... | true | true |
f77059cb080b4b03eb471a6f55e3c5921fb12415 | 19,820 | py | Python | dfttopif/parsers/pwscf.py | lancekavalsky/pif-dft | 8bb4047d7c5b7e2ee7dfee8ed4b8dd45e7943bde | [
"Apache-2.0"
] | 5 | 2017-03-06T19:05:09.000Z | 2018-10-22T16:56:04.000Z | dfttopif/parsers/pwscf.py | aced-differentiate/pif-dft | 8bb4047d7c5b7e2ee7dfee8ed4b8dd45e7943bde | [
"Apache-2.0"
] | 22 | 2017-02-01T03:38:44.000Z | 2019-10-04T14:17:31.000Z | dfttopif/parsers/pwscf.py | aced-differentiate/pif-dft | 8bb4047d7c5b7e2ee7dfee8ed4b8dd45e7943bde | [
"Apache-2.0"
] | 10 | 2017-02-01T03:37:21.000Z | 2020-04-22T20:34:19.000Z | from pypif.obj.common import Property, Scalar
from .base import DFTParser, Value_if_true, InvalidIngesterException
import os
from pypif.obj.common.value import Value
from dftparse.pwscf.stdout_parser import PwscfStdOutputParser
from ase import Atoms
class PwscfParser(DFTParser):
'''
Parser for PWSCF calculat... | 44.539326 | 147 | 0.543037 | from pypif.obj.common import Property, Scalar
from .base import DFTParser, Value_if_true, InvalidIngesterException
import os
from pypif.obj.common.value import Value
from dftparse.pwscf.stdout_parser import PwscfStdOutputParser
from ase import Atoms
class PwscfParser(DFTParser):
def __init__(self, files):
... | true | true |
f7705ab3c5468bc0a6ebed07d9d837b34c75fd3b | 1,215 | py | Python | src/epnmAPI.py | yasgari/Project_Federate | a8dcf07eb0a88cc8df70e05c8f701990492c7e2c | [
"RSA-MD"
] | 1 | 2021-12-08T06:18:20.000Z | 2021-12-08T06:18:20.000Z | src/epnmAPI.py | yasgari/Project_Federate | a8dcf07eb0a88cc8df70e05c8f701990492c7e2c | [
"RSA-MD"
] | null | null | null | src/epnmAPI.py | yasgari/Project_Federate | a8dcf07eb0a88cc8df70e05c8f701990492c7e2c | [
"RSA-MD"
] | 1 | 2021-12-08T06:18:27.000Z | 2021-12-08T06:18:27.000Z | #!/usr/bin/env python3
import requests
from requests.auth import HTTPBasicAuth
import urllib3
import json
import pprint
##########
# SET-UP #
##########
urllib3.disable_warnings()
#############
# FUNCTIONS #
#############
def get_Epnm_Events(epnm):
#retrieve epnm events with epnm api
base_uri = 'https://' +... | 28.928571 | 106 | 0.668313 | import requests
from requests.auth import HTTPBasicAuth
import urllib3
import json
import pprint
urllib3.disable_warnings()
def get_Epnm_Events(epnm):
base_uri = 'https://' + epnm['epnm_host']
user = epnm['epnm_username']
password = epnm['epnm_password']
rest_path = '/webacs/api/v4/data/Even... | true | true |
f7705b5a3258c39d7c773e28f7ff84bcb1cc80ae | 14,076 | py | Python | python/ccxt/async_support/exx.py | ZacharyATanenbaum/ccxt | 539a9e83dd2ca6a547103fd5910e0e776af5a48a | [
"MIT"
] | 2 | 2020-02-25T22:50:00.000Z | 2020-09-11T00:24:45.000Z | python/ccxt/async_support/exx.py | ZacharyATanenbaum/ccxt | 539a9e83dd2ca6a547103fd5910e0e776af5a48a | [
"MIT"
] | null | null | null | python/ccxt/async_support/exx.py | ZacharyATanenbaum/ccxt | 539a9e83dd2ca6a547103fd5910e0e776af5a48a | [
"MIT"
] | 1 | 2022-01-08T07:30:48.000Z | 2022-01-08T07:30:48.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
# -----------------------------------------------------------------------------
try... | 35.545455 | 126 | 0.463129 |
from ccxt.async_support.base.exchange import Exchange
try:
basestring except NameError:
basestring = str import hashlib
import math
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import ExchangeNotAvailable
class exx (Exchang... | true | true |
f7705c424c3aceb57479431b597a4f4b61c4be06 | 1,337 | py | Python | ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/hook.py | panfeiyy/ambari | 24077510723ede93d3024784f0b04422adaf56d6 | [
"Apache-2.0"
] | 16 | 2018-05-24T10:28:24.000Z | 2021-08-05T03:13:26.000Z | ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/hook.py | panfeiyy/ambari | 24077510723ede93d3024784f0b04422adaf56d6 | [
"Apache-2.0"
] | 3 | 2021-05-09T12:37:16.000Z | 2022-03-02T10:13:24.000Z | ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/hook.py | panfeiyy/ambari | 24077510723ede93d3024784f0b04422adaf56d6 | [
"Apache-2.0"
] | 17 | 2018-07-06T08:57:00.000Z | 2021-11-04T11:00:36.000Z | """
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | 32.609756 | 118 | 0.793568 |
import sys
from resource_management import *
from rack_awareness import create_topology_script_and_mapping
from shared_initialization import setup_hadoop, setup_configs, create_javahome_symlink, setup_unlimited_key_jce_policy
class BeforeStartHook(Hook):
def hook(self, env):
import params
self.run_custom_... | true | true |
f7705c8176861e1a6ded4a08578189b365e8b853 | 2,454 | py | Python | scripts/token/select_sentences_batch.py | wangqi1996/few-shot | ec4bc9f05f6b8a662e82986d70f598d3e2e9e39a | [
"MIT"
] | null | null | null | scripts/token/select_sentences_batch.py | wangqi1996/few-shot | ec4bc9f05f6b8a662e82986d70f598d3e2e9e39a | [
"MIT"
] | null | null | null | scripts/token/select_sentences_batch.py | wangqi1996/few-shot | ec4bc9f05f6b8a662e82986d70f598d3e2e9e39a | [
"MIT"
] | null | null | null | import os.path
import random
from scripts.token.read_freq_batch import read_tokens
def select_sentences(select_tokens, src_filename, tgt_filename, hint='', copy_num=1, random_select=0):
filter_src, filter_tgt = [], []
non_select_src, non_select_tgt = [], []
with open(src_filename) as f_src, open(tgt_file... | 33.616438 | 102 | 0.612877 | import os.path
import random
from scripts.token.read_freq_batch import read_tokens
def select_sentences(select_tokens, src_filename, tgt_filename, hint='', copy_num=1, random_select=0):
filter_src, filter_tgt = [], []
non_select_src, non_select_tgt = [], []
with open(src_filename) as f_src, open(tgt_file... | true | true |
f7705cfb75f6ab0adee177ed7493cc4acc49bf76 | 274 | py | Python | metadeploy/api/migrations/0023_merge_20181203_1618.py | sfdc-qbranch/MetaDeploy | d22547b3814dbec6aefa4d86b9f81c6f175c1b67 | [
"BSD-3-Clause"
] | 33 | 2019-03-20T15:34:39.000Z | 2022-03-30T15:59:40.000Z | metadeploy/api/migrations/0023_merge_20181203_1618.py | sfdc-qbranch/MetaDeploy | d22547b3814dbec6aefa4d86b9f81c6f175c1b67 | [
"BSD-3-Clause"
] | 2,718 | 2019-02-27T19:46:07.000Z | 2022-03-11T23:18:09.000Z | metadeploy/api/migrations/0023_merge_20181203_1618.py | sfdc-qbranch/MetaDeploy | d22547b3814dbec6aefa4d86b9f81c6f175c1b67 | [
"BSD-3-Clause"
] | 28 | 2019-03-28T04:57:16.000Z | 2022-02-04T16:49:25.000Z | # Generated by Django 2.1.3 on 2018-12-03 16:18
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("api", "0022_change_default_on_results"),
("api", "0021_plan_post_install_message"),
]
operations = []
| 19.571429 | 50 | 0.667883 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("api", "0022_change_default_on_results"),
("api", "0021_plan_post_install_message"),
]
operations = []
| true | true |
f7705d2011c33cd5fb8d9f8fbec8d0dd874bd45c | 1,617 | py | Python | users/migrations/0008_tcn_rx_tcn_tx.py | xue-yuan/covidwatch-api-service | 4e5982e6a3e9812ee4cf9865eb37ffe6e2826152 | [
"MIT"
] | null | null | null | users/migrations/0008_tcn_rx_tcn_tx.py | xue-yuan/covidwatch-api-service | 4e5982e6a3e9812ee4cf9865eb37ffe6e2826152 | [
"MIT"
] | null | null | null | users/migrations/0008_tcn_rx_tcn_tx.py | xue-yuan/covidwatch-api-service | 4e5982e6a3e9812ee4cf9865eb37ffe6e2826152 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.8 on 2020-07-18 04:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0007_auto_20200717_2347'),
]
operations = [
migrations.CreateModel(
name='TCN_RX',
fields=[
... | 38.5 | 114 | 0.545455 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0007_auto_20200717_2347'),
]
operations = [
migrations.CreateModel(
name='TCN_RX',
fields=[
('id', models.AutoField(auto_created=True, prim... | true | true |
f7705dd00c3beb7d0a89e94dbe43a26cefe8d327 | 22,445 | py | Python | pandas/core/internals/concat.py | joybhallaa/pandas | 1779155552631a30d4bb176dec70b8cc477defd7 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-02-12T08:12:40.000Z | 2021-02-12T08:12:40.000Z | pandas/core/internals/concat.py | joybhallaa/pandas | 1779155552631a30d4bb176dec70b8cc477defd7 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/core/internals/concat.py | joybhallaa/pandas | 1779155552631a30d4bb176dec70b8cc477defd7 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | from __future__ import annotations
from collections import defaultdict
import copy
import itertools
from typing import TYPE_CHECKING, Dict, List, Sequence, cast
import numpy as np
from pandas._libs import internals as libinternals
from pandas._typing import ArrayLike, DtypeObj, Manager, Shape
from pandas.util._decor... | 34.744582 | 88 | 0.604233 | from __future__ import annotations
from collections import defaultdict
import copy
import itertools
from typing import TYPE_CHECKING, Dict, List, Sequence, cast
import numpy as np
from pandas._libs import internals as libinternals
from pandas._typing import ArrayLike, DtypeObj, Manager, Shape
from pandas.util._decor... | true | true |
f7705de8455943e8d70eb5e1353ed156edb31e77 | 19 | py | Python | tests/__init__.py | LowerSilesians/geo-squizzy | 8fff2df9e158c4063ef93d58f60f84e90ad44edd | [
"MIT"
] | 3 | 2016-02-25T07:59:24.000Z | 2016-03-11T12:33:48.000Z | __init__.py | LowerSilesians/geo-geschenk | aee75d9a3d5fc6653a5c918530ab3ddfa0723926 | [
"MIT"
] | 2 | 2016-03-09T12:23:42.000Z | 2016-03-09T21:21:47.000Z | __init__.py | LowerSilesians/geo-geschenk | aee75d9a3d5fc6653a5c918530ab3ddfa0723926 | [
"MIT"
] | null | null | null | __author__ = 'ing'
| 9.5 | 18 | 0.684211 | __author__ = 'ing'
| true | true |
f7705e3cc1b211d4663b54c4da3c65f968c2a26c | 135 | py | Python | zoo/__init__.py | uliana291/the-zoo | a15a4162c39553abe91224f4feff5d3b66f9413e | [
"MIT"
] | 90 | 2018-11-20T10:58:24.000Z | 2022-02-19T16:12:46.000Z | zoo/__init__.py | uliana291/the-zoo | a15a4162c39553abe91224f4feff5d3b66f9413e | [
"MIT"
] | 348 | 2018-11-21T09:22:31.000Z | 2021-11-03T13:45:08.000Z | zoo/__init__.py | aexvir/the-zoo | 7816afb9a0a26c6058b030b4a987c73e952d92bd | [
"MIT"
] | 11 | 2018-12-08T18:42:07.000Z | 2021-02-21T06:27:58.000Z | from ddtrace import patch_all
from .base.celery import app as celery_app
from .base.wsgi import application
patch_all(requests=True)
| 19.285714 | 42 | 0.822222 | from ddtrace import patch_all
from .base.celery import app as celery_app
from .base.wsgi import application
patch_all(requests=True)
| true | true |
f7705e3f9adedf9f14081d1c7e29d45ea31459b3 | 2,813 | py | Python | shop/views.py | charles-co/rad-shop | d46eb7e10f11b2b548e2b9f8dcdd4c4282ed8ab7 | [
"MIT"
] | 2 | 2020-12-11T20:50:10.000Z | 2021-01-08T15:26:24.000Z | shop/views.py | charles-co/rad-shop | d46eb7e10f11b2b548e2b9f8dcdd4c4282ed8ab7 | [
"MIT"
] | null | null | null | shop/views.py | charles-co/rad-shop | d46eb7e10f11b2b548e2b9f8dcdd4c4282ed8ab7 | [
"MIT"
] | null | null | null | # Create your views here.
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import QuerySet
from django.http import HttpResponse, JsonResponse, Http404, HttpResponse
from django.shortcuts import render
from django.utils.decorators import method_decorator
from django.views.decorators.csrf impor... | 38.534247 | 117 | 0.683256 | from django.core.exceptions import ObjectDoesNotExist
from django.db.models import QuerySet
from django.http import HttpResponse, JsonResponse, Http404, HttpResponse
from django.shortcuts import render
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from django.... | true | true |
f7705e601dd4bb09808402f095b54e8a8503c526 | 1,336 | py | Python | buck/stack/services/s3/service_session/abc.py | tombulled/python-buck | 1b3f6d0951d48b9b71227a630c0a26fe5c7e2cf5 | [
"MIT"
] | null | null | null | buck/stack/services/s3/service_session/abc.py | tombulled/python-buck | 1b3f6d0951d48b9b71227a630c0a26fe5c7e2cf5 | [
"MIT"
] | null | null | null | buck/stack/services/s3/service_session/abc.py | tombulled/python-buck | 1b3f6d0951d48b9b71227a630c0a26fe5c7e2cf5 | [
"MIT"
] | null | null | null | from .... import service_session
from .... import exceptions
import abc
def generator(iterable):
for item in iterable:
yield item
class SimpleStorageServiceSession(service_session.StackServiceSession, abc.ABC):
@abc.abstractmethod
def list_buckets(self, **kwargs):
return generator(())
... | 26.72 | 90 | 0.672904 | from .... import service_session
from .... import exceptions
import abc
def generator(iterable):
for item in iterable:
yield item
class SimpleStorageServiceSession(service_session.StackServiceSession, abc.ABC):
@abc.abstractmethod
def list_buckets(self, **kwargs):
return generator(())
... | true | true |
f7705f2125867a7bad15ed38a2421cc5af091524 | 504 | py | Python | AI-Docker/src/test_cos.py | geobeyond/AI-GEO | df487549dc5944d99e18df6a5420796be6a63569 | [
"Apache-2.0"
] | null | null | null | AI-Docker/src/test_cos.py | geobeyond/AI-GEO | df487549dc5944d99e18df6a5420796be6a63569 | [
"Apache-2.0"
] | null | null | null | AI-Docker/src/test_cos.py | geobeyond/AI-GEO | df487549dc5944d99e18df6a5420796be6a63569 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3.7
from logging import DEBUG
from ai.lib.map_envi_cos.Envi import Envi
from ai.COS import COS
from logger import logger
log = logger.getLogger('test')
log.setLevel(DEBUG)
cos = COS('./cos_credentials', './recipe-test.json', logger)
envi = Envi('./recipe-test.json', cos.resource, logger)
log.... | 21.913043 | 60 | 0.740079 | from logging import DEBUG
from ai.lib.map_envi_cos.Envi import Envi
from ai.COS import COS
from logger import logger
log = logger.getLogger('test')
log.setLevel(DEBUG)
cos = COS('./cos_credentials', './recipe-test.json', logger)
envi = Envi('./recipe-test.json', cos.resource, logger)
log.info("cache_cos satrt ")
... | true | true |
f7705fbaa78f6d62611e9b57a96a7c2e7eb79b23 | 732 | py | Python | scripts/combine.py | Lioscro/biorxiv-title-bot | 898b8a791c4addc10b6053b5f16575811ceca5d1 | [
"MIT"
] | null | null | null | scripts/combine.py | Lioscro/biorxiv-title-bot | 898b8a791c4addc10b6053b5f16575811ceca5d1 | [
"MIT"
] | null | null | null | scripts/combine.py | Lioscro/biorxiv-title-bot | 898b8a791c4addc10b6053b5f16575811ceca5d1 | [
"MIT"
] | null | null | null | import glob
import json
import os
from tqdm import tqdm
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('out_dir')
args = parser.parse_args()
out_dir = args.out_dir
papers = {}
for path in tqdm(sorted(glob.glob(os.path.join(out_dir, '_*.js... | 26.142857 | 74 | 0.571038 | import glob
import json
import os
from tqdm import tqdm
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('out_dir')
args = parser.parse_args()
out_dir = args.out_dir
papers = {}
for path in tqdm(sorted(glob.glob(os.path.join(out_dir, '_*.js... | true | true |
f7705fbf697feddbe996a7576d6648e198690e41 | 2,529 | py | Python | main (1).py | hilmyalbar/Barista-Bot | f4a63b1c29ccca6b9e8b450c13185a18181cc383 | [
"MIT"
] | null | null | null | main (1).py | hilmyalbar/Barista-Bot | f4a63b1c29ccca6b9e8b450c13185a18181cc383 | [
"MIT"
] | null | null | null | main (1).py | hilmyalbar/Barista-Bot | f4a63b1c29ccca6b9e8b450c13185a18181cc383 | [
"MIT"
] | null | null | null | print('hello!! welcome to albar coffe shop!!')
name = input('what is your name? ')
order = input('okay '+name+', we are serving some tea, cappucino, espresso, and coffe\nwhat do you want order for today? ')
if order == "tea":
quantity = input('how much '+order+' do you want? (number) ')
total = int(quantity)*2000
... | 36.128571 | 123 | 0.596679 | print('hello!! welcome to albar coffe shop!!')
name = input('what is your name? ')
order = input('okay '+name+', we are serving some tea, cappucino, espresso, and coffe\nwhat do you want order for today? ')
if order == "tea":
quantity = input('how much '+order+' do you want? (number) ')
total = int(quantity)*2000
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.