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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f735b84c5f4f7ab12673110257de977b99be7f9f | 1,280 | py | Python | programmers/lv2_review/lv_2_19.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | programmers/lv2_review/lv_2_19.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | programmers/lv2_review/lv_2_19.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | # 위장
"""
def solution(clothes):
def dfs_left(s, idx):
if idx == half:
left.append(s)
return
dfs_left(s, idx + 1)
dfs_left(s * values[idx], idx + 1)
def dfs_right(s, idx):
if idx == len(values):
right.append(s)
return
dfs_... | 20.645161 | 50 | 0.508594 |
def solution(clothes):
categories = {}
for _, c in clothes:
if c not in categories:
categories[c] = 2
else:
categories[c] += 1
cnt = 1
values = list(categories.values())
for i in range(len(values)):
cnt *= values[i]
cnt -= 1
return cnt
... | true | true |
f735b8c878d53733e89af5109438eaed85f247f8 | 3,668 | py | Python | pyFAI/utils/logging_utils.py | yugangzhang/pyFAI | e0453b279dac1f165f637e2a2ed1d4ddf57d31ba | [
"MIT"
] | 1 | 2021-04-28T20:09:13.000Z | 2021-04-28T20:09:13.000Z | pyFAI/utils/logging_utils.py | yugangzhang/pyFAI | e0453b279dac1f165f637e2a2ed1d4ddf57d31ba | [
"MIT"
] | null | null | null | pyFAI/utils/logging_utils.py | yugangzhang/pyFAI | e0453b279dac1f165f637e2a2ed1d4ddf57d31ba | [
"MIT"
] | null | null | null | # !/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Project: Azimuthal integration
# https://github.com/silx-kit/pyFAI
#
# Copyright (C) 2019 European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
#
# Permission is hereby granted... | 33.651376 | 84 | 0.724918 |
from __future__ import division, print_function
__author__ = "Valentin Valls"
__contact__ = "valentin.valls@esrf.eu"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__date__ = "25/02/2019"
import logging
import contextlib
class PrePostEmi... | true | true |
f735b8da17d0e01f03e8d45e3b111c70242b92d1 | 89 | py | Python | drivers/apps.py | loribonna/EsameLDPython | 02f671d0813e4e3cfed5a977018ab295b8675d60 | [
"MIT"
] | 1 | 2021-03-11T04:48:21.000Z | 2021-03-11T04:48:21.000Z | drivers/apps.py | loribonna/EsameLDPython | 02f671d0813e4e3cfed5a977018ab295b8675d60 | [
"MIT"
] | 18 | 2019-08-29T12:42:11.000Z | 2022-02-12T13:04:58.000Z | drivers/apps.py | loribonna/EsameLDPython | 02f671d0813e4e3cfed5a977018ab295b8675d60 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class DriversConfig(AppConfig):
name = 'drivers'
| 14.833333 | 33 | 0.752809 | from django.apps import AppConfig
class DriversConfig(AppConfig):
name = 'drivers'
| true | true |
f735b9971416c7293b52ba2809611609a9c22da8 | 133 | py | Python | app/task/__init__.py | Darasimi-Ajewole/PdfConv | c19d84c549a0ff7183e0338fbe6fcdf1ff2420a9 | [
"MIT"
] | 3 | 2019-09-01T18:55:50.000Z | 2022-01-12T22:38:44.000Z | app/task/__init__.py | Darasimi-Ajewole/PdfConv | c19d84c549a0ff7183e0338fbe6fcdf1ff2420a9 | [
"MIT"
] | 9 | 2020-02-12T00:21:55.000Z | 2021-09-03T22:52:24.000Z | app/task/__init__.py | Darasimi-Ajewole/PdfConv | c19d84c549a0ff7183e0338fbe6fcdf1ff2420a9 | [
"MIT"
] | null | null | null | from flask_restx import Namespace
task_api = Namespace(
'task',
description='Internal APIs for background task processing')
| 22.166667 | 63 | 0.759398 | from flask_restx import Namespace
task_api = Namespace(
'task',
description='Internal APIs for background task processing')
| true | true |
f735b9e82a29b0bb1f4c955b4280cff1a8e38ecd | 1,386 | py | Python | neutron/extensions/subnetallocation.py | BobzhouCH/neutron-nfv-acc | 05ab9d2079f2b652a4df771c1d6d9ce3b822aaa0 | [
"Apache-2.0"
] | 1 | 2016-03-25T21:13:13.000Z | 2016-03-25T21:13:13.000Z | neutron/extensions/subnetallocation.py | BobzhouCH/neutron-nfv-acc | 05ab9d2079f2b652a4df771c1d6d9ce3b822aaa0 | [
"Apache-2.0"
] | 1 | 2021-03-21T11:39:22.000Z | 2021-03-21T11:39:22.000Z | neutron/extensions/subnetallocation.py | BobzhouCH/neutron-nfv-acc | 05ab9d2079f2b652a4df771c1d6d9ce3b822aaa0 | [
"Apache-2.0"
] | 1 | 2021-03-21T11:37:18.000Z | 2021-03-21T11:37:18.000Z | # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | 30.130435 | 78 | 0.704906 |
from neutron.api import extensions
from neutron.common import constants
class Subnetallocation(extensions.ExtensionDescriptor):
@classmethod
def get_name(cls):
return "Subnet Allocation"
@classmethod
def get_alias(cls):
return constants.SUBNET_ALLOCATION_EXT_ALIAS
... | true | true |
f735b9ec063ea54e221a7beeb79cbfe540054145 | 640 | py | Python | project/adapter/models.py | vicinityh2020/vicinity-vas-energy-monitoring | 1ffb51868abcc1b5b52ef27a056ba278cd0f7f65 | [
"MIT"
] | null | null | null | project/adapter/models.py | vicinityh2020/vicinity-vas-energy-monitoring | 1ffb51868abcc1b5b52ef27a056ba278cd0f7f65 | [
"MIT"
] | 3 | 2020-06-05T19:06:48.000Z | 2021-06-10T20:58:13.000Z | project/adapter/models.py | vicinityh2020/vicinity-vas-energy-monitoring | 1ffb51868abcc1b5b52ef27a056ba278cd0f7f65 | [
"MIT"
] | null | null | null | from django.db import models
class Appliance(models.Model):
name = models.CharField(max_length=100, null=False)
oid = models.UUIDField(unique=True)
pid = models.CharField(max_length=50)
appliance_type = models.CharField(max_length=30)
def __str__(self):
return self.name
class Sensor(mod... | 27.826087 | 87 | 0.692188 | from django.db import models
class Appliance(models.Model):
name = models.CharField(max_length=100, null=False)
oid = models.UUIDField(unique=True)
pid = models.CharField(max_length=50)
appliance_type = models.CharField(max_length=30)
def __str__(self):
return self.name
class Sensor(mod... | true | true |
f735bb1bf8e966d1381c9f54b56aa8880934fa90 | 735 | py | Python | tests/test_battery.py | bexxmodd/vizex | c7be2bc7fcc98c43457248fb13748c43fc49392d | [
"MIT"
] | 195 | 2020-09-05T17:33:18.000Z | 2022-03-20T11:42:22.000Z | tests/test_battery.py | bexxmodd/vizex | c7be2bc7fcc98c43457248fb13748c43fc49392d | [
"MIT"
] | 23 | 2020-09-14T12:10:14.000Z | 2022-03-25T07:49:08.000Z | tests/test_battery.py | bexxmodd/vizex | c7be2bc7fcc98c43457248fb13748c43fc49392d | [
"MIT"
] | 16 | 2020-09-15T18:03:51.000Z | 2022-02-02T17:02:25.000Z | # add path to the main package and test battery.py
if __name__ == '__main__':
from __access import ADD_PATH
ADD_PATH()
import unittest
import psutil
from battery import Battery
class TestBattery(unittest.TestCase):
""" Test battry module """
def test_Battery_constructor(self):
if not (has_b... | 24.5 | 76 | 0.64898 |
if __name__ == '__main__':
from __access import ADD_PATH
ADD_PATH()
import unittest
import psutil
from battery import Battery
class TestBattery(unittest.TestCase):
def test_Battery_constructor(self):
if not (has_battery := psutil.sensors_battery()):
with self.assertRaises(Exception... | true | true |
f735bb779c324b1d4bece56bb0a8b5f13cd9cd30 | 2,311 | py | Python | epytope/Data/pssms/smmpmbec/mat/A_01_01_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 7 | 2021-02-01T18:11:28.000Z | 2022-01-31T19:14:07.000Z | epytope/Data/pssms/smmpmbec/mat/A_01_01_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 22 | 2021-01-02T15:25:23.000Z | 2022-03-14T11:32:53.000Z | epytope/Data/pssms/smmpmbec/mat/A_01_01_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 4 | 2021-05-28T08:50:38.000Z | 2022-03-14T11:45:32.000Z | A_01_01_9 = {0: {'A': 0.202, 'C': -0.151, 'E': 0.177, 'D': 0.207, 'G': 0.239, 'F': -0.334, 'I': 0.083, 'H': -0.029, 'K': 0.205, 'M': -0.211, 'L': -0.218, 'N': -0.065, 'Q': 0.071, 'P': 0.066, 'S': 0.162, 'R': 0.23, 'T': 0.071, 'W': -0.317, 'V': -0.036, 'Y': -0.353}, 1: {'A': -0.302, 'C': 0.137, 'E': 0.387, 'D': 0.126, '... | 2,311 | 2,311 | 0.394202 | A_01_01_9 = {0: {'A': 0.202, 'C': -0.151, 'E': 0.177, 'D': 0.207, 'G': 0.239, 'F': -0.334, 'I': 0.083, 'H': -0.029, 'K': 0.205, 'M': -0.211, 'L': -0.218, 'N': -0.065, 'Q': 0.071, 'P': 0.066, 'S': 0.162, 'R': 0.23, 'T': 0.071, 'W': -0.317, 'V': -0.036, 'Y': -0.353}, 1: {'A': -0.302, 'C': 0.137, 'E': 0.387, 'D': 0.126, '... | true | true |
f735bc19fe5b97a9a42d0e2c6be1f0fdfde91374 | 2,204 | py | Python | clue-nrf52/apds9960-testing/v2/clue-testing/config_regs_apds.py | fivesixzero/circuitpython-experiments | d1ddb79357aa7c8ed06c783403dafa59b3e4fe58 | [
"MIT"
] | 3 | 2021-11-12T01:37:54.000Z | 2021-12-19T23:43:44.000Z | clue-nrf52/apds9960-testing/v2/clue-testing/config_regs_apds.py | fivesixzero/circuitpython-experiments | d1ddb79357aa7c8ed06c783403dafa59b3e4fe58 | [
"MIT"
] | null | null | null | clue-nrf52/apds9960-testing/v2/clue-testing/config_regs_apds.py | fivesixzero/circuitpython-experiments | d1ddb79357aa7c8ed06c783403dafa59b3e4fe58 | [
"MIT"
] | null | null | null | from adafruit_bus_device.i2c_device import I2CDevice
from adafruit_apds9960.apds9960 import APDS9960
try:
# Only used for typing
from typing import Dict
except ImportError:
pass
class ConfigRegsAPDS:
def __init__(self, *, apds: APDS9960=None, i2c_bus=None):
if not apds:
if not i2c... | 32.411765 | 114 | 0.602995 | from adafruit_bus_device.i2c_device import I2CDevice
from adafruit_apds9960.apds9960 import APDS9960
try:
from typing import Dict
except ImportError:
pass
class ConfigRegsAPDS:
def __init__(self, *, apds: APDS9960=None, i2c_bus=None):
if not apds:
if not i2c_bus:
... | true | true |
f735bc49387622b0b3605fd0ea721fdc2eb10832 | 9,127 | py | Python | src/main.py | thuongton999/flappy-peter-teo | 0b4c91670a98bef5128400f98cbf1e06a10e0b02 | [
"MIT"
] | 4 | 2021-09-12T07:22:16.000Z | 2022-02-14T10:03:46.000Z | src/main.py | thuongton999/flappy-peter-teo | 0b4c91670a98bef5128400f98cbf1e06a10e0b02 | [
"MIT"
] | null | null | null | src/main.py | thuongton999/flappy-peter-teo | 0b4c91670a98bef5128400f98cbf1e06a10e0b02 | [
"MIT"
] | null | null | null | # Flappy Bird made by Thuongton999
# Ez-ist mode
from settings import *
from objects import *
def birdCollision(bird, column):
return (
bird.positionX < column.positionX + column.WIDTH and
bird.positionX + bird.WIDTH > column.positionX and
bird.positionY < column.positionY + colu... | 39.855895 | 137 | 0.617728 |
from settings import *
from objects import *
def birdCollision(bird, column):
return (
bird.positionX < column.positionX + column.WIDTH and
bird.positionX + bird.WIDTH > column.positionX and
bird.positionY < column.positionY + column.HEIGHT and
bird.positionY + bird.HEI... | true | true |
f735bd31e6bc4abf4872889f80575cdf0932bcac | 2,043 | py | Python | src/AngleMeasurement/RP1DClustering.py | paigeco/VirtualGoniometer | 536e7e77fbb036ad8d777b42e751a0f3e80b8242 | [
"CC0-1.0"
] | 1 | 2021-02-22T02:53:26.000Z | 2021-02-22T02:53:26.000Z | src/AngleMeasurement/RP1DClustering.py | paigeco/VirtualGoniometer | 536e7e77fbb036ad8d777b42e751a0f3e80b8242 | [
"CC0-1.0"
] | 5 | 2021-03-26T15:15:34.000Z | 2021-06-11T20:16:00.000Z | src/AngleMeasurement/RP1DClustering.py | paigeco/VirtualGoniometer | 536e7e77fbb036ad8d777b42e751a0f3e80b8242 | [
"CC0-1.0"
] | null | null | null | import numpy as np
from .PCASmallestEig import pca_smallest_eig, pca_smallest_eig_powermethod
from .Withness import withness
from .CalculateAngle import get_angle
#RP1D clustering from
#Han, Sangchun, and Mireille Boutin. "The hidden structure of image datasets." 2015 IEEE International Conference on Image Processing ... | 25.860759 | 153 | 0.541361 | import numpy as np
from .PCASmallestEig import pca_smallest_eig, pca_smallest_eig_powermethod
from .Withness import withness
from .CalculateAngle import get_angle
d = X.shape[1]
v = np.random.rand(T,d)
u = np.mean(X,axis=0)
wmin = float("inf")
imin = 0
for i in range(T):
... | true | true |
f735bd7fdd31df3cdede5e7ae4babf9182954552 | 17,836 | py | Python | mriqc/interfaces/anatomical.py | nipreps/mriqc | e021008da0a2ef1c48e882baf932139a673349f9 | [
"Apache-2.0"
] | 15 | 2021-09-25T17:37:17.000Z | 2022-03-31T05:29:38.000Z | mriqc/interfaces/anatomical.py | oesteban/mriqc | e021008da0a2ef1c48e882baf932139a673349f9 | [
"Apache-2.0"
] | 87 | 2021-09-24T09:48:41.000Z | 2022-03-28T11:00:28.000Z | mriqc/interfaces/anatomical.py | nipreps/mriqc | e021008da0a2ef1c48e882baf932139a673349f9 | [
"Apache-2.0"
] | 9 | 2021-09-29T17:03:57.000Z | 2022-03-28T11:57:25.000Z | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2021 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | 33.338318 | 88 | 0.617403 |
import os.path as op
from builtins import zip
import nibabel as nb
import numpy as np
import scipy.ndimage as nd
from mriqc.qc.anatomical import (
art_qi1,
art_qi2,
cjv,
cnr,
efc,
fber,
rpve,
snr,
snr_dietrich,
summary_stats,
volume_fraction,
wm2max... | true | true |
f735bda722382205d9721b05e6f978663132caba | 25,317 | py | Python | dev/tools/leveleditor/python/Lib/bsddb/dbtables.py | CrankySupertoon01/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 12 | 2016-01-06T07:10:28.000Z | 2021-05-13T23:02:02.000Z | dev/tools/leveleditor/python/Lib/bsddb/dbtables.py | CrankySupertoonArchive/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 1 | 2018-07-28T20:07:04.000Z | 2018-07-30T18:28:34.000Z | dev/tools/leveleditor/python/Lib/bsddb/dbtables.py | CrankySupertoonArchive/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 2 | 2019-12-02T01:39:10.000Z | 2021-02-13T22:41:00.000Z | #-----------------------------------------------------------------------
#
# Copyright (C) 2000, 2001 by Autonomous Zone Industries
# Copyright (C) 2002 Gregory P. Smith
#
# License: This is free software. You may use this software for any
# purpose including modification/redistribution, so long as
... | 36.479827 | 79 | 0.546589 |
_cvsid = '$Id: dbtables.py,v 1.11 2004/08/08 00:54:20 tim_one Exp $'
import re
import sys
import copy
import xdrlib
import random
from types import ListType, StringType
import cPickle as pickle
try:
from bsddb3.db import *
except ImportError:
from bsddb.db import *
class TableDBEr... | false | true |
f735be27f6eb25d8ee16a99aaab2b9b696fe22b1 | 1,800 | py | Python | api/charts.py | carrier-io/backend_performance | a6f9ff682dabe8103733b51e23a01c2553e3aacc | [
"Apache-2.0"
] | null | null | null | api/charts.py | carrier-io/backend_performance | a6f9ff682dabe8103733b51e23a01c2553e3aacc | [
"Apache-2.0"
] | null | null | null | api/charts.py | carrier-io/backend_performance | a6f9ff682dabe8103733b51e23a01c2553e3aacc | [
"Apache-2.0"
] | 1 | 2021-06-16T12:14:42.000Z | 2021-06-16T12:14:42.000Z | from ...shared.utils.restApi import RestResource
from ...shared.utils.api_utils import build_req_parser
from ..utils.charts_utils import (requests_summary, requests_hits, avg_responses, summary_table, get_issues,
get_data_from_influx)
class ReportChartsAPI(RestResource):
get_rule... | 40 | 108 | 0.614444 | from ...shared.utils.restApi import RestResource
from ...shared.utils.api_utils import build_req_parser
from ..utils.charts_utils import (requests_summary, requests_hits, avg_responses, summary_table, get_issues,
get_data_from_influx)
class ReportChartsAPI(RestResource):
get_rule... | true | true |
f735beed301629b3bd7382dd9c3ee57eb053f65d | 5,491 | py | Python | unit_tests/add_land_charge/test_charge_description.py | LandRegistry/maintain-frontend | d92446a9972ebbcd9a43a7a7444a528aa2f30bf7 | [
"MIT"
] | 1 | 2019-10-03T13:58:29.000Z | 2019-10-03T13:58:29.000Z | unit_tests/add_land_charge/test_charge_description.py | LandRegistry/maintain-frontend | d92446a9972ebbcd9a43a7a7444a528aa2f30bf7 | [
"MIT"
] | null | null | null | unit_tests/add_land_charge/test_charge_description.py | LandRegistry/maintain-frontend | d92446a9972ebbcd9a43a7a7444a528aa2f30bf7 | [
"MIT"
] | 1 | 2021-04-11T05:24:57.000Z | 2021-04-11T05:24:57.000Z | from maintain_frontend import main
from flask_testing import TestCase
from unit_tests.utilities import Utilities
from maintain_frontend.dependencies.session_api.session import Session
from maintain_frontend.models import LocalLandChargeItem
from maintain_frontend.constants.permissions import Permissions
from flask impo... | 44.642276 | 109 | 0.729557 | from maintain_frontend import main
from flask_testing import TestCase
from unit_tests.utilities import Utilities
from maintain_frontend.dependencies.session_api.session import Session
from maintain_frontend.models import LocalLandChargeItem
from maintain_frontend.constants.permissions import Permissions
from flask impo... | true | true |
f735bef05d8b537cc5a95a3cbaf0b56e519999db | 5,006 | py | Python | api/util.py | GrumpyMeow/ownphotos-backend | 98d8e9136e9188009afe08657f943dba3df80ccb | [
"MIT"
] | null | null | null | api/util.py | GrumpyMeow/ownphotos-backend | 98d8e9136e9188009afe08657f943dba3df80ccb | [
"MIT"
] | null | null | null | api/util.py | GrumpyMeow/ownphotos-backend | 98d8e9136e9188009afe08657f943dba3df80ccb | [
"MIT"
] | null | null | null | import base64
import pickle
import itertools
from scipy import linalg
from sklearn.decomposition import PCA
import numpy as np
from sklearn import cluster
from sklearn import mixture
from scipy.spatial import distance
from sklearn.preprocessing import StandardScaler
import requests
from config import mapzen_api_key... | 35.006993 | 125 | 0.620655 | import base64
import pickle
import itertools
from scipy import linalg
from sklearn.decomposition import PCA
import numpy as np
from sklearn import cluster
from sklearn import mixture
from scipy.spatial import distance
from sklearn.preprocessing import StandardScaler
import requests
from config import mapzen_api_key... | true | true |
f735bfb68d5e14f28769863f789bd090ff80a21a | 49,230 | py | Python | ceed/tests/test_app/test_stage.py | matham/Ceed | b81a14a6b8211e5f4582418ddea34c951ab2667e | [
"MIT"
] | null | null | null | ceed/tests/test_app/test_stage.py | matham/Ceed | b81a14a6b8211e5f4582418ddea34c951ab2667e | [
"MIT"
] | null | null | null | ceed/tests/test_app/test_stage.py | matham/Ceed | b81a14a6b8211e5f4582418ddea34c951ab2667e | [
"MIT"
] | null | null | null | import os
import sys
import math
from contextlib import contextmanager
from math import isclose
import numpy as np
import pytest
import ceed
from .examples.stages import create_test_stages, make_stage, StageWrapper, \
stage_classes, assert_stages_same
from typing import Type, List, Union
from ceed.tests.ceed_app i... | 38.70283 | 80 | 0.653971 | import os
import sys
import math
from contextlib import contextmanager
from math import isclose
import numpy as np
import pytest
import ceed
from .examples.stages import create_test_stages, make_stage, StageWrapper, \
stage_classes, assert_stages_same
from typing import Type, List, Union
from ceed.tests.ceed_app i... | true | true |
f735c01bc52db529a6823dbff4e72eb236525344 | 1,495 | py | Python | python/examples/detection/ttfnet_darknet53_1x_coco/test_client.py | BeyondYourself/Serving | 5114f5ce513d8d37890ef3678cef08fb2ca861af | [
"Apache-2.0"
] | null | null | null | python/examples/detection/ttfnet_darknet53_1x_coco/test_client.py | BeyondYourself/Serving | 5114f5ce513d8d37890ef3678cef08fb2ca861af | [
"Apache-2.0"
] | null | null | null | python/examples/detection/ttfnet_darknet53_1x_coco/test_client.py | BeyondYourself/Serving | 5114f5ce513d8d37890ef3678cef08fb2ca861af | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 32.5 | 86 | 0.718395 |
import sys
import numpy as np
from paddle_serving_client import Client
from paddle_serving_app.reader import *
import cv2
preprocess = DetectionSequential([
DetectionFile2Image(),
DetectionResize(
(512, 512), False, interpolation=cv2.INTER_LINEAR),
DetectionNormalize([123.6... | true | true |
f735c02fc48a16ad8263f2a86d856d6bf5e86980 | 58 | py | Python | zad4_2.py | kamilhabrych/python-semestr5-lista4 | 8370b187130cd9cfef51d36459a9f3b49cefa949 | [
"MIT"
] | null | null | null | zad4_2.py | kamilhabrych/python-semestr5-lista4 | 8370b187130cd9cfef51d36459a9f3b49cefa949 | [
"MIT"
] | null | null | null | zad4_2.py | kamilhabrych/python-semestr5-lista4 | 8370b187130cd9cfef51d36459a9f3b49cefa949 | [
"MIT"
] | null | null | null | napis = str(input("Podaj napis:"))
print(napis.count('a')) | 29 | 34 | 0.672414 | napis = str(input("Podaj napis:"))
print(napis.count('a')) | true | true |
f735c16494901b088e2dd2495a483bc7fb16638c | 2,202 | py | Python | src/mail.py | ishritam/Company-info-auto-mail-sender | 27427f8e126386f1a202dda2addba70f74c322a1 | [
"MIT"
] | null | null | null | src/mail.py | ishritam/Company-info-auto-mail-sender | 27427f8e126386f1a202dda2addba70f74c322a1 | [
"MIT"
] | null | null | null | src/mail.py | ishritam/Company-info-auto-mail-sender | 27427f8e126386f1a202dda2addba70f74c322a1 | [
"MIT"
] | null | null | null | import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email import encoders
from datetime import datetime
import logging
import json
with open('config.json', 'r') as config:
params = json.load(config)["params"]
# par... | 40.036364 | 170 | 0.683924 | import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email import encoders
from datetime import datetime
import logging
import json
with open('config.json', 'r') as config:
params = json.load(config)["params"]
... | true | true |
f735c18a5eec3c534465aea56ee3b6ce5c668fe6 | 475 | py | Python | lib/extensions/__init__.py | renebentes/JoomlaProjects | 30c07041b90fc51e4de3fb544b378854f71db2f1 | [
"MIT"
] | 1 | 2015-04-19T10:36:18.000Z | 2015-04-19T10:36:18.000Z | lib/extensions/__init__.py | renebentes/JoomlaProjects | 30c07041b90fc51e4de3fb544b378854f71db2f1 | [
"MIT"
] | null | null | null | lib/extensions/__init__.py | renebentes/JoomlaProjects | 30c07041b90fc51e4de3fb544b378854f71db2f1 | [
"MIT"
] | 1 | 2015-01-14T02:10:55.000Z | 2015-01-14T02:10:55.000Z | # coding: utf-8
import sublime
st_version = int(sublime.version())
if st_version > 3000:
from JoomlaPack.lib.extensions.component import Component
from JoomlaPack.lib.extensions.package import Package
from JoomlaPack.lib.extensions.plugin import Plugin
else:
from lib.extensions.component import Compone... | 25 | 61 | 0.747368 |
import sublime
st_version = int(sublime.version())
if st_version > 3000:
from JoomlaPack.lib.extensions.component import Component
from JoomlaPack.lib.extensions.package import Package
from JoomlaPack.lib.extensions.plugin import Plugin
else:
from lib.extensions.component import Component
from lib... | true | true |
f735c3ab5d7a3453ace6640fe7bb19ef260fc045 | 145 | py | Python | kiri_search/__init__.py | kiri-ai/kiri-search | 78a0f78b11b73cca8934054498d5713773d3e93a | [
"Apache-2.0"
] | null | null | null | kiri_search/__init__.py | kiri-ai/kiri-search | 78a0f78b11b73cca8934054498d5713773d3e93a | [
"Apache-2.0"
] | null | null | null | kiri_search/__init__.py | kiri-ai/kiri-search | 78a0f78b11b73cca8934054498d5713773d3e93a | [
"Apache-2.0"
] | null | null | null | from .core import Kiri
from .search import ElasticDocStore, Document, ChunkedDocument, ElasticDocument, ElasticChunkedDocument, InMemoryDocStore
| 48.333333 | 121 | 0.862069 | from .core import Kiri
from .search import ElasticDocStore, Document, ChunkedDocument, ElasticDocument, ElasticChunkedDocument, InMemoryDocStore
| true | true |
f735c414bba1419088affd6eca51ac71316e0dd2 | 2,542 | py | Python | tests/python/gaia-ui-tests/gaiatest/apps/email/regions/new_email.py | dcoloma/gaia | e542540cfa64c31ac8bb71b1a9cf16879fc9d58e | [
"Apache-2.0"
] | 1 | 2017-09-09T12:55:56.000Z | 2017-09-09T12:55:56.000Z | tests/python/gaia-ui-tests/gaiatest/apps/email/regions/new_email.py | dcoloma/gaia | e542540cfa64c31ac8bb71b1a9cf16879fc9d58e | [
"Apache-2.0"
] | null | null | null | tests/python/gaia-ui-tests/gaiatest/apps/email/regions/new_email.py | dcoloma/gaia | e542540cfa64c31ac8bb71b1a9cf16879fc9d58e | [
"Apache-2.0"
] | null | null | null | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from marionette.by import By
from gaiatest.apps.base import Base
class NewEmail(Base):
# Write new email
_vie... | 41.672131 | 95 | 0.696302 |
from marionette.by import By
from gaiatest.apps.base import Base
class NewEmail(Base):
_view_locator = (By.CSS_SELECTOR, '#cardContainer .card-compose')
_to_locator = (By.CSS_SELECTOR, '#cardContainer .card.center .cmp-to-text.cmp-addr-text')
_cc_locator = (By.CSS_SELECTOR, '#cardContainer .card... | true | true |
f735c423a5ff8820d689878cd70ec7e4bd7e308f | 386 | py | Python | saltdash/wsgi.py | lincolnloop/saltdash | 4b0268cf9ce0320272f0182f33b046d4ab7766a2 | [
"MIT"
] | 19 | 2018-01-30T00:10:14.000Z | 2021-11-11T10:26:56.000Z | saltdash/wsgi.py | lincolnloop/saltdash | 4b0268cf9ce0320272f0182f33b046d4ab7766a2 | [
"MIT"
] | 118 | 2018-01-26T18:27:47.000Z | 2022-02-10T07:31:20.000Z | saltdash/wsgi.py | lincolnloop/saltdash | 4b0268cf9ce0320272f0182f33b046d4ab7766a2 | [
"MIT"
] | 2 | 2021-07-13T00:32:02.000Z | 2021-11-11T10:27:03.000Z | import sys
from django.conf import settings
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
# Warm-up wsgi app on import
warmup = application(
{
"REQUEST_METHOD": "GET",
"SERVER_NAME": "127.0.0.1",
"SERVER_PORT": 80,
"PATH_INFO": "/-/alive/",... | 20.315789 | 49 | 0.621762 | import sys
from django.conf import settings
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
warmup = application(
{
"REQUEST_METHOD": "GET",
"SERVER_NAME": "127.0.0.1",
"SERVER_PORT": 80,
"PATH_INFO": "/-/alive/",
"wsgi.input": sys.s... | true | true |
f735c693706d55cb0fb635532de5320536fb224e | 2,281 | py | Python | test/unit/tool_util/toolbox/test_watcher.py | beatrizserrano/galaxy | e149d9d32e1bca6c07c38b1a9cdabfee60323610 | [
"CC-BY-3.0"
] | null | null | null | test/unit/tool_util/toolbox/test_watcher.py | beatrizserrano/galaxy | e149d9d32e1bca6c07c38b1a9cdabfee60323610 | [
"CC-BY-3.0"
] | 6 | 2021-11-11T20:57:49.000Z | 2021-12-10T15:30:33.000Z | test/unit/tool_util/toolbox/test_watcher.py | beatrizserrano/galaxy | e149d9d32e1bca6c07c38b1a9cdabfee60323610 | [
"CC-BY-3.0"
] | null | null | null | import tempfile
import time
from contextlib import contextmanager
from os import path
from shutil import rmtree
import pytest
from galaxy.tool_util.toolbox import watcher
from galaxy.util import bunch
@pytest.mark.skipif(not watcher.can_watch, reason="watchdog not available")
def test_watcher():
with __test_dir... | 26.218391 | 87 | 0.65673 | import tempfile
import time
from contextlib import contextmanager
from os import path
from shutil import rmtree
import pytest
from galaxy.tool_util.toolbox import watcher
from galaxy.util import bunch
@pytest.mark.skipif(not watcher.can_watch, reason="watchdog not available")
def test_watcher():
with __test_dir... | true | true |
f735c714304c3b5527411ae0ba5ef0803ae3852d | 196 | py | Python | sbsearch/__init__.py | mkelley/sbsearch | 7569e473cf0b8f5df3cfc7332ae4287a780d28d2 | [
"BSD-3-Clause"
] | null | null | null | sbsearch/__init__.py | mkelley/sbsearch | 7569e473cf0b8f5df3cfc7332ae4287a780d28d2 | [
"BSD-3-Clause"
] | null | null | null | sbsearch/__init__.py | mkelley/sbsearch | 7569e473cf0b8f5df3cfc7332ae4287a780d28d2 | [
"BSD-3-Clause"
] | null | null | null | # Licensed with the 3-clause BSD license. See LICENSE for details.
try:
from .version import version as __version__
except ImportError:
__version__ = ""
from .sbsearch import * # noqa
| 21.777778 | 67 | 0.72449 |
try:
from .version import version as __version__
except ImportError:
__version__ = ""
from .sbsearch import *
| true | true |
f735c73fa8542b9c0faec59fb6dc99f1bca85d50 | 304 | py | Python | doc/conf.py | tombaker/mklists_old | cf3ca814cf2cfc785a8cdbddd33162b9ee658570 | [
"MIT"
] | 1 | 2021-07-02T03:41:57.000Z | 2021-07-02T03:41:57.000Z | doc/conf.py | tombaker/mklists_old | cf3ca814cf2cfc785a8cdbddd33162b9ee658570 | [
"MIT"
] | null | null | null | doc/conf.py | tombaker/mklists_old | cf3ca814cf2cfc785a8cdbddd33162b9ee658570 | [
"MIT"
] | null | null | null | project = "mklists"
copyright = "2020, Tom Baker"
author = "Tom Baker"
release = "0.2"
extensions = []
templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
html_theme = "default"
github_project_url = "https://github.com/tombaker/mklists"
html_static_path = ["_static"]
| 27.636364 | 58 | 0.713816 | project = "mklists"
copyright = "2020, Tom Baker"
author = "Tom Baker"
release = "0.2"
extensions = []
templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
html_theme = "default"
github_project_url = "https://github.com/tombaker/mklists"
html_static_path = ["_static"]
| true | true |
f735c80dafefca62fbe4588f2fa52f2ceed09235 | 57,744 | py | Python | databricks/koalas/base.py | igorlucci/koalas | 8803344d620261981003175bd1edc3c4120b84e2 | [
"Apache-2.0"
] | 1 | 2021-07-16T20:32:32.000Z | 2021-07-16T20:32:32.000Z | databricks/koalas/base.py | igorlucci/koalas | 8803344d620261981003175bd1edc3c4120b84e2 | [
"Apache-2.0"
] | null | null | null | databricks/koalas/base.py | igorlucci/koalas | 8803344d620261981003175bd1edc3c4120b84e2 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) 2019 Databricks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 35.1883 | 100 | 0.551988 |
from abc import ABCMeta, abstractmethod
import datetime
from functools import wraps, partial
from typing import Any, Callable, Tuple, Union, cast, TYPE_CHECKING
import warnings
import numpy as np
import pandas as pd
from pandas.api.types import is_list_like
from pyspark import sql as spark
from pyspa... | true | true |
f735c8f12c8094d4f4ec79448a80403fe86acc03 | 10,531 | py | Python | main.py | abhi526691/Covid-Guard | 9c050ef44201c01f512169ffb146ad0da5278ec1 | [
"MIT"
] | 5 | 2020-08-26T18:39:29.000Z | 2020-11-16T13:05:11.000Z | main.py | abhi526691/Covid-Guard | 9c050ef44201c01f512169ffb146ad0da5278ec1 | [
"MIT"
] | null | null | null | main.py | abhi526691/Covid-Guard | 9c050ef44201c01f512169ffb146ad0da5278ec1 | [
"MIT"
] | 2 | 2020-10-07T15:12:51.000Z | 2020-10-22T08:49:13.000Z | # import the necessary packages
from tensorflow.keras.preprocessing.image import img_to_array
from tensorflow.keras.applications.mobilenet_v2 import preprocess_input
from tensorflow.keras.models import load_model
from imutils.video import VideoStream,FileVideoStream
import imutils
import numpy as np
import time
... | 32.603715 | 88 | 0.628145 |
from tensorflow.keras.preprocessing.image import img_to_array
from tensorflow.keras.applications.mobilenet_v2 import preprocess_input
from tensorflow.keras.models import load_model
from imutils.video import VideoStream,FileVideoStream
import imutils
import numpy as np
import time
import os
import cv2
import m... | true | true |
f735c99cac1d4b91c2534863c9a3f45ff76fd782 | 2,618 | py | Python | day16-part1/main.py | KSonny4/advent-of-code-2021 | ca4cf2e94799174468950019a562ed9063001599 | [
"MIT"
] | 4 | 2021-12-02T21:17:43.000Z | 2021-12-05T22:15:28.000Z | day16-part1/main.py | KSonny4/advent-of-code-2021 | ca4cf2e94799174468950019a562ed9063001599 | [
"MIT"
] | null | null | null | day16-part1/main.py | KSonny4/advent-of-code-2021 | ca4cf2e94799174468950019a562ed9063001599 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from enum import Enum
from typing import List, Tuple, Union, Any
VERSIONS_SUM = 0
class TypeID(Enum):
LITERAL_VALUE = 4
@dataclass
class LiteralValue:
packet_version: int
packet_type_id: int
parts: List[str]
decimal: int
@dataclass
class OperatorPacket:
... | 21.459016 | 87 | 0.607716 | from dataclasses import dataclass
from enum import Enum
from typing import List, Tuple, Union, Any
VERSIONS_SUM = 0
class TypeID(Enum):
LITERAL_VALUE = 4
@dataclass
class LiteralValue:
packet_version: int
packet_type_id: int
parts: List[str]
decimal: int
@dataclass
class OperatorPacket:
... | true | true |
f735ca903d6e0f2818ec50f7707d4002984535b4 | 3,119 | py | Python | strings/string_search/z_algorithm/python/Z_algorithm.py | avi-pal/al-go-rithms | 5167a20f1db7b366ff19f2962c1746a02e4f5067 | [
"CC0-1.0"
] | 1,253 | 2017-06-06T07:19:25.000Z | 2022-03-30T17:07:58.000Z | strings/string_search/z_algorithm/python/Z_algorithm.py | rishabh99-rc/al-go-rithms | 4df20d7ef7598fda4bc89101f9a99aac94cdd794 | [
"CC0-1.0"
] | 554 | 2017-09-29T18:56:01.000Z | 2022-02-21T15:48:13.000Z | strings/string_search/z_algorithm/python/Z_algorithm.py | rishabh99-rc/al-go-rithms | 4df20d7ef7598fda4bc89101f9a99aac94cdd794 | [
"CC0-1.0"
] | 2,226 | 2017-09-29T19:59:59.000Z | 2022-03-25T08:59:55.000Z | #!/bin/python3
import sys, string
from random import *
from timeit import default_timer as timer
def randstr(N,alphabet=string.ascii_lowercase):
l=len(alphabet)
return "".join( alphabet[randint(0,l-1)] for _ in range(N))
def timefunc(func, *args, **kwargs):
"""Time a function.
args:
iterati... | 20.385621 | 110 | 0.436358 |
import sys, string
from random import *
from timeit import default_timer as timer
def randstr(N,alphabet=string.ascii_lowercase):
l=len(alphabet)
return "".join( alphabet[randint(0,l-1)] for _ in range(N))
def timefunc(func, *args, **kwargs):
try:
iterations = kwargs.pop('iterations')
excep... | true | true |
f735caac43d63be3a59c8ea26a0d53fa7897631d | 131,132 | py | Python | pyNastran/op2/tables/geom/ept.py | fmamitrotta/pyNastran | 6f9592cf3a2ccb8c509918acb735282d6eef75aa | [
"BSD-3-Clause"
] | 293 | 2015-03-22T20:22:01.000Z | 2022-03-14T20:28:24.000Z | pyNastran/op2/tables/geom/ept.py | sean-engelstad/pyNastran | 90f957887a4f68f8e58b07c15e1ac69c66b9c6f4 | [
"BSD-3-Clause"
] | 512 | 2015-03-14T18:39:27.000Z | 2022-03-31T16:15:43.000Z | pyNastran/op2/tables/geom/ept.py | sean-engelstad/pyNastran | 90f957887a4f68f8e58b07c15e1ac69c66b9c6f4 | [
"BSD-3-Clause"
] | 136 | 2015-03-19T03:26:06.000Z | 2022-03-25T22:14:54.000Z | """
defines readers for BDF objects in the OP2 EPT/EPTS table
"""
#pylint: disable=C0103,R0914
from __future__ import annotations
from struct import unpack, Struct
from functools import partial
from typing import Tuple, List, TYPE_CHECKING
import numpy as np
#from pyNastran import is_release
from pyNastran.bdf.cards.... | 41.615995 | 952 | 0.503676 |
from __future__ import annotations
from struct import unpack, Struct
from functools import partial
from typing import Tuple, List, TYPE_CHECKING
import numpy as np
from pyNastran.bdf.cards.properties.mass import PMASS, NSM, NSML
from pyNastran.bdf.cards.properties.bars import PBAR, PBARL, PBEND, PBEAM3
from pyNastr... | true | true |
f735cbd60586e7a60325ea6879b020b987b34a4b | 810 | py | Python | cloneEveryHourFor48Hours.py | keotl/TA-tools | 1ad5466e2470e8009ad4825c6fd21f37f567e8dd | [
"MIT"
] | null | null | null | cloneEveryHourFor48Hours.py | keotl/TA-tools | 1ad5466e2470e8009ad4825c6fd21f37f567e8dd | [
"MIT"
] | null | null | null | cloneEveryHourFor48Hours.py | keotl/TA-tools | 1ad5466e2470e8009ad4825c6fd21f37f567e8dd | [
"MIT"
] | 1 | 2019-09-03T17:47:51.000Z | 2019-09-03T17:47:51.000Z | #!/usr/bin/python3
import subprocess;
import datetime;
import time;
import threading;
import argparse;
parser = argparse.ArgumentParser(description="sleep 3600 pour remise");
parser.add_argument("--destination", help='base dir destination');
parser.add_argument("--branch", help="branch to be checked out");
args = pa... | 27 | 110 | 0.698765 |
import subprocess;
import datetime;
import time;
import threading;
import argparse;
parser = argparse.ArgumentParser(description="sleep 3600 pour remise");
parser.add_argument("--destination", help='base dir destination');
parser.add_argument("--branch", help="branch to be checked out");
args = parser.parse_args();... | true | true |
f735cc7446deb1248e077f55440f4483396ccf9c | 4,181 | py | Python | bot/exts/info/source.py | zeph-yrus9/bot | 5fe110b9a49144480ebca34dec65de91753994ec | [
"MIT",
"BSD-3-Clause"
] | 22 | 2018-02-03T12:39:12.000Z | 2018-10-03T22:19:23.000Z | bot/exts/info/source.py | zeph-yrus9/bot | 5fe110b9a49144480ebca34dec65de91753994ec | [
"MIT",
"BSD-3-Clause"
] | 52 | 2018-02-09T14:00:39.000Z | 2018-06-06T17:29:32.000Z | bot/exts/info/source.py | zeph-yrus9/bot | 5fe110b9a49144480ebca34dec65de91753994ec | [
"MIT",
"BSD-3-Clause"
] | 15 | 2018-02-09T13:37:17.000Z | 2018-05-10T13:17:58.000Z | import inspect
from pathlib import Path
from typing import Optional, Tuple, Union
from discord import Embed
from discord.ext import commands
from bot.bot import Bot
from bot.constants import URLs
from bot.converters import SourceConverter
from bot.exts.info.tags import TagIdentifier
SourceType = Union[commands.HelpC... | 40.201923 | 116 | 0.654867 | import inspect
from pathlib import Path
from typing import Optional, Tuple, Union
from discord import Embed
from discord.ext import commands
from bot.bot import Bot
from bot.constants import URLs
from bot.converters import SourceConverter
from bot.exts.info.tags import TagIdentifier
SourceType = Union[commands.HelpC... | true | true |
f735ce75cb3189d592ca1a91116e1da6432e4695 | 326 | py | Python | manage.py | rmboot/approvalsystem | b084ecb5fa4b401a052f3cf2a307af1d55f3c8fc | [
"MIT"
] | 3 | 2019-04-16T04:11:11.000Z | 2021-09-19T02:38:49.000Z | manage.py | rmboot/approvalsystem | b084ecb5fa4b401a052f3cf2a307af1d55f3c8fc | [
"MIT"
] | 4 | 2019-06-04T11:14:22.000Z | 2021-09-08T01:11:26.000Z | manage.py | rmboot/approvalsystem | b084ecb5fa4b401a052f3cf2a307af1d55f3c8fc | [
"MIT"
] | 4 | 2019-10-10T15:04:31.000Z | 2021-06-19T17:03:06.000Z | from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
from approval_system import create_app
from approval_system.extensions import db
app = create_app()
manager = Manager(app)
migrate = Migrate(app, db)
manager.add_command('db', MigrateCommand)
if __name__ == '__main__':
manager.... | 19.176471 | 49 | 0.785276 | from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
from approval_system import create_app
from approval_system.extensions import db
app = create_app()
manager = Manager(app)
migrate = Migrate(app, db)
manager.add_command('db', MigrateCommand)
if __name__ == '__main__':
manager.... | true | true |
f735cf81e2ea3e8120be5104973afe9ad14ad25d | 57,266 | py | Python | Experiments/src/Task Control - Python/UR5Class.py | FelipeH92/Task-Space-Control-Vision | 77d9f709d7cb0afb50ef9baf6ba39304aca445e5 | [
"CC-BY-4.0"
] | null | null | null | Experiments/src/Task Control - Python/UR5Class.py | FelipeH92/Task-Space-Control-Vision | 77d9f709d7cb0afb50ef9baf6ba39304aca445e5 | [
"CC-BY-4.0"
] | null | null | null | Experiments/src/Task Control - Python/UR5Class.py | FelipeH92/Task-Space-Control-Vision | 77d9f709d7cb0afb50ef9baf6ba39304aca445e5 | [
"CC-BY-4.0"
] | 1 | 2021-11-08T23:50:33.000Z | 2021-11-08T23:50:33.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
## @package UR5
# Documentação para o pacote de classes UR5.
#
# Documentação do código produzido para controle do manipulador UR5 e geração e controle de suas posições.
# Cada código aqui documentado possui uma breve descrição de sua função, suas entradas e saídas.
i... | 46.256866 | 222 | 0.524412 |
py as np
from numpy.linalg import inv
from numpy.linalg import norm
from numpy.linalg import pinv
from scipy.signal import butter,lfilter
from scipy.signal import freqz
import struct
import time
import csv
import Transformations as tf
import os
, 1.570796327, -1.570796327, 0], [.089159,0,0,.10915,.09465,... | true | true |
f735d0e633001aab0366d4b6659ef304fb957519 | 845 | py | Python | odml/gui/__main__.py | carloscanova/python-odml | dff793bff86187b67be139c0f32c7cd036ba8db4 | [
"BSD-4-Clause"
] | null | null | null | odml/gui/__main__.py | carloscanova/python-odml | dff793bff86187b67be139c0f32c7cd036ba8db4 | [
"BSD-4-Clause"
] | null | null | null | odml/gui/__main__.py | carloscanova/python-odml | dff793bff86187b67be139c0f32c7cd036ba8db4 | [
"BSD-4-Clause"
] | null | null | null | #!/usr/bin/env python
import gtk
import Editor
def main(filenames=[]):
"""
start the editor, with a new empty document
or load all *filenames* as tabs
returns the tab object
"""
Editor.register_stock_icons()
editor = Editor.EditorWindow()
tabs = map(editor.load_document, filenames)
... | 22.236842 | 61 | 0.623669 |
import gtk
import Editor
def main(filenames=[]):
Editor.register_stock_icons()
editor = Editor.EditorWindow()
tabs = map(editor.load_document, filenames)
if len(filenames) == 0:
editor.welcome()
return tabs
def run():
try:
from ctypes import cdll
libc = cdll.LoadLibr... | true | true |
f735d103558b450b8555fe74915f3f20a5ba2d42 | 4,680 | py | Python | tests/test_reporters.py | indigoviolet/region_profiler | 119a3624ee063d86e8e66de9fa97cccd7964f943 | [
"MIT"
] | null | null | null | tests/test_reporters.py | indigoviolet/region_profiler | 119a3624ee063d86e8e66de9fa97cccd7964f943 | [
"MIT"
] | null | null | null | tests/test_reporters.py | indigoviolet/region_profiler | 119a3624ee063d86e8e66de9fa97cccd7964f943 | [
"MIT"
] | null | null | null | import sys
from typing import List
import pytest
from region_profiler import RegionProfiler
from region_profiler import reporter_columns as cols
from region_profiler.reporters import (
ConsoleReporter,
CsvReporter,
SilentReporter,
Slice,
get_profiler_slice,
)
from region_profiler.utils import SeqSt... | 30.588235 | 84 | 0.569231 | import sys
from typing import List
import pytest
from region_profiler import RegionProfiler
from region_profiler import reporter_columns as cols
from region_profiler.reporters import (
ConsoleReporter,
CsvReporter,
SilentReporter,
Slice,
get_profiler_slice,
)
from region_profiler.utils import SeqSt... | true | true |
f735d114acfbbc7d006b9ce0ce107c90ffa2fae2 | 324 | py | Python | simulator/kruxsim/mocks/flash.py | odudex/krux | db421a3f107c0263221e5f1e877e9c38925bb17c | [
"MIT"
] | null | null | null | simulator/kruxsim/mocks/flash.py | odudex/krux | db421a3f107c0263221e5f1e877e9c38925bb17c | [
"MIT"
] | 13 | 2022-03-21T05:35:03.000Z | 2022-03-31T14:31:46.000Z | simulator/kruxsim/mocks/flash.py | odudex/krux | db421a3f107c0263221e5f1e877e9c38925bb17c | [
"MIT"
] | null | null | null | import sys
from unittest import mock
flash = bytearray(8 * 1024 * 1024)
def read_data(addr, amount):
return flash[addr : addr + amount]
def write_data(addr, data):
flash[addr : addr + len(data)] = data
if "flash" not in sys.modules:
sys.modules["flash"] = mock.MagicMock(read=read_data, write=write_da... | 19.058824 | 75 | 0.691358 | import sys
from unittest import mock
flash = bytearray(8 * 1024 * 1024)
def read_data(addr, amount):
return flash[addr : addr + amount]
def write_data(addr, data):
flash[addr : addr + len(data)] = data
if "flash" not in sys.modules:
sys.modules["flash"] = mock.MagicMock(read=read_data, write=write_da... | true | true |
f735d1900984061043b641ab5d3f5887318d3656 | 6,714 | py | Python | src/mainwin.py | coljac/magicbrowse | a5b4d8c3c3ef9994918ec024b726d2b3d6eba695 | [
"MIT"
] | null | null | null | src/mainwin.py | coljac/magicbrowse | a5b4d8c3c3ef9994918ec024b726d2b3d6eba695 | [
"MIT"
] | null | null | null | src/mainwin.py | coljac/magicbrowse | a5b4d8c3c3ef9994918ec024b726d2b3d6eba695 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mainwindow.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MtgBrowse(object):
def setupUi(self, MtgBrowse):
MtgBrow... | 55.95 | 115 | 0.737563 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MtgBrowse(object):
def setupUi(self, MtgBrowse):
MtgBrowse.setObjectName("MtgBrowse")
MtgBrowse.resize(1120, 1073)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setH... | true | true |
f735d1b207af86fc20b10c7aab955f604760663c | 118 | py | Python | learn_mongodb/p1_crud/p3_update/__init__.py | MacHu-GWU/learn_mongodb-project | e5f5a96603e71ca762bdb56951fa7e5ce143d810 | [
"MIT"
] | null | null | null | learn_mongodb/p1_crud/p3_update/__init__.py | MacHu-GWU/learn_mongodb-project | e5f5a96603e71ca762bdb56951fa7e5ce143d810 | [
"MIT"
] | null | null | null | learn_mongodb/p1_crud/p3_update/__init__.py | MacHu-GWU/learn_mongodb-project | e5f5a96603e71ca762bdb56951fa7e5ce143d810 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
ref: https://docs.mongodb.com/manual/reference/operator/update/
""" | 19.666667 | 63 | 0.644068 | true | true | |
f735d24a194b9aacca03b7cf68b3f7179ceb3e3f | 524 | py | Python | repo/components/lib/googlecloudsdk/api_lib/macro/library_list_jobs.py | salrashid123/gcloud_component | e6a3a5a7a2bbbb43f0fa3760b634febf166d3a7c | [
"Apache-2.0"
] | 2 | 2019-08-05T15:36:03.000Z | 2021-08-25T07:17:35.000Z | repo/components/lib/googlecloudsdk/api_lib/macro/library_list_jobs.py | salrashid123/gcloud_component | e6a3a5a7a2bbbb43f0fa3760b634febf166d3a7c | [
"Apache-2.0"
] | null | null | null | repo/components/lib/googlecloudsdk/api_lib/macro/library_list_jobs.py | salrashid123/gcloud_component | e6a3a5a7a2bbbb43f0fa3760b634febf166d3a7c | [
"Apache-2.0"
] | null | null | null |
import re
from googlecloudsdk.api_lib.util import apis as core_apis
from googlecloudsdk.calliope import exceptions
import yaml
import json
class LibraryListJobs(object):
def __init__(self, dataset=None,state_filter=None):
from google.cloud import bigquery
#client = bigquery.Client(project='your_project)... | 22.782609 | 57 | 0.727099 |
import re
from googlecloudsdk.api_lib.util import apis as core_apis
from googlecloudsdk.calliope import exceptions
import yaml
import json
class LibraryListJobs(object):
def __init__(self, dataset=None,state_filter=None):
from google.cloud import bigquery
client = bigquery.Client()
dataset = cl... | false | true |
f735d33c955450b393a844082555926f2cfe08a0 | 1,222 | py | Python | pcat2py/class/23ae8758-5cc5-11e4-af55-00155d01fe08.py | phnomcobra/PCAT2PY | 937c3b365cdc5ac69b78f59070be0a21bdb53db0 | [
"MIT"
] | null | null | null | pcat2py/class/23ae8758-5cc5-11e4-af55-00155d01fe08.py | phnomcobra/PCAT2PY | 937c3b365cdc5ac69b78f59070be0a21bdb53db0 | [
"MIT"
] | null | null | null | pcat2py/class/23ae8758-5cc5-11e4-af55-00155d01fe08.py | phnomcobra/PCAT2PY | 937c3b365cdc5ac69b78f59070be0a21bdb53db0 | [
"MIT"
] | null | null | null | #!/usr/bin/python
################################################################################
# 23ae8758-5cc5-11e4-af55-00155d01fe08
#
# Justin Dierking
# justindierking@hardbitsolutions.com
# phnomcobra@gmail.com
#
# 10/24/2014 Original Construction
################################################################... | 29.095238 | 80 | 0.486088 | true | true | |
f735d366d42e472d897ac4bf09f3aebbea4834d2 | 1,822 | py | Python | app/blueprint_auth/views.py | medsci-tech/mime_analysis_flask_2017 | 4a927219f31db433f4af6a7af3085e05c08b5c3e | [
"MIT"
] | null | null | null | app/blueprint_auth/views.py | medsci-tech/mime_analysis_flask_2017 | 4a927219f31db433f4af6a7af3085e05c08b5c3e | [
"MIT"
] | null | null | null | app/blueprint_auth/views.py | medsci-tech/mime_analysis_flask_2017 | 4a927219f31db433f4af6a7af3085e05c08b5c3e | [
"MIT"
] | null | null | null | import datetime
import json
from flask import url_for
from flask import redirect
from flask import render_template
from flask_login import login_user
from flask_login import logout_user
from . import blueprint_auth
from .forms import RegisterForm
from .forms import LoginForm
from .utils_cms import generate_code
from .... | 27.606061 | 74 | 0.694292 | import datetime
import json
from flask import url_for
from flask import redirect
from flask import render_template
from flask_login import login_user
from flask_login import logout_user
from . import blueprint_auth
from .forms import RegisterForm
from .forms import LoginForm
from .utils_cms import generate_code
from .... | true | true |
f735d3b5b015bc679c6b0fc8a3dfed895d1870f9 | 9,542 | py | Python | BaseTools/Source/Python/GenFds/Fd.py | CEOALT1/RefindPlusUDK | 116b957ad735f96fbb6d80a0ba582046960ba164 | [
"BSD-2-Clause"
] | 2 | 2018-09-05T02:46:11.000Z | 2020-04-14T08:38:31.000Z | BaseTools/Source/Python/GenFds/Fd.py | CEOALT1/RefindPlusUDK | 116b957ad735f96fbb6d80a0ba582046960ba164 | [
"BSD-2-Clause"
] | 5 | 2020-12-25T05:24:37.000Z | 2021-01-11T01:01:01.000Z | BaseTools/Source/Python/GenFds/Fd.py | CEOALT1/RefindPlusUDK | 116b957ad735f96fbb6d80a0ba582046960ba164 | [
"BSD-2-Clause"
] | 16 | 2020-07-31T17:57:27.000Z | 2021-03-10T14:32:36.000Z | ## @file
# process FD generation
#
# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license ... | 45.655502 | 222 | 0.581639 |
import Region
import Fv
import Common.LongFilePathOs as os
import StringIO
import sys
from struct import *
from GenFdsGlobalVariable import GenFdsGlobalVariable
from CommonDataClass.FdfClass import FDClassObject
from Common import EdkLogger
from Common.BuildToolError import *
from Common.Misc import S... | true | true |
f735d45aaf759634b1859443ea80a7525bf9308c | 7,405 | py | Python | 0-firefox/atsy/atsy/atsy/multitab.py | DSouzaM/mesh-testsuite | 8fb4a0a97a81183f0920e55042ea96c4a994ed27 | [
"Apache-2.0"
] | 1 | 2019-10-28T22:06:19.000Z | 2019-10-28T22:06:19.000Z | 0-firefox/atsy/atsy/atsy/multitab.py | DSouzaM/mesh-testsuite | 8fb4a0a97a81183f0920e55042ea96c4a994ed27 | [
"Apache-2.0"
] | null | null | null | 0-firefox/atsy/atsy/atsy/multitab.py | DSouzaM/mesh-testsuite | 8fb4a0a97a81183f0920e55042ea96c4a994ed27 | [
"Apache-2.0"
] | 3 | 2019-02-23T06:42:18.000Z | 2020-11-09T18:25:54.000Z | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from selenium import webdriver
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.common.... | 34.124424 | 94 | 0.633626 |
from selenium import webdriver
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from marionette_harness.runtests import MarionetteTestRunner
import mozinfo
from mozlog.structured import command... | false | true |
f735d4a1ab3e9f74bfda0300638e91a89fa8e131 | 11,805 | py | Python | samples/mnist_vae.py | piojanu/tf_utils | 169bd3334dd11954cf8f411f2c918f76cd609fab | [
"MIT"
] | 1 | 2019-04-05T11:41:02.000Z | 2019-04-05T11:41:02.000Z | samples/mnist_vae.py | piojanu/tf_utils | 169bd3334dd11954cf8f411f2c918f76cd609fab | [
"MIT"
] | null | null | null | samples/mnist_vae.py | piojanu/tf_utils | 169bd3334dd11954cf8f411f2c918f76cd609fab | [
"MIT"
] | null | null | null | import argparse
import io
import os.path
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from tqdm import tqdm
from tf_utils import AttrDict, attrdict_from_yaml, lazy_property_with_scope, share_variables
tfd = tfp.distributions
tfl = tf.layers
class M... | 38.452769 | 103 | 0.607624 | import argparse
import io
import os.path
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from tqdm import tqdm
from tf_utils import AttrDict, attrdict_from_yaml, lazy_property_with_scope, share_variables
tfd = tfp.distributions
tfl = tf.layers
class M... | true | true |
f735d53be2e6d930f20c1daa49019a1b2e41a6e4 | 1,898 | py | Python | General/state_machine.py | TomE8/drones | c92865556dd3df2d5f5b73589cd48e413bff3a3a | [
"MIT"
] | 14 | 2018-10-29T00:52:18.000Z | 2022-03-23T20:07:11.000Z | General/state_machine.py | TomE8/drones | c92865556dd3df2d5f5b73589cd48e413bff3a3a | [
"MIT"
] | 4 | 2020-07-12T05:19:05.000Z | 2020-09-20T12:40:47.000Z | General/state_machine.py | TomE8/drones | c92865556dd3df2d5f5b73589cd48e413bff3a3a | [
"MIT"
] | 2 | 2019-03-08T01:36:47.000Z | 2019-09-12T04:07:19.000Z | #!/usr/bin/env python3
from .general_common import States
from Control.control_common import ButtonIndex
def getState(state, my_joystick):
# ==============================================================
if state == States.IDLE:
if my_joystick.get_button_val(ButtonIndex.SIDE_BUTTON) == 1:
r... | 45.190476 | 70 | 0.559536 |
from .general_common import States
from Control.control_common import ButtonIndex
def getState(state, my_joystick):
if state == States.IDLE:
if my_joystick.get_button_val(ButtonIndex.SIDE_BUTTON) == 1:
return States.STAND_BY
elif my_joystick.get_button_val(ButtonIndex.EXIT) == 1:
... | true | true |
f735d6da81a04d6a2b61934e81a4273b20c11569 | 3,568 | py | Python | FasterRCNN/layers/roi_align.py | pkyIntelligence/FasterRCNN | 230953938efdba8f8c127fcc0bb746fcce8d9463 | [
"MIT"
] | null | null | null | FasterRCNN/layers/roi_align.py | pkyIntelligence/FasterRCNN | 230953938efdba8f8c127fcc0bb746fcce8d9463 | [
"MIT"
] | null | null | null | FasterRCNN/layers/roi_align.py | pkyIntelligence/FasterRCNN | 230953938efdba8f8c127fcc0bb746fcce8d9463 | [
"MIT"
] | null | null | null | import torch
import math
from torch import nn
from ..utils.utils import point_interpolate
class ROIAlign(nn.Module):
def __init__(self, output_size, spatial_scale, sampling_ratio):
"""
Args:
output_size (tuple): h, w
spatial_scale (float): scale the input boxes by this num... | 36.783505 | 118 | 0.596693 | import torch
import math
from torch import nn
from ..utils.utils import point_interpolate
class ROIAlign(nn.Module):
def __init__(self, output_size, spatial_scale, sampling_ratio):
super(ROIAlign, self).__init__()
self.output_size = output_size
self.spatial_scale = spatial_scale
s... | true | true |
f735d7158874ad9384cb7b84a9148a79463de33b | 3,549 | py | Python | basic/string1.py | ssharm21/google-python-exercises | 561ef2b28095ad5e483e60b282905a8a51dd8279 | [
"Apache-2.0"
] | null | null | null | basic/string1.py | ssharm21/google-python-exercises | 561ef2b28095ad5e483e60b282905a8a51dd8279 | [
"Apache-2.0"
] | null | null | null | basic/string1.py | ssharm21/google-python-exercises | 561ef2b28095ad5e483e60b282905a8a51dd8279 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Basic string exercises
# Fill in the code for the functions below. main() is already se... | 30.86087 | 78 | 0.674274 |
# http://code.google.com/edu/languages/google-python-class/
# Basic string exercises
# Fill in the code for the functions below. main() is already set up
# to call the functions with a few different inputs,
# printing 'OK' when each function is correct.
# The starter code for each function includes a 'return'
# ... | false | true |
f735d7fc324285a6ec875c9f0d297b2c8400e2b9 | 3,995 | py | Python | tests/test_web_cli.py | ikamensh/aiohttp | d836d9b6b6050f9827e39997163a4b194a3a1314 | [
"Apache-2.0"
] | null | null | null | tests/test_web_cli.py | ikamensh/aiohttp | d836d9b6b6050f9827e39997163a4b194a3a1314 | [
"Apache-2.0"
] | null | null | null | tests/test_web_cli.py | ikamensh/aiohttp | d836d9b6b6050f9827e39997163a4b194a3a1314 | [
"Apache-2.0"
] | null | null | null | import pytest
from aiohttp import web
def test_entry_func_empty(mocker) -> None:
error = mocker.patch("aiohttp.web.ArgumentParser.error", side_effect=SystemExit)
argv = [""]
with pytest.raises(SystemExit):
web.main(argv)
error.assert_called_with("'entry-func' not in 'module:function' syntax... | 30.730769 | 88 | 0.701377 | import pytest
from aiohttp import web
def test_entry_func_empty(mocker) -> None:
error = mocker.patch("aiohttp.web.ArgumentParser.error", side_effect=SystemExit)
argv = [""]
with pytest.raises(SystemExit):
web.main(argv)
error.assert_called_with("'entry-func' not in 'module:function' syntax... | true | true |
f735d87a764933885e76c30d33d976d189285b6d | 16,617 | py | Python | mindhome_alpha/erpnext/accounts/report/general_ledger/general_ledger.py | Mindhome/field_service | 3aea428815147903eb9af1d0c1b4b9fc7faed057 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | mindhome_alpha/erpnext/accounts/report/general_ledger/general_ledger.py | Mindhome/field_service | 3aea428815147903eb9af1d0c1b4b9fc7faed057 | [
"MIT"
] | null | null | null | mindhome_alpha/erpnext/accounts/report/general_ledger/general_ledger.py | Mindhome/field_service | 3aea428815147903eb9af1d0c1b4b9fc7faed057 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, erpnext
from erpnext import get_company_currency, get_default_company
from erpnext.accounts.report.utils import get_currency, convert_to_... | 30.658672 | 257 | 0.719624 |
from __future__ import unicode_literals
import frappe, erpnext
from erpnext import get_company_currency, get_default_company
from erpnext.accounts.report.utils import get_currency, convert_to_presentation_currency
from frappe.utils import getdate, cstr, flt, fmt_money
from frappe import _, _dict
from erpnext.account... | true | true |
f735d895095411701d85cb27b09f83cd7ccb48b3 | 2,603 | py | Python | python/dask_cudf/setup.py | dominicshanshan/cudf | bfbdcb14164c737820a0a8a6334c92039d5e6621 | [
"Apache-2.0"
] | null | null | null | python/dask_cudf/setup.py | dominicshanshan/cudf | bfbdcb14164c737820a0a8a6334c92039d5e6621 | [
"Apache-2.0"
] | 1 | 2021-03-10T20:28:23.000Z | 2021-03-25T15:58:47.000Z | python/dask_cudf/setup.py | vyasr/cudf | 9617fcd452a66bdeb9c2275216e866b78f997508 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019-2021, NVIDIA CORPORATION.
import os
import re
import shutil
from setuptools import find_packages, setup
import versioneer
install_requires = [
"cudf",
"dask==2021.4.0",
"distributed>=2.22.0,<=2021.4.0",
"fsspec>=0.6.0",
"numpy",
"pandas>=1.0,<1.3.0dev0",
]
extras_requir... | 26.835052 | 78 | 0.623511 |
import os
import re
import shutil
from setuptools import find_packages, setup
import versioneer
install_requires = [
"cudf",
"dask==2021.4.0",
"distributed>=2.22.0,<=2021.4.0",
"fsspec>=0.6.0",
"numpy",
"pandas>=1.0,<1.3.0dev0",
]
extras_require = {
"test": [
"numpy",
"... | true | true |
f735d9417c94a77fd8ca0384ef7cbaaf9998e431 | 2,717 | py | Python | venv/Lib/site-packages/nbformat/v4/tests/test_convert.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 603 | 2020-12-23T13:49:32.000Z | 2022-03-31T23:38:03.000Z | venv/Lib/site-packages/nbformat/v4/tests/test_convert.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 387 | 2020-12-15T14:54:04.000Z | 2022-03-31T07:00:21.000Z | venv/Lib/site-packages/nbformat/v4/tests/test_convert.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 35 | 2021-03-26T03:12:04.000Z | 2022-03-23T10:15:10.000Z | # -*- coding: utf-8 -*-
import os
import io
import copy
from unittest import mock
from nbformat import validate
from .. import convert
from ..nbjson import reads
from . import nbexamples
from nbformat.v3.tests import nbexamples as v3examples
from nbformat import v3, v4
def test_upgrade_notebook():
nb03 = copy.de... | 29.532609 | 106 | 0.552448 |
import os
import io
import copy
from unittest import mock
from nbformat import validate
from .. import convert
from ..nbjson import reads
from . import nbexamples
from nbformat.v3.tests import nbexamples as v3examples
from nbformat import v3, v4
def test_upgrade_notebook():
nb03 = copy.deepcopy(v3examples.nb0)
... | true | true |
f735d97c51df40ed12b2c8c8b79166d319cf9203 | 4,720 | py | Python | Memory_RNN.py | dhingratul/RNN | 9e1ac582dbf8251769817b34fc9d791fa8c20376 | [
"MIT"
] | null | null | null | Memory_RNN.py | dhingratul/RNN | 9e1ac582dbf8251769817b34fc9d791fa8c20376 | [
"MIT"
] | null | null | null | Memory_RNN.py | dhingratul/RNN | 9e1ac582dbf8251769817b34fc9d791fa8c20376 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 24 11:28:50 2017
@author: dhingratul
"""
from __future__ import print_function, division
import numpy as np
import tensorflow as tf
import helpers
# hyperparams
num_epochs = 10000
total_series_length = 100
truncated_backprop_length = 5
state_size = ... | 37.165354 | 77 | 0.670763 |
from __future__ import print_function, division
import numpy as np
import tensorflow as tf
import helpers
num_epochs = 10000
total_series_length = 100
truncated_backprop_length = 5
state_size = 4
num_classes = 2
batch_size = 8
num_batches = total_series_length//batch_size//truncated_backprop_length
shift_b... | true | true |
f735d995a995275b81d6509ee58d925327c4d02a | 2,246 | py | Python | fewshot/data/compress_tiered_imagenet.py | ashok-arjun/few-shot-ssl-public | f7577d80b7491e0f27234a2e9c0113782365c2e1 | [
"MIT"
] | 497 | 2018-03-02T00:50:53.000Z | 2022-03-22T06:30:59.000Z | fewshot/data/compress_tiered_imagenet.py | eleniTriantafillou/few-shot-ssl-public | 3cf522031aa40b4ffb61e4693d0b48fdd5669276 | [
"MIT"
] | 20 | 2018-03-19T06:15:30.000Z | 2021-11-20T07:21:38.000Z | fewshot/data/compress_tiered_imagenet.py | eleniTriantafillou/few-shot-ssl-public | 3cf522031aa40b4ffb61e4693d0b48fdd5669276 | [
"MIT"
] | 108 | 2018-03-02T06:56:13.000Z | 2021-12-23T03:40:43.000Z | # Copyright (c) 2018 Mengye Ren, Eleni Triantafillou, Sachin Ravi, Jake Snell,
# Kevin Swersky, Joshua B. Tenenbaum, Hugo Larochelle, Richars S. Zemel.
#
# 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 th... | 36.225806 | 80 | 0.691897 |
import cv2
import numpy as np
import six
import sys
import pickle as pkl
from tqdm import tqdm
def compress(path, output):
with np.load(path, mmap_mode="r") as data:
images = data["images"]
array = []
for ii in tqdm(six.moves.xrange(images.shape[0]), desc='compress'):
im = im... | true | true |
f735db37f7d3724fd60e352c1e02af97aa1e9569 | 444 | py | Python | tests/transform/preprocessing/test_instance_unit_norm_scaler.py | selimfirat/pysad | dff2ff38258eb8a85c9d34cf5f0b876fc1dc9ede | [
"BSD-3-Clause"
] | 155 | 2020-08-17T12:52:38.000Z | 2022-03-19T02:59:26.000Z | tests/transform/preprocessing/test_instance_unit_norm_scaler.py | shubhsoni/pysad | dff2ff38258eb8a85c9d34cf5f0b876fc1dc9ede | [
"BSD-3-Clause"
] | 2 | 2020-10-22T09:50:28.000Z | 2021-02-15T02:01:44.000Z | tests/transform/preprocessing/test_instance_unit_norm_scaler.py | shubhsoni/pysad | dff2ff38258eb8a85c9d34cf5f0b876fc1dc9ede | [
"BSD-3-Clause"
] | 14 | 2020-10-09T17:08:23.000Z | 2022-03-25T11:30:12.000Z |
def test_instance_unit_norm_scaler():
import numpy as np
from pysad.transform.preprocessing import InstanceUnitNormScaler
X = np.random.rand(100, 25)
scaler = InstanceUnitNormScaler()
scaled_X = scaler.fit_transform(X)
assert np.all(np.isclose(np.linalg.norm(scaled_X, axis=1), 1.0))
sca... | 27.75 | 68 | 0.709459 |
def test_instance_unit_norm_scaler():
import numpy as np
from pysad.transform.preprocessing import InstanceUnitNormScaler
X = np.random.rand(100, 25)
scaler = InstanceUnitNormScaler()
scaled_X = scaler.fit_transform(X)
assert np.all(np.isclose(np.linalg.norm(scaled_X, axis=1), 1.0))
sca... | true | true |
f735dc85333b263fc7bc9284960f4d6199a4a30e | 815 | py | Python | irfca_blog/urls.py | abhishekadhikari23/irfca_blog | 2e14a52857304e17117177f1b1bc6f01c2b8d6e5 | [
"MIT"
] | null | null | null | irfca_blog/urls.py | abhishekadhikari23/irfca_blog | 2e14a52857304e17117177f1b1bc6f01c2b8d6e5 | [
"MIT"
] | null | null | null | irfca_blog/urls.py | abhishekadhikari23/irfca_blog | 2e14a52857304e17117177f1b1bc6f01c2b8d6e5 | [
"MIT"
] | null | null | null | """irfca_blog URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-ba... | 33.958333 | 77 | 0.704294 | from django.contrib import admin
from django.urls import path
from blog import views
urlpatterns = [
path('admin/', admin.site.urls),
path('', views.home, name='home' ),
]
| true | true |
f735ddf7c597a5a4b3a06b755753649d01e3fa15 | 5,892 | py | Python | oteltrace/contrib/django/conf.py | ocelotl/opentelemetry-auto-instr-python-1 | f5c47bd1ee492ffde298794f283031c22891f60b | [
"BSD-3-Clause"
] | 2 | 2020-03-04T17:33:22.000Z | 2021-01-20T14:20:10.000Z | oteltrace/contrib/django/conf.py | ocelotl/opentelemetry-auto-instr-python-1 | f5c47bd1ee492ffde298794f283031c22891f60b | [
"BSD-3-Clause"
] | 4 | 2019-11-25T00:11:16.000Z | 2021-05-13T20:43:50.000Z | oteltrace/contrib/django/conf.py | ocelotl/opentelemetry-auto-instr-python-1 | f5c47bd1ee492ffde298794f283031c22891f60b | [
"BSD-3-Clause"
] | 3 | 2020-02-05T14:54:25.000Z | 2020-03-23T02:51:27.000Z | # Copyright 2019, OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 33.101124 | 104 | 0.667006 |
from __future__ import unicode_literals
import os
import importlib
from django.conf import settings as django_settings
from ...internal.logger import get_logger
log = get_logger(__name__)
DEFAULTS = {
'AGENT_HOSTNAME': 'localhost',
'AGENT_PORT': 8126,
'AUTO_INSTRUMENT': True,
'INSTR... | true | true |
f735e01c64e62313be6f9983c47ef6c910fb9043 | 3,904 | py | Python | app/recipe/views.py | jhgutsol1290/recipe-app-api | 1c2ca015a05b0309f80b074e4df08e5180a1cbe7 | [
"MIT"
] | null | null | null | app/recipe/views.py | jhgutsol1290/recipe-app-api | 1c2ca015a05b0309f80b074e4df08e5180a1cbe7 | [
"MIT"
] | null | null | null | app/recipe/views.py | jhgutsol1290/recipe-app-api | 1c2ca015a05b0309f80b074e4df08e5180a1cbe7 | [
"MIT"
] | null | null | null | from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework import viewsets, mixins, status
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from core.models import Tag, Ingredient, Recipe
from recipe... | 33.655172 | 74 | 0.660092 | from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework import viewsets, mixins, status
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from core.models import Tag, Ingredient, Recipe
from recipe... | true | true |
f735e065a680a895d5a324a0b9b4e185811f440e | 1,040 | py | Python | test_sample.py | corganhejijun/frontal-trans | 1509babf2447a53a772703b09cb6a2daec6968a7 | [
"MIT"
] | 6 | 2019-10-07T07:34:28.000Z | 2020-11-17T13:04:37.000Z | test_sample.py | corganhejijun/frontal-trans | 1509babf2447a53a772703b09cb6a2daec6968a7 | [
"MIT"
] | 3 | 2019-09-18T09:56:36.000Z | 2020-11-25T09:54:06.000Z | test_sample.py | corganhejijun/frontal-trans | 1509babf2447a53a772703b09cb6a2daec6968a7 | [
"MIT"
] | 3 | 2019-11-01T04:39:07.000Z | 2021-04-21T08:19:19.000Z | # -*- coding: utf-8 -*-
import os
import cv2
from scipy import misc
from PIL import Image
sample_path = 'datasets/celeb_train/lfw_trans'
dest_path = sample_path + "/../dest"
middleSize = 64
imgSize = 256
kernel_size = (5, 5)
sigma = 5
if not os.path.exists(dest_path):
os.mkdir(dest_path)
fileList = os.listdir(s... | 33.548387 | 78 | 0.683654 |
import os
import cv2
from scipy import misc
from PIL import Image
sample_path = 'datasets/celeb_train/lfw_trans'
dest_path = sample_path + "/../dest"
middleSize = 64
imgSize = 256
kernel_size = (5, 5)
sigma = 5
if not os.path.exists(dest_path):
os.mkdir(dest_path)
fileList = os.listdir(sample_path)
for index, f... | true | true |
f735e0b0bfb2b3d775aacd5ba8c56eb9fc4ac69b | 3,506 | py | Python | gmn/src/d1_gmn/app/node_registry.py | DataONEorg/d1_python | dfab267c3adea913ab0e0073ed9dc1ee50b5b8eb | [
"Apache-2.0"
] | 15 | 2016-10-28T13:56:52.000Z | 2022-01-31T19:07:49.000Z | gmn/src/d1_gmn/app/node_registry.py | DataONEorg/d1_python | dfab267c3adea913ab0e0073ed9dc1ee50b5b8eb | [
"Apache-2.0"
] | 56 | 2017-03-16T03:52:32.000Z | 2022-03-12T01:05:28.000Z | gmn/src/d1_gmn/app/node_registry.py | DataONEorg/d1_python | dfab267c3adea913ab0e0073ed9dc1ee50b5b8eb | [
"Apache-2.0"
] | 11 | 2016-05-31T16:22:02.000Z | 2020-10-05T14:37:10.000Z | # This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2019 DataONE
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ma... | 31.303571 | 89 | 0.684541 |
import logging
import d1_common.xml
import d1_client.cnclient
import django.conf
import django.core.cache
log = logging.getLogger(__name__)
def get_cn_subjects():
cn_subjects = django.core.cache.cache.get("cn_subjects")
if cn_subjects is not None:
return cn_subjects
if djang... | true | true |
f735e13bab66faf531dc0c6b42371e197f6d91a6 | 3,037 | py | Python | freezeyt/cli.py | encukou/freezeyt | f0783bb3e001f181ce33718b0cbd2ddbd0e56af0 | [
"MIT"
] | 7 | 2020-09-23T15:27:09.000Z | 2022-03-20T19:31:41.000Z | freezeyt/cli.py | encukou/freezeyt | f0783bb3e001f181ce33718b0cbd2ddbd0e56af0 | [
"MIT"
] | 160 | 2020-07-06T17:58:35.000Z | 2022-03-30T13:06:07.000Z | freezeyt/cli.py | encukou/freezeyt | f0783bb3e001f181ce33718b0cbd2ddbd0e56af0 | [
"MIT"
] | 10 | 2020-07-06T18:05:10.000Z | 2022-03-12T21:20:11.000Z | import sys
import click
import yaml
from freezeyt.freezer import freeze
from freezeyt.util import import_variable_from_module
@click.command()
@click.argument('module_name')
@click.argument('dest_path', required=False)
@click.option('--prefix',
help='URL where we want to deploy our static site '
... | 31.309278 | 96 | 0.609812 | import sys
import click
import yaml
from freezeyt.freezer import freeze
from freezeyt.util import import_variable_from_module
@click.command()
@click.argument('module_name')
@click.argument('dest_path', required=False)
@click.option('--prefix',
help='URL where we want to deploy our static site '
... | true | true |
f735e15ae6ba7a49fa2a7da756be5fc32bfde867 | 227 | py | Python | learn-to-code-with-python/17-Dictionaries-the-Basics/the-in-and-not-in-operators-on-a-dictionary.py | MaciejZurek/python_practicing | 0a426f2aed151573e1f8678e0239ff596d92bbde | [
"MIT"
] | null | null | null | learn-to-code-with-python/17-Dictionaries-the-Basics/the-in-and-not-in-operators-on-a-dictionary.py | MaciejZurek/python_practicing | 0a426f2aed151573e1f8678e0239ff596d92bbde | [
"MIT"
] | null | null | null | learn-to-code-with-python/17-Dictionaries-the-Basics/the-in-and-not-in-operators-on-a-dictionary.py | MaciejZurek/python_practicing | 0a426f2aed151573e1f8678e0239ff596d92bbde | [
"MIT"
] | null | null | null | pokemon = {
"Fire": ["Charmander", "Charmeleon", "Charizard"],
"Water": ["Squirtle", "Warturtle", "Blastiose"],
"Grass": ["Bulbasaur", "Venusaur", "Ivysaur"]
}
print("Fire" in pokemon)
print("Electric" in pokemon)
| 25.222222 | 54 | 0.61674 | pokemon = {
"Fire": ["Charmander", "Charmeleon", "Charizard"],
"Water": ["Squirtle", "Warturtle", "Blastiose"],
"Grass": ["Bulbasaur", "Venusaur", "Ivysaur"]
}
print("Fire" in pokemon)
print("Electric" in pokemon)
| true | true |
f735e2a9e13dbd62de2c29ea355c89e45b70252a | 2,380 | py | Python | amime/modules/anime/TV-SHOW/KATEGORI/MAHOU SHOUJO/ktgr_action3.py | Myudi422/ccgnime_req | a0f7596ba101204539b4120dffa08912b6560efe | [
"MIT"
] | null | null | null | amime/modules/anime/TV-SHOW/KATEGORI/MAHOU SHOUJO/ktgr_action3.py | Myudi422/ccgnime_req | a0f7596ba101204539b4120dffa08912b6560efe | [
"MIT"
] | null | null | null | amime/modules/anime/TV-SHOW/KATEGORI/MAHOU SHOUJO/ktgr_action3.py | Myudi422/ccgnime_req | a0f7596ba101204539b4120dffa08912b6560efe | [
"MIT"
] | null | null | null | import httpx
from anilist.types import Anime
from pyrogram import filters
from pyrogram.types import CallbackQuery
from pyromod.helpers import ikb
from pyromod.nav import Pagination
from amime.amime import Amime
@Amime.on_callback_query(filters.regex(r"^tv_mahousj3 anime (?P<page>\d+)"))
async def anime_suggestions(... | 32.162162 | 118 | 0.485714 | import httpx
from anilist.types import Anime
from pyrogram import filters
from pyrogram.types import CallbackQuery
from pyromod.helpers import ikb
from pyromod.nav import Pagination
from amime.amime import Amime
@Amime.on_callback_query(filters.regex(r"^tv_mahousj3 anime (?P<page>\d+)"))
async def anime_suggestions(... | true | true |
f735e2aea9b9012219f860b604255299c65e9e32 | 593 | py | Python | test_ucf101.py | mental689/pytorch-c3d | 578bf43a2628decc50fd554437668d5490f6e77d | [
"Apache-2.0"
] | 3 | 2019-03-15T17:42:26.000Z | 2021-11-18T04:17:16.000Z | test_ucf101.py | mental689/pytorch-c3d | 578bf43a2628decc50fd554437668d5490f6e77d | [
"Apache-2.0"
] | null | null | null | test_ucf101.py | mental689/pytorch-c3d | 578bf43a2628decc50fd554437668d5490f6e77d | [
"Apache-2.0"
] | 1 | 2019-03-15T17:42:38.000Z | 2019-03-15T17:42:38.000Z | # coding: utf-8
from network.trainer import *
video_train_list = '/media/tuananhn/903a7d3c-0ce5-444b-ad39-384fcda231ed/UCF101/video-caffe/examples/c3d_ucf101/c3d_ucf101_train_split1.txt'
video_test_list = '/media/tuananhn/903a7d3c-0ce5-444b-ad39-384fcda231ed/UCF101/video-caffe/examples/c3d_ucf101/c3d_ucf101_test_split1... | 65.888889 | 140 | 0.789207 |
from network.trainer import *
video_train_list = '/media/tuananhn/903a7d3c-0ce5-444b-ad39-384fcda231ed/UCF101/video-caffe/examples/c3d_ucf101/c3d_ucf101_train_split1.txt'
video_test_list = '/media/tuananhn/903a7d3c-0ce5-444b-ad39-384fcda231ed/UCF101/video-caffe/examples/c3d_ucf101/c3d_ucf101_test_split1.txt'
trainer =... | true | true |
f735e312a81e88978793ec77d681c3348d55b18e | 14,779 | py | Python | niapy/algorithms/modified/saba.py | altaregos/NiaPy | 74f1b2827778d9086603f4a8cb523f6b5537212a | [
"MIT"
] | 202 | 2018-02-06T12:13:42.000Z | 2022-03-18T16:33:20.000Z | niapy/algorithms/modified/saba.py | altaregos/NiaPy | 74f1b2827778d9086603f4a8cb523f6b5537212a | [
"MIT"
] | 262 | 2018-02-06T14:49:15.000Z | 2022-03-25T19:49:46.000Z | niapy/algorithms/modified/saba.py | altaregos/NiaPy | 74f1b2827778d9086603f4a8cb523f6b5537212a | [
"MIT"
] | 136 | 2018-02-06T16:55:32.000Z | 2022-03-05T17:49:52.000Z | # encoding=utf8
import logging
import numpy as np
from niapy.algorithms.algorithm import Algorithm
logging.basicConfig()
logger = logging.getLogger('niapy.algorithms.modified')
logger.setLevel('INFO')
__all__ = ['AdaptiveBatAlgorithm', 'SelfAdaptiveBatAlgorithm']
class AdaptiveBatAlgorithm(Algorithm):
r"""Imp... | 37.41519 | 145 | 0.619528 |
import logging
import numpy as np
from niapy.algorithms.algorithm import Algorithm
logging.basicConfig()
logger = logging.getLogger('niapy.algorithms.modified')
logger.setLevel('INFO')
__all__ = ['AdaptiveBatAlgorithm', 'SelfAdaptiveBatAlgorithm']
class AdaptiveBatAlgorithm(Algorithm):
Name = ['AdaptiveBatA... | true | true |
f735e42af71bfc4069df8d626b6ce697fcedc245 | 1,726 | py | Python | ml-project/extract_face_yusril.py | YusrilHasanuddin/bangkit-capstone-CAP0166 | 51742f7af47fa285154793a6ea74de1d78d945b3 | [
"MIT"
] | 2 | 2021-07-20T17:31:29.000Z | 2021-12-27T06:42:42.000Z | ml-project/extract_face_yusril.py | YusrilHasanuddin/bangkit-capstone-CAP0166 | 51742f7af47fa285154793a6ea74de1d78d945b3 | [
"MIT"
] | 26 | 2021-05-02T14:05:27.000Z | 2021-06-06T14:22:35.000Z | ml-project/extract_face_yusril.py | YusrilHasanuddin/bangkit-capstone-CAP0166 | 51742f7af47fa285154793a6ea74de1d78d945b3 | [
"MIT"
] | 3 | 2021-05-23T06:13:14.000Z | 2021-06-09T11:04:29.000Z | import sys
import os
import traceback
from PIL import Image
from facenet_pytorch import MTCNN
import matplotlib.image as mpimg
import numpy as np
def detect_faces(image_path):
mtcnn = MTCNN(margin=20, keep_all=True,
post_process=False, device='cuda:0')
image = image_path
image = mpimg.im... | 31.962963 | 74 | 0.584009 | import sys
import os
import traceback
from PIL import Image
from facenet_pytorch import MTCNN
import matplotlib.image as mpimg
import numpy as np
def detect_faces(image_path):
mtcnn = MTCNN(margin=20, keep_all=True,
post_process=False, device='cuda:0')
image = image_path
image = mpimg.im... | true | true |
f735e441dcf5ae886a87accea2eb267ceb2901ee | 358 | py | Python | nms_stack/nms_cli/nms_stack/roles/ansible-role-glusterfs/molecule/default/tests/test_default.py | kkkkv/tgnms | a3b8fd8a69b647a614f9856933f05e50a4affadf | [
"MIT"
] | 12 | 2021-04-06T06:27:18.000Z | 2022-03-18T10:52:29.000Z | nms_stack/nms_cli/nms_stack/roles/ansible-role-glusterfs/molecule/default/tests/test_default.py | kkkkv/tgnms | a3b8fd8a69b647a614f9856933f05e50a4affadf | [
"MIT"
] | 6 | 2022-01-04T13:32:16.000Z | 2022-03-28T21:13:59.000Z | nms_stack/nms_cli/nms_stack/roles/ansible-role-glusterfs/molecule/default/tests/test_default.py | kkkkv/tgnms | a3b8fd8a69b647a614f9856933f05e50a4affadf | [
"MIT"
] | 7 | 2021-09-27T13:14:42.000Z | 2022-03-28T16:24:15.000Z | # Copyright (c) 2014-present, Facebook, Inc.
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_hosts_file(host):
f = host.file('/etc/hosts')
assert f.exists
assert f.user =... | 22.375 | 63 | 0.717877 |
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_hosts_file(host):
f = host.file('/etc/hosts')
assert f.exists
assert f.user == 'root'
assert f.group == 'root'
| true | true |
f735e520bdc3adc6f904a5797629bf0a08ce182c | 1,653 | py | Python | homeassistant/components/asuswrt/__init__.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 3 | 2020-11-27T06:26:27.000Z | 2020-12-09T14:55:16.000Z | homeassistant/components/asuswrt/__init__.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 25 | 2021-11-24T06:24:10.000Z | 2022-03-31T06:23:06.000Z | homeassistant/components/asuswrt/__init__.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 3 | 2022-01-02T18:49:54.000Z | 2022-01-25T02:03:54.000Z | """Support for ASUSWRT devices."""
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import EVENT_HOMEASSISTANT_STOP, Platform
from homeassistant.core import HomeAssistant
from .const import DATA_ASUSWRT, DOMAIN
from .router import AsusWrtRouter
PLATFORMS = [Platform.DEVICE_TRACKER, Platf... | 31.788462 | 87 | 0.745312 |
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import EVENT_HOMEASSISTANT_STOP, Platform
from homeassistant.core import HomeAssistant
from .const import DATA_ASUSWRT, DOMAIN
from .router import AsusWrtRouter
PLATFORMS = [Platform.DEVICE_TRACKER, Platform.SENSOR]
async def async_setup... | true | true |
f735e533e4d7419d51f09dc7c83e8618f578b234 | 6,225 | py | Python | isimip_publisher/tests/test_commands.py | ISI-MIP/isimip-publisher | d54f7325931df91c98e40c924eac085351fc5813 | [
"MIT"
] | null | null | null | isimip_publisher/tests/test_commands.py | ISI-MIP/isimip-publisher | d54f7325931df91c98e40c924eac085351fc5813 | [
"MIT"
] | 44 | 2019-12-04T10:47:13.000Z | 2021-03-29T16:43:06.000Z | isimip_publisher/tests/test_commands.py | ISI-MIP/isimip-publisher | d54f7325931df91c98e40c924eac085351fc5813 | [
"MIT"
] | 1 | 2019-12-04T09:09:26.000Z | 2019-12-04T09:09:26.000Z | import os
import shutil
from pathlib import Path
import pytest
from dotenv import load_dotenv
from isimip_publisher.utils.database import (Dataset, Resource,
init_database_session)
@pytest.fixture(scope='session')
def setup():
load_dotenv(Path().cwd() / '.env')
... | 35.571429 | 130 | 0.744418 | import os
import shutil
from pathlib import Path
import pytest
from dotenv import load_dotenv
from isimip_publisher.utils.database import (Dataset, Resource,
init_database_session)
@pytest.fixture(scope='session')
def setup():
load_dotenv(Path().cwd() / '.env')
... | true | true |
f735e5b4e2f72c64bab1404d35d76c84bea5704e | 1,404 | py | Python | pyweb/cli.py | gera2ld/pyhttpd | c7bbfd8ba22f09da1200a4d570ce128d83e5f82c | [
"MIT"
] | 2 | 2015-08-25T10:30:25.000Z | 2017-05-01T10:12:59.000Z | pyweb/cli.py | gera2ld/pyweb | c7bbfd8ba22f09da1200a4d570ce128d83e5f82c | [
"MIT"
] | null | null | null | pyweb/cli.py | gera2ld/pyweb | c7bbfd8ba22f09da1200a4d570ce128d83e5f82c | [
"MIT"
] | 1 | 2015-05-07T01:41:00.000Z | 2015-05-07T01:41:00.000Z | # -*- coding: utf-8 -*-
"""Console script for pyweb."""
import os
import sys
import platform
import click
from . import __version__
from .server import HTTPDaemon
from .utils import logger
@click.command()
@click.option('-b', '--bind', default=':4000', help='the address to bind, default as `:4000`')
@click.option('-r... | 25.527273 | 94 | 0.458689 |
import os
import sys
import platform
import click
from . import __version__
from .server import HTTPDaemon
from .utils import logger
@click.command()
@click.option('-b', '--bind', default=':4000', help='the address to bind, default as `:4000`')
@click.option('-r', '--root', default='.', help='the root directory of d... | true | true |
f735e5ce1ca1a10327b8aa4b68252afb05835453 | 34,509 | py | Python | pelicun/model.py | 13273781142/pelicun1 | 1177f069a083a25eb53ae7a9ddfa6c814660a423 | [
"BSD-3-Clause"
] | 20 | 2019-03-01T21:51:15.000Z | 2022-02-25T11:51:13.000Z | pelicun/model.py | 13273781142/pelicun1 | 1177f069a083a25eb53ae7a9ddfa6c814660a423 | [
"BSD-3-Clause"
] | 7 | 2018-12-04T18:55:39.000Z | 2021-09-26T00:20:34.000Z | pelicun/model.py | 13273781142/pelicun1 | 1177f069a083a25eb53ae7a9ddfa6c814660a423 | [
"BSD-3-Clause"
] | 14 | 2018-10-26T21:48:44.000Z | 2022-02-28T01:53:40.000Z | # -*- coding: utf-8 -*-
#
# Copyright (c) 2018 Leland Stanford Junior University
# Copyright (c) 2018 The Regents of the University of California
#
# This file is part of pelicun.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ... | 40.598824 | 86 | 0.663131 |
from .base import *
class FragilityFunction(object):
def __init__(self, EDP_limit):
self._EDP_limit = EDP_limit
self._EDP_tags = [EDP_lim_i.name for EDP_lim_i in EDP_limit]
def P_exc(self, EDP, DSG_ID):
EDP = np.asarray(EDP, dtype=np.float64)
... | true | true |
f735e7a4939d5cc1f3c6d92e39265e3f54d99be0 | 2,093 | py | Python | old_game/spells/base.py | jwvhewitt/dmeternal | bb09f2d497daf9b40dd8cfee10c55be55fb7c3cb | [
"Apache-2.0"
] | 53 | 2015-07-03T21:25:36.000Z | 2022-02-18T23:08:38.000Z | old_game/spells/base.py | jwvhewitt/dmeternal | bb09f2d497daf9b40dd8cfee10c55be55fb7c3cb | [
"Apache-2.0"
] | 5 | 2015-07-03T21:27:12.000Z | 2016-12-08T14:40:38.000Z | old_game/spells/base.py | jwvhewitt/dmeternal | bb09f2d497daf9b40dd8cfee10c55be55fb7c3cb | [
"Apache-2.0"
] | 14 | 2016-02-02T06:49:51.000Z | 2022-02-24T13:24:35.000Z | from .. import invocations
# Enumerate some constants for the six spell colors.
SOLAR, EARTH, WATER, FIRE, AIR, LUNAR = list(range( 6))
class Spell( invocations.Invocation ):
def __init__( self, name, desc, fx, rank=1, gems=dict(), mpfudge=0, com_tar=None, exp_tar=None, ai_tar=None, shot_anim=None ):
self... | 36.086207 | 134 | 0.557573 | from .. import invocations
SOLAR, EARTH, WATER, FIRE, AIR, LUNAR = list(range( 6))
class Spell( invocations.Invocation ):
def __init__( self, name, desc, fx, rank=1, gems=dict(), mpfudge=0, com_tar=None, exp_tar=None, ai_tar=None, shot_anim=None ):
self.name=name
self.desc = desc
self.fx ... | true | true |
f735e7b770f1da0d8886b0e78f5cda6a16931206 | 24,389 | py | Python | release/scripts/startup/bl_ui/space_topbar.py | vlobanov/blender | 5c58740a08ef369435b48093b91fa7075fef8383 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | release/scripts/startup/bl_ui/space_topbar.py | vlobanov/blender | 5c58740a08ef369435b48093b91fa7075fef8383 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | release/scripts/startup/bl_ui/space_topbar.py | vlobanov/blender | 5c58740a08ef369435b48093b91fa7075fef8383 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2019-09-13T15:29:14.000Z | 2019-09-13T15:29:14.000Z | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 30.334577 | 104 | 0.613801 | f, context):
layout = self.layout
window = context.window
screen = context.screen
TOPBAR_MT_editor_menus.draw_collapsible(context, layout)
layout.separator()
if not screen.show_fullscreen:
layout.template_ID_tabs(
window, "workspace",
... | true | true |
f735e8029c232fc98daab344aa931b6c8667ee1a | 5,397 | py | Python | example_unity_socket.py | sailab-code/SAILenv | e202be04de468a58e58ae858693245f5556c3597 | [
"MIT"
] | null | null | null | example_unity_socket.py | sailab-code/SAILenv | e202be04de468a58e58ae858693245f5556c3597 | [
"MIT"
] | 1 | 2021-02-25T16:47:39.000Z | 2021-04-22T08:08:53.000Z | example_unity_socket.py | sailab-code/SAILenv | e202be04de468a58e58ae858693245f5556c3597 | [
"MIT"
] | 2 | 2021-05-01T12:42:53.000Z | 2021-07-10T06:46:44.000Z | #
# Copyright (C) 2020 Enrico Meloni, Luca Pasqualini, Matteo Tiezzi
# University of Siena - Artificial Intelligence Laboratory - SAILab
#
#
# SAILenv is licensed under a MIT license.
#
# You should have received a copy of the license along with this
# work. If not, see <https://en.wikipedia.org/wiki/MIT_License>.
# ... | 32.512048 | 106 | 0.576987 |
import time
import numpy as np
import cv2
import tkinter as tk
from PIL import Image, ImageTk
from sailenv.agent import Agent
frames: int = 1000
def decode_image(array: np.ndarray):
image = cv2.cvtColor(array, cv2.COLOR_RGB2BGR)
return image
def draw_flow_lines(current_frame, optical_flow, ... | true | true |
f735e9ed972bd701f8c000f77a88cedb63fe8f5b | 14,425 | py | Python | src/AzureFunctions/ComputeGradient/AzureUtilities.py | georgeAccnt-GH/Azure2019 | 5c9774b644d3ea15590d72d3de9363df72abf7ab | [
"MIT"
] | 2 | 2020-09-18T09:18:06.000Z | 2021-01-10T05:26:53.000Z | src/AzureFunctions/ComputeGradient/AzureUtilities.py | georgeAccnt-GH/Azure2019 | 5c9774b644d3ea15590d72d3de9363df72abf7ab | [
"MIT"
] | 1 | 2021-04-16T06:21:14.000Z | 2021-04-16T16:29:43.000Z | src/AzureFunctions/ComputeGradient/AzureUtilities.py | georgeAccnt-GH/Azure2019 | 5c9774b644d3ea15590d72d3de9363df72abf7ab | [
"MIT"
] | 1 | 2020-01-23T21:45:49.000Z | 2020-01-23T21:45:49.000Z | import numpy as np
import segyio
import subprocess
import os, h5py
from scipy import interpolate
from devito import Eq, Operator
from azure.storage.blob import BlockBlobService, PublicAccess
blob_service = BlockBlobService(account_name='', account_key='')
##############################################################... | 33.941176 | 164 | 0.590017 | import numpy as np
import segyio
import subprocess
import os, h5py
from scipy import interpolate
from devito import Eq, Operator
from azure.storage.blob import BlockBlobService, PublicAccess
blob_service = BlockBlobService(account_name='', account_key='')
| true | true |
f735ea24e6fd85bb1e3da23800a0230330cffa36 | 419 | py | Python | Leak #5 - Lost In Translation/windows/Resources/Dsz/PyScripts/Lib/dsz/mca/install/cmd/shutdown/tasking_dsz.py | bidhata/EquationGroupLeaks | 1ff4bc115cb2bd5bf2ed6bf769af44392926830c | [
"Unlicense"
] | 9 | 2019-11-22T04:58:40.000Z | 2022-02-26T16:47:28.000Z | Leak #5 - Lost In Translation/windows/Resources/Dsz/PyScripts/Lib/dsz/mca/install/cmd/shutdown/tasking_dsz.py | bidhata/EquationGroupLeaks | 1ff4bc115cb2bd5bf2ed6bf769af44392926830c | [
"Unlicense"
] | null | null | null | Leak #5 - Lost In Translation/windows/Resources/Dsz/PyScripts/Lib/dsz/mca/install/cmd/shutdown/tasking_dsz.py | bidhata/EquationGroupLeaks | 1ff4bc115cb2bd5bf2ed6bf769af44392926830c | [
"Unlicense"
] | 8 | 2017-09-27T10:31:18.000Z | 2022-01-08T10:30:46.000Z | # uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: tasking_dsz.py
import mcl.framework
import mcl.tasking
class dsz:
INTERFACE = 16842801
PFAM = 4159
PROVIDER_ANY = 4159
PROVIDER = 16... | 29.928571 | 92 | 0.720764 |
import mcl.framework
import mcl.tasking
class dsz:
INTERFACE = 16842801
PFAM = 4159
PROVIDER_ANY = 4159
PROVIDER = 16846911
RPC_INFO_SHUTDOWN = mcl.tasking.RpcInfo(mcl.framework.DSZ, [INTERFACE, PROVIDER_ANY, 0]) | true | true |
f735ea3e98c2932b4eebe3ab870b9d47c441fccc | 1,673 | py | Python | src/test/testcases/testIstepInvalid.py | madscientist159/sbe | 63aa1d2be90d345001937953370c3f4e1536e513 | [
"Apache-2.0"
] | null | null | null | src/test/testcases/testIstepInvalid.py | madscientist159/sbe | 63aa1d2be90d345001937953370c3f4e1536e513 | [
"Apache-2.0"
] | null | null | null | src/test/testcases/testIstepInvalid.py | madscientist159/sbe | 63aa1d2be90d345001937953370c3f4e1536e513 | [
"Apache-2.0"
] | null | null | null | # IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/test/testcases/testIstepInvalid.py $
#
# OpenPOWER sbe Project
#
# Contributors Listed Below - COPYRIGHT 2015,2016
# [+] International Business Machines Corp.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ... | 27.883333 | 69 | 0.641363 |
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
err = False
TESTDATA = [0,0,0,3,
0,0,0xA1,0x01,
0,0x02,0x00,0x1]
EXPDATA = [0xc0,0xde,0xa1,0x01,
0x00,0x02,0x00,0x0A,
0x00,0x0,0x0,0x03];
def main( ):
testUtil.runCycl... | true | true |
f735ebe8c181c4ca65d623419c429c65ce0e1e7a | 1,160 | py | Python | users/tests/test_forms.py | EaguaireSama/CodePanda | ebc7ca9246df6463430f04d4b08124ef2ba2c3f6 | [
"MIT"
] | 1 | 2021-04-17T18:32:51.000Z | 2021-04-17T18:32:51.000Z | users/tests/test_forms.py | EaguaireSama/CodePanda | ebc7ca9246df6463430f04d4b08124ef2ba2c3f6 | [
"MIT"
] | null | null | null | users/tests/test_forms.py | EaguaireSama/CodePanda | ebc7ca9246df6463430f04d4b08124ef2ba2c3f6 | [
"MIT"
] | 3 | 2021-04-10T15:20:46.000Z | 2021-04-11T12:04:57.000Z | from django.test import TestCase
from django.contrib.auth.models import User
from users.forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm
class TestForms(TestCase):
def test_user_register_form_valid(self):
form = UserRegisterForm(
data = {
'username' :"user2",
'email' : "user2@email.com",
... | 21.481481 | 76 | 0.672414 | from django.test import TestCase
from django.contrib.auth.models import User
from users.forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm
class TestForms(TestCase):
def test_user_register_form_valid(self):
form = UserRegisterForm(
data = {
'username' :"user2",
'email' : "user2@email.com",
... | true | true |
f735ec17ddf645bf613f2789c946c6c81183fceb | 1,696 | py | Python | payment/views.py | caioaraujo/bakery_payments_api_v2 | ade365bd2aa9561182be982286caa72923f36e13 | [
"MIT"
] | 4 | 2019-06-01T23:51:20.000Z | 2021-02-24T11:23:31.000Z | payment/views.py | caioaraujo/bakery_payments_api_v2 | ade365bd2aa9561182be982286caa72923f36e13 | [
"MIT"
] | 8 | 2020-06-13T23:10:46.000Z | 2022-02-28T13:58:02.000Z | payment/views.py | caioaraujo/bakery_payments_api_v2 | ade365bd2aa9561182be982286caa72923f36e13 | [
"MIT"
] | 1 | 2022-03-22T04:54:35.000Z | 2022-03-22T04:54:35.000Z | from django.utils.translation import ugettext as _
from rest_framework.generics import GenericAPIView
from rest_framework.response import Response
from .serializers import PaymentInputSerializer, PaymentPatchSerializer, PaymentResponseSerializer
from .services import PaymentService
class PaymentView(GenericAPIView):... | 30.836364 | 98 | 0.668632 | from django.utils.translation import ugettext as _
from rest_framework.generics import GenericAPIView
from rest_framework.response import Response
from .serializers import PaymentInputSerializer, PaymentPatchSerializer, PaymentResponseSerializer
from .services import PaymentService
class PaymentView(GenericAPIView):... | true | true |
f735ec7fb88fb24ceaca3d1817d3585bcfaba514 | 10,306 | py | Python | CBGM/mpisupport.py | catsmith/CBGM | 4fb85c6a0c67b6d790c94aa8d17284b66fc6206a | [
"MIT"
] | 8 | 2019-11-12T14:06:18.000Z | 2021-10-31T03:10:36.000Z | CBGM/mpisupport.py | catsmith/CBGM | 4fb85c6a0c67b6d790c94aa8d17284b66fc6206a | [
"MIT"
] | 1 | 2018-11-27T18:04:27.000Z | 2018-11-27T18:08:27.000Z | CBGM/mpisupport.py | catsmith/CBGM | 4fb85c6a0c67b6d790c94aa8d17284b66fc6206a | [
"MIT"
] | 2 | 2020-01-06T12:04:27.000Z | 2021-07-14T17:03:13.000Z | """
OpenMPI support wrapper
"""
import threading
import queue
import logging
import time
import resource
logger = logging.getLogger()
try:
from mpi4py import MPI
except ImportError:
logger.warning("MPI support unavailable")
def is_parent():
return MPI.COMM_WORLD.Get_rank() == 0
CHILD_RETRY_HELLO = 6... | 33.570033 | 160 | 0.555016 |
import threading
import queue
import logging
import time
import resource
logger = logging.getLogger()
try:
from mpi4py import MPI
except ImportError:
logger.warning("MPI support unavailable")
def is_parent():
return MPI.COMM_WORLD.Get_rank() == 0
CHILD_RETRY_HELLO = 60
class MpiParent(object):
... | true | true |
f735ecc745344aa1dc9776c189e320d619c7fee5 | 8,205 | py | Python | sphinx/source/conf.py | menefotto/Kats | 3fc8a3f819502d45736734eabb3601f42a6b7759 | [
"MIT"
] | 1 | 2021-06-22T03:40:33.000Z | 2021-06-22T03:40:33.000Z | sphinx/source/conf.py | menefotto/Kats | 3fc8a3f819502d45736734eabb3601f42a6b7759 | [
"MIT"
] | null | null | null | sphinx/source/conf.py | menefotto/Kats | 3fc8a3f819502d45736734eabb3601f42a6b7759 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
# fmt: off
#
# Kats documentation build configuration file.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# auto... | 32.30315 | 79 | 0.709324 |
import os
import sys
sys.path.insert(0, os.path.abspath(".."))
extensions = [
"sphinx.ext.napoleon",
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.coverage",
"sphinx.ext.viewcode",
]
templates_path = ["_templates"]
source_suffi... | true | true |
f735eda6a7910c11a095f6cddcd4998435bc09a3 | 5,473 | py | Python | docs/conf.py | webbhuset/pipeline | 5e838c9a1b25f4dd72060202b7730ae3c71ea024 | [
"MIT"
] | null | null | null | docs/conf.py | webbhuset/pipeline | 5e838c9a1b25f4dd72060202b7730ae3c71ea024 | [
"MIT"
] | null | null | null | docs/conf.py | webbhuset/pipeline | 5e838c9a1b25f4dd72060202b7730ae3c71ea024 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 29.583784 | 79 | 0.661612 |
from sphinx.highlighting import lexers
from pygments.lexers.web import PhpLexer
project = u'Pipeline'
copyright = u'2018, Webbhuset AB'
author = u'Webbhuset AB'
version = u''
release = u''
extensions = [
]
templates_path = ['_templates']
source_suffix = ['.rst']
master_do... | true | true |
f735ee0c9e1e28a8ec6d114097af7d6120e0d6fe | 1,839 | py | Python | game_data.py | EthanRiley/Arkon | fe1dff2bdc8e783aae6d6b9ed975f792ab8f926a | [
"MIT"
] | 3 | 2016-03-11T19:17:17.000Z | 2016-03-12T13:49:01.000Z | game_data.py | EthanRiley/Arkon | fe1dff2bdc8e783aae6d6b9ed975f792ab8f926a | [
"MIT"
] | null | null | null | game_data.py | EthanRiley/Arkon | fe1dff2bdc8e783aae6d6b9ed975f792ab8f926a | [
"MIT"
] | null | null | null | import pygame, os, re, pygame.freetype
from pygame.locals import *
pygame.init()
class resource_handler(object):
def get_data_from_folder(self, data_dir, extension, iterfunc):
data = []
for file in os.listdir(data_dir):
if extension in file:
data.append({ 'name': file,... | 27.863636 | 79 | 0.612289 | import pygame, os, re, pygame.freetype
from pygame.locals import *
pygame.init()
class resource_handler(object):
def get_data_from_folder(self, data_dir, extension, iterfunc):
data = []
for file in os.listdir(data_dir):
if extension in file:
data.append({ 'name': file,... | true | true |
f735eecbca65eada9d6d39cba7d9783bdfd16701 | 2,886 | py | Python | plugins/modules/memsource_project.py | rooftopcellist/ansible-collection-memsource | e9b506e0da091461baac531e0921815369dfca29 | [
"Apache-2.0"
] | null | null | null | plugins/modules/memsource_project.py | rooftopcellist/ansible-collection-memsource | e9b506e0da091461baac531e0921815369dfca29 | [
"Apache-2.0"
] | null | null | null | plugins/modules/memsource_project.py | rooftopcellist/ansible-collection-memsource | e9b506e0da091461baac531e0921815369dfca29 | [
"Apache-2.0"
] | 1 | 2021-10-05T23:27:10.000Z | 2021-10-05T23:27:10.000Z | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = """
module: memsource_project
short_description: Manage a Memsource project
version_added: 0.0.1
description:
- Manage a Memsource project
author: 'Yanis Guenane (@Spredzy)'
options:
ui... | 23.655738 | 85 | 0.651421 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = """
module: memsource_project
short_description: Manage a Memsource project
version_added: 0.0.1
description:
- Manage a Memsource project
author: 'Yanis Guenane (@Spredzy)'
options:
uid:
description:
... | true | true |
f735ef00c592ff18ce03fb7b24d9baccd2ae3d16 | 389 | py | Python | bardo2/wsgi.py | Manzanero/bardo2-web | cfacb9ec321030ce0cafb62a1a7bcdb28726a99c | [
"MIT"
] | null | null | null | bardo2/wsgi.py | Manzanero/bardo2-web | cfacb9ec321030ce0cafb62a1a7bcdb28726a99c | [
"MIT"
] | null | null | null | bardo2/wsgi.py | Manzanero/bardo2-web | cfacb9ec321030ce0cafb62a1a7bcdb28726a99c | [
"MIT"
] | null | null | null | """
WSGI config for bardo2 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTIN... | 22.882353 | 78 | 0.784062 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bardo2.settings')
application = get_wsgi_application()
| true | true |
f735ef49a6a7ff21aed43a74d854d9b11e62da8b | 2,537 | py | Python | treat.py | TwinIsland/img2java | 6b6788daa0a97acb1e455ead9d7bd09d7d881ab2 | [
"MIT"
] | null | null | null | treat.py | TwinIsland/img2java | 6b6788daa0a97acb1e455ead9d7bd09d7d881ab2 | [
"MIT"
] | null | null | null | treat.py | TwinIsland/img2java | 6b6788daa0a97acb1e455ead9d7bd09d7d881ab2 | [
"MIT"
] | null | null | null | from matplotlib import pyplot as plt
import numpy as np
import cv2
from scipy import stats
import translate
from skimage import transform
#####################################
imgData = cv2.imread('van.jpg',0)
compressRate = 0.4
#####################################
imgData = np.array(imgData)
shape = imgData.shape
p... | 25.626263 | 95 | 0.589279 | from matplotlib import pyplot as plt
import numpy as np
import cv2
from scipy import stats
import translate
from skimage import transform
count = 0
global imgData
shape = imgData.shape
lineLenght = shape[1]
for lineIndex in range(shape[0]-1):
for numberIndex in range(0,lineLenght-6):
... | true | true |
f735ef8bb7eef76ac42f0236481b16ad8040fb74 | 1,811 | py | Python | tests/test_locate_trace.py | hover2pi/hotsoss | 82d8316d97096416d7f175516a80953e99fb6f44 | [
"MIT"
] | 2 | 2019-12-06T17:40:30.000Z | 2020-06-25T09:04:04.000Z | tests/test_locate_trace.py | hover2pi/hotsoss | 82d8316d97096416d7f175516a80953e99fb6f44 | [
"MIT"
] | 2 | 2021-11-15T17:49:23.000Z | 2022-02-08T17:15:09.000Z | tests/test_locate_trace.py | hover2pi/hotsoss | 82d8316d97096416d7f175516a80953e99fb6f44 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `locate_trace` module."""
import unittest
import numpy as np
from hotsoss import locate_trace as lt
def test_simulate_frame():
"""Test the simulate_frame function"""
# CLEAR and plot test
assert lt.simulate_frame(plot=True).shape == (256, 2048... | 24.472973 | 76 | 0.677526 |
import unittest
import numpy as np
from hotsoss import locate_trace as lt
def test_simulate_frame():
assert lt.simulate_frame(plot=True).shape == (256, 2048)
assert lt.simulate_frame(filt='F277W').shape == (256, 2048)
def test_isolate_signal():
frame = lt.simulate_frame()
... | true | true |
f735efd81dd59271b71383463bdf088ddbe47517 | 1,656 | py | Python | userbot/plugins/confuse.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | userbot/plugins/confuse.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | userbot/plugins/confuse.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | """Emoji
Available Commands:
.adi"""
import asyncio
from telethon import events
@borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True))
async def _(event):
if event.fwd_from:
return
animation_interval = 0.3
animation_ttl = range(0, 15)
input_str = event.pattern_match.group(1)
... | 33.12 | 93 | 0.278986 |
import asyncio
from telethon import events
@borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True))
async def _(event):
if event.fwd_from:
return
animation_interval = 0.3
animation_ttl = range(0, 15)
input_str = event.pattern_match.group(1)
if input_str == "adi":
awai... | true | true |
f735f1cc42cde14539830514433b678241a88a6b | 1,357 | py | Python | tests/cloudformation/checks/resource/aws/test_RDSMultiAZEnabled.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | 4,013 | 2019-12-09T13:16:54.000Z | 2022-03-31T14:31:01.000Z | tests/cloudformation/checks/resource/aws/test_RDSMultiAZEnabled.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | 1,258 | 2019-12-17T09:55:51.000Z | 2022-03-31T19:17:17.000Z | tests/cloudformation/checks/resource/aws/test_RDSMultiAZEnabled.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | 638 | 2019-12-19T08:57:38.000Z | 2022-03-30T21:38:37.000Z | import os
import unittest
from checkov.cloudformation.checks.resource.aws.RDSMultiAZEnabled import check
from checkov.cloudformation.runner import Runner
from checkov.runner_filter import RunnerFilter
class TestRDSMultiAZEnabled(unittest.TestCase):
def test_summary(self):
runner = Runner()
curre... | 33.097561 | 102 | 0.696389 | import os
import unittest
from checkov.cloudformation.checks.resource.aws.RDSMultiAZEnabled import check
from checkov.cloudformation.runner import Runner
from checkov.runner_filter import RunnerFilter
class TestRDSMultiAZEnabled(unittest.TestCase):
def test_summary(self):
runner = Runner()
curre... | true | true |
f735f341c87bd4f4fdcc65b249d937ef404bd09f | 56,071 | py | Python | www/tests/issues.py | alan0526/brython | 440571d5e124b85ad2822ca84dd12e46fd3e1737 | [
"BSD-3-Clause"
] | 1 | 2022-02-15T09:11:51.000Z | 2022-02-15T09:11:51.000Z | www/tests/issues.py | alan0526/brython | 440571d5e124b85ad2822ca84dd12e46fd3e1737 | [
"BSD-3-Clause"
] | null | null | null | www/tests/issues.py | alan0526/brython | 440571d5e124b85ad2822ca84dd12e46fd3e1737 | [
"BSD-3-Clause"
] | 1 | 2022-02-27T17:45:52.000Z | 2022-02-27T17:45:52.000Z | from tester import assertRaises
# issue 5
assert(isinstance(__debug__, bool))
# issue #6 : unknown encoding: windows-1250
s = "Dziś jeść ryby"
b = s.encode('windows-1250')
assert b == b'Dzi\x9c je\x9c\xe6 ryby'
assert b.decode('windows-1250') == "Dziś jeść ryby"
# issue #7 : attribute set on module is not available ... | 18.389964 | 115 | 0.57709 | from tester import assertRaises
assert(isinstance(__debug__, bool))
'windows-1250')
assert b == b'Dzi\x9c je\x9c\xe6 ryby'
assert b.decode('windows-1250') == "Dziś jeść ryby"
inject_name_in_module.xxx == 123
init__(self):
self.x = 9
a.__init__
class b(a):
def __init__(s):
super().__init__... | true | true |
f735f3e677422c352df9ec6eb83935b0d6721318 | 61 | py | Python | pyranet/__init__.py | accasio/3DPyraNet | 19f8d453ac5d089b5c5514ea744d895e6f8aee14 | [
"MIT"
] | null | null | null | pyranet/__init__.py | accasio/3DPyraNet | 19f8d453ac5d089b5c5514ea744d895e6f8aee14 | [
"MIT"
] | null | null | null | pyranet/__init__.py | accasio/3DPyraNet | 19f8d453ac5d089b5c5514ea744d895e6f8aee14 | [
"MIT"
] | 3 | 2019-09-11T10:01:29.000Z | 2019-10-04T09:12:17.000Z | from . import layers
from . import models
from . import keras | 20.333333 | 20 | 0.770492 | from . import layers
from . import models
from . import keras | true | true |
f735f482decbd6a9a885af3d4a25a4218a16a2f5 | 3,167 | py | Python | aps/util/edit_region_mask.py | kmunve/APS | 4c2f254ede83a3a311cbedc90c76db9ee367a000 | [
"MIT"
] | null | null | null | aps/util/edit_region_mask.py | kmunve/APS | 4c2f254ede83a3a311cbedc90c76db9ee367a000 | [
"MIT"
] | 1 | 2018-12-14T14:47:13.000Z | 2018-12-14T14:47:13.000Z | aps/util/edit_region_mask.py | kmunve/APS | 4c2f254ede83a3a311cbedc90c76db9ee367a000 | [
"MIT"
] | null | null | null | from pathlib import Path
import os
import numpy as np
import netCDF4
import matplotlib.pyplot as plt
from aps.util.nc_index_by_coordinate import tunnel_fast
# Creates the mask over the small regions of 20x20 km size
def create_small_regions_mask():
p = Path(os.path.dirname(os.path.abspath(__file__))).parent
nc... | 33.691489 | 122 | 0.663088 | from pathlib import Path
import os
import numpy as np
import netCDF4
import matplotlib.pyplot as plt
from aps.util.nc_index_by_coordinate import tunnel_fast
def create_small_regions_mask():
p = Path(os.path.dirname(os.path.abspath(__file__))).parent
nc_file = p / 'data' / 'terrain_parameters' / 'VarslingsOmr_... | true | true |
f735f5f927d84cdc60937cb689e5e363a0be9c54 | 505 | py | Python | sqrtrading/wsgi.py | alexbid/sqrtrading | 1dadf3e42e9b747134861572b44f81cb8222c2f2 | [
"MIT"
] | null | null | null | sqrtrading/wsgi.py | alexbid/sqrtrading | 1dadf3e42e9b747134861572b44f81cb8222c2f2 | [
"MIT"
] | null | null | null | sqrtrading/wsgi.py | alexbid/sqrtrading | 1dadf3e42e9b747134861572b44f81cb8222c2f2 | [
"MIT"
] | null | null | null | """
WSGI config for sqrtrading project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
import sys
addPath = os.path.realpath(__file__).replace('sqrtrading/wsgi.py','')
s... | 24.047619 | 78 | 0.782178 |
import os
import sys
addPath = os.path.realpath(__file__).replace('sqrtrading/wsgi.py','')
sys.path.append(addPath)
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sqrtrading.settings")
application = get_wsgi_application()
| true | true |
f735f5fbd64d2154b36d035f777107f689429cdb | 611 | py | Python | test/python/LIM2Metrics/py3/base/common/Prototype/Prototype.py | sagodiz/SonarQube-plug-in | 4f8e111baecc4c9f9eaa5cd3d7ebeb1e365ace2c | [
"BSD-4-Clause"
] | 20 | 2015-06-16T17:39:10.000Z | 2022-03-20T22:39:40.000Z | test/python/LIM2Metrics/py3/base/common/Prototype/Prototype.py | sagodiz/SonarQube-plug-in | 4f8e111baecc4c9f9eaa5cd3d7ebeb1e365ace2c | [
"BSD-4-Clause"
] | 29 | 2015-12-29T19:07:22.000Z | 2022-03-22T10:39:02.000Z | test/python/LIM2Metrics/py3/base/common/Prototype/Prototype.py | sagodiz/SonarQube-plug-in | 4f8e111baecc4c9f9eaa5cd3d7ebeb1e365ace2c | [
"BSD-4-Clause"
] | 12 | 2015-08-28T01:22:18.000Z | 2021-09-25T08:17:31.000Z | import copy
#
# Prototype Class
#
class Cookie:
def __init__(self, name):
self.name = name
def clone(self):
return copy.deepcopy(self)
#
# Concrete Prototypes to clone
#
class CoconutCookie(Cookie):
def __init__(self):
Cookie.__init__(self, 'Coconut')
#
# Client Class
#
class... | 16.972222 | 40 | 0.630115 | import copy
class Cookie:
def __init__(self, name):
self.name = name
def clone(self):
return copy.deepcopy(self)
class CoconutCookie(Cookie):
def __init__(self):
Cookie.__init__(self, 'Coconut')
class CookieMachine:
def __init__(self, cookie):
self.cookie... | true | true |
f735f6a1ba518112d8f3c4b8d18cb45e36f1179b | 8,475 | py | Python | .ci/ci_lib.py | ossys/mitogen | 8654af738b007fc659a77fe88c7da8cb0b5d51cd | [
"BSD-3-Clause"
] | null | null | null | .ci/ci_lib.py | ossys/mitogen | 8654af738b007fc659a77fe88c7da8cb0b5d51cd | [
"BSD-3-Clause"
] | 3 | 2021-03-26T00:43:30.000Z | 2022-03-29T22:03:58.000Z | deploy/mitogen/.ci/ci_lib.py | voloshanenko/smsgateway | a1509c7b98d844bc483a47173223062e6e1c2bc6 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
from __future__ import absolute_import
from __future__ import print_function
import atexit
import os
import shlex
import shutil
import subprocess
import sys
import tempfile
try:
import urlparse
except ImportError:
import urllib.parse as urlparse
os.chdir(
os.path.join(
os.path.dirname(__file__),... | 25.298507 | 79 | 0.584307 |
from __future__ import absolute_import
from __future__ import print_function
import atexit
import os
import shlex
import shutil
import subprocess
import sys
import tempfile
try:
import urlparse
except ImportError:
import urllib.parse as urlparse
os.chdir(
os.path.join(
os.path.dirname(__file__),... | true | true |
f735f6cd5e14c234a77f347166f09b45b4e9ba7e | 3,327 | py | Python | src/game_management/phases.py | kesslermaximilian/JustOneBot | 1d7f861bc92fe6bc89e2061d8c22eb802db54d30 | [
"MIT"
] | 1 | 2021-05-23T09:29:02.000Z | 2021-05-23T09:29:02.000Z | src/game_management/phases.py | nonchris/JustOneBot | 4396dc042542938643932128892b19dc3802f394 | [
"MIT"
] | 1 | 2021-05-27T21:13:04.000Z | 2021-05-27T21:13:04.000Z | src/game_management/phases.py | nonchris/JustOneBot | 4396dc042542938643932128892b19dc3802f394 | [
"MIT"
] | 3 | 2021-05-23T16:59:39.000Z | 2021-05-27T21:09:33.000Z | from game_management.game import Game
from game_management.tools import Phase
from log_setup import logger
"""
This file is outdated and not used in the project. Due to circular import issues, this class is now declared
(and documented) in game.py
"""
class PhaseHandler:
def __init__(self, game: Game):
... | 45.575342 | 118 | 0.640517 | from game_management.game import Game
from game_management.tools import Phase
from log_setup import logger
class PhaseHandler:
def __init__(self, game: Game):
self.game = game
self.task_dictionary = {
Phase.initialised: None,
Phase.preparation: game.preparation,
... | true | true |
f735f71c29215f16bd0045a36820d4e8c5cdd059 | 3,347 | py | Python | procedure/problem/efficiency_performance/mo_nats.py | MinhTuDo/MD-MOENAS | edd6ec8c3f89cfbe9674873425c5056e72899edb | [
"MIT"
] | 3 | 2021-12-10T02:07:38.000Z | 2021-12-10T15:07:49.000Z | procedure/problem/efficiency_performance/mo_nats.py | ELO-Lab/MD-MOENAS | edd6ec8c3f89cfbe9674873425c5056e72899edb | [
"MIT"
] | null | null | null | procedure/problem/efficiency_performance/mo_nats.py | ELO-Lab/MD-MOENAS | edd6ec8c3f89cfbe9674873425c5056e72899edb | [
"MIT"
] | null | null | null | from procedure.problem.base import nats as base
import numpy as np
class EfficiencyAccuracyNATS(base.NATS):
def __init__(self, efficiency, **kwargs):
super().__init__(n_obj=2, **kwargs)
self.msg += efficiency + '={:.3f}, ' + 'valid-error' + '={:.3f}'
self.efficiency = efficiency
def _... | 34.505155 | 117 | 0.579026 | from procedure.problem.base import nats as base
import numpy as np
class EfficiencyAccuracyNATS(base.NATS):
def __init__(self, efficiency, **kwargs):
super().__init__(n_obj=2, **kwargs)
self.msg += efficiency + '={:.3f}, ' + 'valid-error' + '={:.3f}'
self.efficiency = efficiency
def _... | true | true |
f735f82e3b5af400f3030e9e85e6e6684e925602 | 720 | py | Python | poky-dunfell/meta/lib/oeqa/runtime/cases/gstreamer.py | lacie-life/YoctoPi | 3412e78468a9b84da50bb1aadb12b459001a3712 | [
"MIT"
] | 14 | 2021-11-04T07:47:37.000Z | 2022-03-21T10:10:30.000Z | poky-dunfell/meta/lib/oeqa/runtime/cases/gstreamer.py | lacie-life/YoctoPi | 3412e78468a9b84da50bb1aadb12b459001a3712 | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | poky-dunfell/meta/lib/oeqa/runtime/cases/gstreamer.py | lacie-life/YoctoPi | 3412e78468a9b84da50bb1aadb12b459001a3712 | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | #
# SPDX-License-Identifier: MIT
#
from oeqa.runtime.case import OERuntimeTestCase
from oeqa.runtime.decorator.package import OEHasPackage
class GstreamerCliTest(OERuntimeTestCase):
@OEHasPackage(['gstreamer1.0'])
def test_gst_inspect_can_list_all_plugins(self):
status, output = self.target.run('gst-... | 37.894737 | 120 | 0.733333 |
from oeqa.runtime.case import OERuntimeTestCase
from oeqa.runtime.decorator.package import OEHasPackage
class GstreamerCliTest(OERuntimeTestCase):
@OEHasPackage(['gstreamer1.0'])
def test_gst_inspect_can_list_all_plugins(self):
status, output = self.target.run('gst-inspect-1.0')
self.asser... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.