hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f71bf52008d28c422bd88b5ecd34e9e1fab1fa11 | 2,202 | py | Python | models/ModelUtil/util.py | Easonyesheng/StereoCameraToolk | 660e43019d0687e96e6da3aca48c1c423ae5abff | [
"MIT"
] | 27 | 2020-10-16T07:21:35.000Z | 2022-03-11T02:56:13.000Z | models/ModelUtil/util.py | Easonyesheng/StereoCamera | 9319b7f4e5ce36833de722a15e1074e82b8b4f84 | [
"MIT"
] | null | null | null | models/ModelUtil/util.py | Easonyesheng/StereoCamera | 9319b7f4e5ce36833de722a15e1074e82b8b4f84 | [
"MIT"
] | 6 | 2021-02-01T09:54:40.000Z | 2022-03-11T03:16:39.000Z | """Utility """
import numpy as np
import cv2
import os
import logging
def check_string_is_empty(string):
"""name
check string empty or not
Args:
Returns:
"""
if string == '':
return True
return False
def check_numpy_array(array):
"""name
check array empty or no... | 18.504202 | 108 | 0.583106 |
import numpy as np
import cv2
import os
import logging
def check_string_is_empty(string):
if string == '':
return True
return False
def check_numpy_array(array):
try:
array.all()
except AttributeError:
return False
return True
def after_cv_imshow():
k = cv2.wait... | true | true |
f71bf5a6846601e2c447085faeecf596137b1330 | 4,935 | py | Python | airflow/api/common/experimental/trigger_dag.py | IGIT-CN/airflow | a6e5bcd59198afe5716813e84ebc4c59eade532c | [
"Apache-2.0"
] | 2 | 2020-03-24T14:47:18.000Z | 2020-03-24T14:48:17.000Z | airflow/api/common/experimental/trigger_dag.py | IGIT-CN/airflow | a6e5bcd59198afe5716813e84ebc4c59eade532c | [
"Apache-2.0"
] | 1 | 2021-09-29T17:37:13.000Z | 2021-09-29T17:37:13.000Z | airflow/api/common/experimental/trigger_dag.py | IGIT-CN/airflow | a6e5bcd59198afe5716813e84ebc4c59eade532c | [
"Apache-2.0"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 34.270833 | 104 | 0.680446 |
import json
from datetime import datetime
from typing import List, Optional, Union
from airflow.exceptions import DagNotFound, DagRunAlreadyExists
from airflow.models import DagBag, DagModel, DagRun
from airflow.utils import timezone
from airflow.utils.state import State
from airflow.utils.types impor... | true | true |
f71bf6d7e4ee3f8699dd771f06d36619668ab2db | 8,225 | py | Python | authors/apps/notify/tests/test_mail_list_model.py | andela/Ah-backend-valkyrie | f0eb64c27e1fe37d5c81e4b9a8762dcf3c336a79 | [
"BSD-3-Clause"
] | null | null | null | authors/apps/notify/tests/test_mail_list_model.py | andela/Ah-backend-valkyrie | f0eb64c27e1fe37d5c81e4b9a8762dcf3c336a79 | [
"BSD-3-Clause"
] | 46 | 2019-01-08T13:16:41.000Z | 2021-04-30T20:47:08.000Z | authors/apps/notify/tests/test_mail_list_model.py | andela/Ah-backend-valkyrie | f0eb64c27e1fe37d5c81e4b9a8762dcf3c336a79 | [
"BSD-3-Clause"
] | 3 | 2019-01-07T08:21:59.000Z | 2019-09-20T06:43:18.000Z | import json
from authors.apps.authentication.tests.base import BaseTestMethods
from authors.apps.authentication.models import User
from rest_framework.reverse import reverse
from rest_framework import status
class NotificationTests(BaseTestMethods):
def test_create_mail_list(self):
user = self.register_... | 39.927184 | 92 | 0.646565 | import json
from authors.apps.authentication.tests.base import BaseTestMethods
from authors.apps.authentication.models import User
from rest_framework.reverse import reverse
from rest_framework import status
class NotificationTests(BaseTestMethods):
def test_create_mail_list(self):
user = self.register_... | true | true |
f71bf861822822818626a562f2930b021abda1d2 | 596 | py | Python | x2py/__init__.py | jaykang920/x2py | b8bd473f94ff4b9576e984cc384f4159ab71278d | [
"MIT"
] | null | null | null | x2py/__init__.py | jaykang920/x2py | b8bd473f94ff4b9576e984cc384f4159ab71278d | [
"MIT"
] | 1 | 2019-06-05T09:35:09.000Z | 2020-07-02T09:46:46.000Z | x2py/__init__.py | jaykang920/x2py | b8bd473f94ff4b9576e984cc384f4159ab71278d | [
"MIT"
] | null | null | null | # Copyright (c) 2017, 2018 Jae-jun Kang
# See the file LICENSE for details.
"""Import core names of x2py."""
__version__ = '0.4.3'
from x2py.buffer_transform import BufferTransform
from x2py.builtin_events import *
from x2py.case import Case
from x2py.config import Config
from x2py.coroutine import Coroutine, Corouti... | 27.090909 | 54 | 0.798658 |
__version__ = '0.4.3'
from x2py.buffer_transform import BufferTransform
from x2py.builtin_events import *
from x2py.case import Case
from x2py.config import Config
from x2py.coroutine import Coroutine, CoroutineHandler
from x2py.event import Event
from x2py.event_factory import EventFactory
from x2py.event_sink imp... | true | true |
f71bf97329b821d2dc2e07b818ab784fb1ed22a7 | 2,815 | py | Python | test/lint/check-doc.py | BakedInside/beanscore | daa9b2ddbfd3305881749bda7f32146738154260 | [
"MIT"
] | null | null | null | test/lint/check-doc.py | BakedInside/beanscore | daa9b2ddbfd3305881749bda7f32146738154260 | [
"MIT"
] | null | null | null | test/lint/check-doc.py | BakedInside/beanscore | daa9b2ddbfd3305881749bda7f32146738154260 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2020 The Beans Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
This checks if all command line args are documented.
Return value is 0 to indicate no error.
Author: @... | 42.014925 | 130 | 0.722913 |
from subprocess import check_output
import re
FOLDER_GREP = 'src'
FOLDER_TEST = 'src/test/'
REGEX_ARG = r'(?:ForceSet|SoftSet|Get|Is)(?:Bool)?Args?(?:Set)?\("(-[^"]+)"'
REGEX_DOC = r'AddArg\("(-[^"=]+?)(?:=|")'
CMD_ROOT_DIR = '$(git rev-parse --show-toplevel)/{}'.format(FOLDER_GREP)
CMD_GREP_ARGS = r"git grep --... | true | true |
f71bf97c41d24bf4383061ccf726c43fc54c6be9 | 4,880 | py | Python | py3status/modules/file_status.py | JackDoan/py3status | e7f56fc0bec8c1a625328c3549b88f66ee8b41ab | [
"BSD-3-Clause"
] | null | null | null | py3status/modules/file_status.py | JackDoan/py3status | e7f56fc0bec8c1a625328c3549b88f66ee8b41ab | [
"BSD-3-Clause"
] | null | null | null | py3status/modules/file_status.py | JackDoan/py3status | e7f56fc0bec8c1a625328c3549b88f66ee8b41ab | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Display if files or directories exists.
Configuration parameters:
cache_timeout: refresh interval for this module (default 10)
format: display format for this module
(default '\?color=path [\?if=path ●|■]')
format_path: format for paths (default '{basename}')
format_... | 30.310559 | 87 | 0.565369 |
from glob import glob
from os.path import basename, expanduser
STRING_NO_PATHS = "missing paths"
class Py3status:
cache_timeout = 10
format = u"\?color=path [\?if=path \u25cf|\u25a0]"
format_path = u"{basename}"
format_path_separator = u" "
paths = None
thresholds = [(0, "bad"), (1, "... | true | true |
f71bfb7e6138d20826c27d50c937e36b4fb9c103 | 454 | py | Python | lesson_4_transformation/lesson_4_affine_transformation.py | DewMaple/opencv-learning | 51991a5b9badf24cda740c1377f6be30dea91e1d | [
"MIT"
] | null | null | null | lesson_4_transformation/lesson_4_affine_transformation.py | DewMaple/opencv-learning | 51991a5b9badf24cda740c1377f6be30dea91e1d | [
"MIT"
] | null | null | null | lesson_4_transformation/lesson_4_affine_transformation.py | DewMaple/opencv-learning | 51991a5b9badf24cda740c1377f6be30dea91e1d | [
"MIT"
] | 1 | 2018-09-10T15:51:23.000Z | 2018-09-10T15:51:23.000Z | import cv2
import numpy as np
from utils import find_image
image_path = find_image('girls_01.jpg')
img = cv2.imread(image_path)
rows, cols, channel = img.shape
pts_src = np.float32([[50, 50], [200, 50], [50, 200]])
pts_dst = np.float32([[10, 100], [200, 80], [100, 650]])
M = cv2.getAffineTransform(pts_src, pts_dst)... | 23.894737 | 56 | 0.707048 | import cv2
import numpy as np
from utils import find_image
image_path = find_image('girls_01.jpg')
img = cv2.imread(image_path)
rows, cols, channel = img.shape
pts_src = np.float32([[50, 50], [200, 50], [50, 200]])
pts_dst = np.float32([[10, 100], [200, 80], [100, 650]])
M = cv2.getAffineTransform(pts_src, pts_dst)... | true | true |
f71bfbbb90ec970a284d4548547ab11e37b35557 | 21,393 | py | Python | androidtv/constants.py | deviant-aut/python-androidtv | 4bd5421e107949784b292a5f4a0397875a18e908 | [
"MIT"
] | 10 | 2022-01-17T14:46:04.000Z | 2022-03-19T16:19:06.000Z | androidtv/constants.py | deviant-aut/python-androidtv | 4bd5421e107949784b292a5f4a0397875a18e908 | [
"MIT"
] | 5 | 2022-01-18T20:33:18.000Z | 2022-03-30T15:57:24.000Z | androidtv/constants.py | deviant-aut/python-androidtv | 4bd5421e107949784b292a5f4a0397875a18e908 | [
"MIT"
] | 7 | 2022-01-25T01:26:47.000Z | 2022-03-13T05:54:53.000Z | """Constants used throughout the code.
**Links**
* `ADB key event codes <https://developer.android.com/reference/android/view/KeyEvent>`_
* `MediaSession PlaybackState property <https://developer.android.com/reference/android/media/session/PlaybackState.html>`_
"""
import re
import sys
if sys.version_info[0] == 3... | 34.338684 | 179 | 0.72865 |
import re
import sys
if sys.version_info[0] == 3 and sys.version_info[1] >= 5:
from enum import IntEnum, unique
else:
IntEnum = object
def unique(cls):
"""A class decorator that does nothing."""
return cls
@unique
class DeviceEnum(IntEnum):
BASETV = 0
ANDROIDTV = 1
FIRET... | true | true |
f71bfc3874575acdd3b3cfdfd9209ae815ab7e10 | 7,497 | py | Python | tf/experiment6.py | wichtounet/frameworks | e0cac9d4ffbbf0b1e9d2491eb70bf2c6154f313b | [
"MIT"
] | 20 | 2016-12-01T17:39:04.000Z | 2019-08-25T12:50:05.000Z | tf/experiment6.py | wichtounet/frameworks | e0cac9d4ffbbf0b1e9d2491eb70bf2c6154f313b | [
"MIT"
] | 4 | 2017-10-08T13:56:21.000Z | 2019-01-21T12:49:09.000Z | tf/experiment6.py | wichtounet/frameworks | e0cac9d4ffbbf0b1e9d2491eb70bf2c6154f313b | [
"MIT"
] | 7 | 2018-05-09T01:29:20.000Z | 2019-02-09T10:49:39.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import keras
from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img
import argparse
import gzip
import os
import sys
import time
import os
import math
import numpy
from... | 35.870813 | 213 | 0.652528 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import keras
from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img
import argparse
import gzip
import os
import sys
import time
import os
import math
import numpy
from... | true | true |
f71bfd19f426d8f03872939dfd8bb1e2d6d2dcdf | 332 | py | Python | week1/the_real_deal/is_prime.py | sevgo/Programming101 | ac25c4d9695563b449a629c60ec77a739c9f5be3 | [
"BSD-3-Clause"
] | null | null | null | week1/the_real_deal/is_prime.py | sevgo/Programming101 | ac25c4d9695563b449a629c60ec77a739c9f5be3 | [
"BSD-3-Clause"
] | 1 | 2021-09-16T05:44:31.000Z | 2021-09-16T05:44:31.000Z | week1/the_real_deal/is_prime.py | sevgo/Programming101 | ac25c4d9695563b449a629c60ec77a739c9f5be3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
from sum_of_divisors import sum_of_divisors
def is_prime(n):
# If N is prime it could only be devided
# to 1 and N, so sum of divisors has to be
# equal to N + 1
return n + 1 == sum_of_divisors(n)
if __name__ == "__main__":
number = int(input("Number: "))
print (is_pri... | 22.133333 | 46 | 0.653614 |
from sum_of_divisors import sum_of_divisors
def is_prime(n):
return n + 1 == sum_of_divisors(n)
if __name__ == "__main__":
number = int(input("Number: "))
print (is_prime(number))
| true | true |
f71bfd37000184d8a9e59d68561043e6514fa6d5 | 4,211 | py | Python | src/data_imputation_paper/imputation/dl.py | se-jaeger/data-imputation-paper | 498d2d871302d917f58ecf6a9576e3a3451c5faa | [
"Apache-2.0"
] | 2 | 2022-01-18T09:59:01.000Z | 2022-02-02T10:01:45.000Z | src/data_imputation_paper/imputation/dl.py | se-jaeger/data-imputation-paper | 498d2d871302d917f58ecf6a9576e3a3451c5faa | [
"Apache-2.0"
] | null | null | null | src/data_imputation_paper/imputation/dl.py | se-jaeger/data-imputation-paper | 498d2d871302d917f58ecf6a9576e3a3451c5faa | [
"Apache-2.0"
] | null | null | null | import logging
from typing import Dict, List, Optional, Tuple
import pandas as pd
from autokeras import StructuredDataClassifier, StructuredDataRegressor
from tensorflow.keras import Model
from ._base import BaseImputer
logger = logging.getLogger()
class AutoKerasImputer(BaseImputer):
def __init__(
se... | 37.265487 | 139 | 0.654001 | import logging
from typing import Dict, List, Optional, Tuple
import pandas as pd
from autokeras import StructuredDataClassifier, StructuredDataRegressor
from tensorflow.keras import Model
from ._base import BaseImputer
logger = logging.getLogger()
class AutoKerasImputer(BaseImputer):
def __init__(
se... | true | true |
f71bfd5b0f2615891de5ac70368d3a37c96767b7 | 17,386 | py | Python | HER_mod/rl_modules/get_path_costs.py | schrammlb2/policy-guided-sst | 8dce6619b9c771c39915c60fe9c54270ea1e621e | [
"Apache-2.0"
] | null | null | null | HER_mod/rl_modules/get_path_costs.py | schrammlb2/policy-guided-sst | 8dce6619b9c771c39915c60fe9c54270ea1e621e | [
"Apache-2.0"
] | null | null | null | HER_mod/rl_modules/get_path_costs.py | schrammlb2/policy-guided-sst | 8dce6619b9c771c39915c60fe9c54270ea1e621e | [
"Apache-2.0"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import pickle
import os
from scipy import stats
from HER_mod.rl_modules.tsp import generate_path
from HER_mod.rl_modules.hyperparams import NUM_GOALS, NUM_AGENTS
gd_step_list = [0,2,5, 10, 20, 40]
# NUM_AGENTS = 3
N=200
def get_path_costs(train_pos_agent, train_vel_a... | 44.352041 | 195 | 0.673588 | import numpy as np
import matplotlib.pyplot as plt
import pickle
import os
from scipy import stats
from HER_mod.rl_modules.tsp import generate_path
from HER_mod.rl_modules.hyperparams import NUM_GOALS, NUM_AGENTS
gd_step_list = [0,2,5, 10, 20, 40]
N=200
def get_path_costs(train_pos_agent, train_vel_agent, perm_searc... | true | true |
f71bfd9867454fe2f4dc8062137be298a7bcf44a | 40,230 | py | Python | python/ccxt/async_support/coinbasepro.py | dgdiginex/ccxt | cccd590576cbf48d26cf9e3f65cc54fdd466a139 | [
"MIT"
] | 1 | 2021-02-08T21:56:13.000Z | 2021-02-08T21:56:13.000Z | python/ccxt/async_support/coinbasepro.py | yucelalbar/ccxt | 672510401fba809172fac8272e1af463c778358a | [
"MIT"
] | null | null | null | python/ccxt/async_support/coinbasepro.py | yucelalbar/ccxt | 672510401fba809172fac8272e1af463c778358a | [
"MIT"
] | 2 | 2020-10-13T03:24:08.000Z | 2020-10-15T06:25:07.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
# -----------------------------------------------------------------------------
try... | 39.402547 | 187 | 0.492667 |
rt.base.exchange import Exchange
try:
basestring
except NameError:
basestring = str
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import ArgumentsRequired
from ccxt.base.err... | true | true |
f71bff11a394180fe27dbab6c598aaf8b04768c6 | 10,059 | py | Python | mlflow/spacy.py | Roffild/mlflow | 8351d82e6ad4103bc58159175b29b406abb1e052 | [
"Apache-2.0"
] | null | null | null | mlflow/spacy.py | Roffild/mlflow | 8351d82e6ad4103bc58159175b29b406abb1e052 | [
"Apache-2.0"
] | null | null | null | mlflow/spacy.py | Roffild/mlflow | 8351d82e6ad4103bc58159175b29b406abb1e052 | [
"Apache-2.0"
] | null | null | null | """
The ``mlflow.spacy`` module provides an API for logging and loading spaCy models.
This module exports spacy models with the following flavors:
spaCy (native) format
This is the main flavor that can be loaded back into spaCy.
:py:mod:`mlflow.pyfunc`
Produced for use by generic pyfunc-based deployment tools ... | 43.357759 | 100 | 0.617457 |
from __future__ import absolute_import
import logging
import os
import pandas as pd
import yaml
import mlflow
from mlflow import pyfunc
from mlflow.exceptions import MlflowException
from mlflow.models import Model, ModelSignature
from mlflow.models.utils import ModelInputExample
from mlflow.tracking.artifact_utils ... | true | true |
f71bff714d7bf1d24454e59616e23e72f9782452 | 629 | py | Python | December Month Challenge/2LinkedListRandomNodeReservoirSampling.py | adesh-gadge/LeetCodePractice | 4b142c102e64ec93465af7f4193762e8fd2866ec | [
"MIT"
] | null | null | null | December Month Challenge/2LinkedListRandomNodeReservoirSampling.py | adesh-gadge/LeetCodePractice | 4b142c102e64ec93465af7f4193762e8fd2866ec | [
"MIT"
] | null | null | null | December Month Challenge/2LinkedListRandomNodeReservoirSampling.py | adesh-gadge/LeetCodePractice | 4b142c102e64ec93465af7f4193762e8fd2866ec | [
"MIT"
] | null | null | null | import random
class Solution:
def __init__(self, head: ListNode):
"""
@param head The linked list's head.
Note that the head is guaranteed to be not null, so it contains at least one node.
"""
self.head = head
def getRandom(self) -> int:
"""
Re... | 23.296296 | 90 | 0.497615 | import random
class Solution:
def __init__(self, head: ListNode):
self.head = head
def getRandom(self) -> int:
scope = 1
chosen_value = 0
curr = self.head
while curr:
if random.random() < 1/scope:
chosen_value = curr.val
... | true | true |
f71bff92a942ff8d052d7208bd78c572f2d01c55 | 132 | py | Python | artistapp/artist/admin.py | fallprojects/ArtistApp | 5564a1f7f4fc95261beb462abfa4ca53f3e5c17f | [
"MIT"
] | null | null | null | artistapp/artist/admin.py | fallprojects/ArtistApp | 5564a1f7f4fc95261beb462abfa4ca53f3e5c17f | [
"MIT"
] | null | null | null | artistapp/artist/admin.py | fallprojects/ArtistApp | 5564a1f7f4fc95261beb462abfa4ca53f3e5c17f | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import *
# Register your models here.
admin.site.register([Content,Profile,Comment])
| 22 | 46 | 0.787879 | from django.contrib import admin
from .models import *
admin.site.register([Content,Profile,Comment])
| true | true |
f71c00b21518c6757cb661f74b98f03394d9f8a6 | 749 | py | Python | parqueo/urls.py | gersonjuarez/Laboratorio | 3ed5dc57136ec593e3edb8ef8ca3b29abeb7dabc | [
"bzip2-1.0.6"
] | null | null | null | parqueo/urls.py | gersonjuarez/Laboratorio | 3ed5dc57136ec593e3edb8ef8ca3b29abeb7dabc | [
"bzip2-1.0.6"
] | null | null | null | parqueo/urls.py | gersonjuarez/Laboratorio | 3ed5dc57136ec593e3edb8ef8ca3b29abeb7dabc | [
"bzip2-1.0.6"
] | null | null | null | """parqueo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/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-based... | 34.045455 | 77 | 0.708945 | from django.contrib import admin
from django.urls import path
urlpatterns = [
path('admin/', admin.site.urls),
]
| true | true |
f71c0110baa8d07d6722fcdc95decbbb7f63ec63 | 2,576 | py | Python | arviz/plots/backends/matplotlib/distplot.py | StanczakDominik/arviz | ec33b4cc7d4a6d5ba95a87a43ef226a49c2cb287 | [
"Apache-2.0"
] | null | null | null | arviz/plots/backends/matplotlib/distplot.py | StanczakDominik/arviz | ec33b4cc7d4a6d5ba95a87a43ef226a49c2cb287 | [
"Apache-2.0"
] | null | null | null | arviz/plots/backends/matplotlib/distplot.py | StanczakDominik/arviz | ec33b4cc7d4a6d5ba95a87a43ef226a49c2cb287 | [
"Apache-2.0"
] | null | null | null | """Matplotlib distplot."""
import warnings
import matplotlib.pyplot as plt
import numpy as np
from . import backend_show
from ...kdeplot import plot_kde
from ...plot_utils import matplotlib_kwarg_dealiaser
from ....numeric_utils import get_bins
def plot_dist(
values,
values2,
color,
kind,
cumulati... | 24.301887 | 91 | 0.588898 | import warnings
import matplotlib.pyplot as plt
import numpy as np
from . import backend_show
from ...kdeplot import plot_kde
from ...plot_utils import matplotlib_kwarg_dealiaser
from ....numeric_utils import get_bins
def plot_dist(
values,
values2,
color,
kind,
cumulative,
label,
rotated,... | true | true |
f71c01c109a11f63936b4d9b8326f9b1b1a2d93f | 452 | py | Python | cookies/ex2/main.py | acandreani/ads_web_exercicios | a97ee7ebd0dba9e308b8e2d2318e577903f83f72 | [
"MIT"
] | 1 | 2019-03-13T14:33:28.000Z | 2019-03-13T14:33:28.000Z | cookies/ex2/main.py | acandreani/ads_web_exercicios | a97ee7ebd0dba9e308b8e2d2318e577903f83f72 | [
"MIT"
] | 1 | 2021-06-23T20:56:49.000Z | 2021-06-23T20:56:49.000Z | cookies/ex2/main.py | acandreani/ads_web_exercicios | a97ee7ebd0dba9e308b8e2d2318e577903f83f72 | [
"MIT"
] | 1 | 2019-04-24T13:10:58.000Z | 2019-04-24T13:10:58.000Z | from flask import Flask, render_template, request, session,redirect, url_for, escape, request, make_response
app = Flask(__name__)
# configure a chave secreta
app.secret_key = "segredo"
@app.route('/')
def index():
return render_template("index.html")
# use cookies.get(key) instead of cookies[key] t... | 22.6 | 110 | 0.679204 | from flask import Flask, render_template, request, session,redirect, url_for, escape, request, make_response
app = Flask(__name__)
app.secret_key = "segredo"
@app.route('/')
def index():
return render_template("index.html")
if __name__== "__main__":
app.run(host="0.0.0.0",debug= Tr... | true | true |
f71c0215c62089a43b38c7a560870eff98f3266c | 540 | py | Python | Exercicios-Python/exercicios-curso-em-video/d004.py | PedroGoes16/Estudos | 142a697a1d375590bb76847a74ed2b8f9fa44a9d | [
"MIT"
] | null | null | null | Exercicios-Python/exercicios-curso-em-video/d004.py | PedroGoes16/Estudos | 142a697a1d375590bb76847a74ed2b8f9fa44a9d | [
"MIT"
] | null | null | null | Exercicios-Python/exercicios-curso-em-video/d004.py | PedroGoes16/Estudos | 142a697a1d375590bb76847a74ed2b8f9fa44a9d | [
"MIT"
] | null | null | null | n = input('Digite algo: ')
print('É composto por número e letras? ',n.isalnum())
print('É composto somente por letras maiúsculas? ',n.isupper())
print('É composto somente por letras? ',n.isalpha())
print('É composto somente por números? ',n.isnumeric())
print('É um número decimal? ',n.isdecimal())
print('É composto som... | 49.090909 | 63 | 0.709259 | n = input('Digite algo: ')
print('É composto por número e letras? ',n.isalnum())
print('É composto somente por letras maiúsculas? ',n.isupper())
print('É composto somente por letras? ',n.isalpha())
print('É composto somente por números? ',n.isnumeric())
print('É um número decimal? ',n.isdecimal())
print('É composto som... | true | true |
f71c027cc59d99ded5c1d7d4bb2ac9fc391c9882 | 9,319 | py | Python | squares.py | IAmUnStTV/Tetris-Python | 4a676b6f72ceabce796592611f2541665e4010be | [
"Apache-2.0"
] | 16 | 2019-03-20T12:33:53.000Z | 2021-10-16T12:13:39.000Z | squares.py | IAmUnStTV/Tetris-Python | 4a676b6f72ceabce796592611f2541665e4010be | [
"Apache-2.0"
] | 2 | 2019-04-01T14:07:07.000Z | 2021-07-15T14:08:58.000Z | squares.py | IAmUnStTV/Tetris-Python | 4a676b6f72ceabce796592611f2541665e4010be | [
"Apache-2.0"
] | 12 | 2019-03-30T11:32:30.000Z | 2021-09-15T02:49:00.000Z | from random import randrange
from pygame import Rect, draw
from clock import Clock
class Squares:
"""method for malipulating squares in the game"""
def __init__(self, st, status, screen):
self.st = st
self.status = status
self.screen = screen
self.empty_line = ['none' for i in r... | 35.166038 | 95 | 0.570877 | from random import randrange
from pygame import Rect, draw
from clock import Clock
class Squares:
def __init__(self, st, status, screen):
self.st = st
self.status = status
self.screen = screen
self.empty_line = ['none' for i in range(st.square_num_x)]
self.squares = [self.em... | true | true |
f71c030abc2d29b0f256a337f0e78e71b90e4000 | 3,839 | py | Python | spirit/topic/views.py | BinaryTree0/fer3 | 85c3bbf2f328e69ad4d7c01b6e2c8d4ef1d9e0a3 | [
"MIT"
] | null | null | null | spirit/topic/views.py | BinaryTree0/fer3 | 85c3bbf2f328e69ad4d7c01b6e2c8d4ef1d9e0a3 | [
"MIT"
] | 5 | 2021-06-08T21:03:58.000Z | 2022-03-12T00:18:43.000Z | spirit/topic/views.py | BinaryTree0/fer3 | 85c3bbf2f328e69ad4d7c01b6e2c8d4ef1d9e0a3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponsePermanentRedirect
from djconfig import config
from ..core.utils.views import is_post, post_data
from ..core.utils.paginator import pag... | 29.75969 | 75 | 0.64496 |
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponsePermanentRedirect
from djconfig import config
from ..core.utils.views import is_post, post_data
from ..core.utils.paginator import paginate, yt_paginate
from... | true | true |
f71c03b58cbe884de8ef7d23450e58f05962f59e | 1,242 | py | Python | src/alocacao/camada_servicos/unit_of_work.py | ralphribeiro/APWP-T2 | 1ed5552a32ae9320eadbbd0489c2082a6f8750a8 | [
"MIT"
] | null | null | null | src/alocacao/camada_servicos/unit_of_work.py | ralphribeiro/APWP-T2 | 1ed5552a32ae9320eadbbd0489c2082a6f8750a8 | [
"MIT"
] | null | null | null | src/alocacao/camada_servicos/unit_of_work.py | ralphribeiro/APWP-T2 | 1ed5552a32ae9320eadbbd0489c2082a6f8750a8 | [
"MIT"
] | null | null | null | from __future__ import annotations
import abc
from alocacao.adapters import repository
from alocacao.config import DEFAULT_SESSION_FACTORY
class AbstractUOW(abc.ABC):
produtos: repository.AbstractRepository
def __enter__(self) -> AbstractUOW:
return self
def __exit__(self, *args):
self.... | 23 | 64 | 0.661031 | from __future__ import annotations
import abc
from alocacao.adapters import repository
from alocacao.config import DEFAULT_SESSION_FACTORY
class AbstractUOW(abc.ABC):
produtos: repository.AbstractRepository
def __enter__(self) -> AbstractUOW:
return self
def __exit__(self, *args):
self.... | true | true |
f71c040eaeb86dff7c316dbfe8fc57cc5b43e211 | 255 | py | Python | class9/e4/mytest/whatever.py | ktbyers/pynet_wantonik | 601bce26142b6741202c2bdafb9e0d0cec1b3c78 | [
"Apache-2.0"
] | 2 | 2017-05-11T12:05:15.000Z | 2021-07-15T18:13:19.000Z | class9/e4/mytest/whatever.py | ktbyers/pynet_wantonik | 601bce26142b6741202c2bdafb9e0d0cec1b3c78 | [
"Apache-2.0"
] | null | null | null | class9/e4/mytest/whatever.py | ktbyers/pynet_wantonik | 601bce26142b6741202c2bdafb9e0d0cec1b3c78 | [
"Apache-2.0"
] | 1 | 2017-05-11T12:05:18.000Z | 2017-05-11T12:05:18.000Z | #!/usr/bin/env python
'''Excercise_4 - class9 - Reusable Code'''
def func3():
'''func3 to print simple statement'''
print 'Excercise_4 from class9 - whatever.py'
if __name__ == "__main__":
print 'This is main program from whatever.py file.'
| 25.5 | 55 | 0.678431 |
'''Excercise_4 - class9 - Reusable Code'''
def func3():
'''func3 to print simple statement'''
print 'Excercise_4 from class9 - whatever.py'
if __name__ == "__main__":
print 'This is main program from whatever.py file.'
| false | true |
f71c045146eab77490951be322d1c2d7585e636d | 1,143 | py | Python | ISMLnextGen/ipTest.py | Ravenclaw-OIer/ISML_auto_voter | 9c53bd87530697d374163f571186542c3fc9734b | [
"MIT"
] | 128 | 2020-11-16T09:28:17.000Z | 2022-03-14T10:38:52.000Z | ISMLnextGen/ipTest.py | Ravenclaw-OIer/ISML_auto_voter | 9c53bd87530697d374163f571186542c3fc9734b | [
"MIT"
] | 7 | 2020-11-27T14:45:19.000Z | 2022-02-15T09:47:12.000Z | ISMLnextGen/ipTest.py | Ravenclaw-OIer/ISML_auto_voter | 9c53bd87530697d374163f571186542c3fc9734b | [
"MIT"
] | 11 | 2020-12-11T12:24:38.000Z | 2022-02-20T12:42:31.000Z | #coding:utf-8
#访问这个服务器会获得一些'ip:端口'字符串。仅用于测试
import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
@tornado.gen.coroutine
def get(self, *args, **kwargs):
self.write('''
<!DOCTYPE html><html>
<head><meta charset="utf-8" />
... | 30.891892 | 59 | 0.451444 |
import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
@tornado.gen.coroutine
def get(self, *args, **kwargs):
self.write('''
<!DOCTYPE html><html>
<head><meta charset="utf-8" />
<title>html<br>标签换行符详细介绍... | true | true |
f71c04a43a1f6647a62748e5a3330dd9e4062b48 | 3,194 | py | Python | tweetconsumer.py | jvprosser/tweet2avro2kafka2kudu | 27eacea8a5361c94ae179d28bf455883c3803ecb | [
"Apache-2.0"
] | null | null | null | tweetconsumer.py | jvprosser/tweet2avro2kafka2kudu | 27eacea8a5361c94ae179d28bf455883c3803ecb | [
"Apache-2.0"
] | null | null | null | tweetconsumer.py | jvprosser/tweet2avro2kafka2kudu | 27eacea8a5361c94ae179d28bf455883c3803ecb | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import threading, logging, time
import io
import avro.schema
import avro.io
import pprint
import kudu
from kudu.client import Partitioning
from kafka import KafkaConsumer
pp = pprint.PrettyPrinter(indent=4,width=80)
twitter_schema='''
{"namespace": "example.avro", ... | 31.623762 | 183 | 0.530056 |
import threading, logging, time
import io
import avro.schema
import avro.io
import pprint
import kudu
from kudu.client import Partitioning
from kafka import KafkaConsumer
pp = pprint.PrettyPrinter(indent=4,width=80)
twitter_schema='''
{"namespace": "example.avro", ... | false | true |
f71c05e483d33dc4be29042dc38a37ccadce4386 | 6,756 | py | Python | Sensors/softskin.py | zhaocy14/SmartWalker | b025a7b4a2b305838a22fe4e6116ddb951c4d7bf | [
"MIT"
] | 2 | 2021-11-13T14:16:06.000Z | 2022-01-12T06:07:32.000Z | Sensors/softskin.py | zhaocy14/SmartWalker | b025a7b4a2b305838a22fe4e6116ddb951c4d7bf | [
"MIT"
] | null | null | null | Sensors/softskin.py | zhaocy14/SmartWalker | b025a7b4a2b305838a22fe4e6116ddb951c4d7bf | [
"MIT"
] | 3 | 2021-08-30T04:40:39.000Z | 2022-01-09T11:34:04.000Z | import serial
import serial.tools.list_ports
import numpy as np
import math
import threading
import re
import os
import sys
import time
import matplotlib.pyplot as plt
pwd = os.path.abspath(os.path.abspath(__file__))
father_path = os.path.abspath(os.path.dirname(pwd) + os.path.sep + "..")
sys.path.append(father_path)
... | 36.518919 | 93 | 0.558467 | import serial
import serial.tools.list_ports
import numpy as np
import math
import threading
import re
import os
import sys
import time
import matplotlib.pyplot as plt
pwd = os.path.abspath(os.path.abspath(__file__))
father_path = os.path.abspath(os.path.dirname(pwd) + os.path.sep + "..")
sys.path.append(father_path)
... | true | true |
f71c0620c464a57b3ebe69ac3d9aba39ae33da92 | 1,518 | py | Python | olass/models/base_query.py | ufbmi/olass-client | 2fc949d4d59959e7e3ba5ec737b20d8db856b54b | [
"MIT"
] | null | null | null | olass/models/base_query.py | ufbmi/olass-client | 2fc949d4d59959e7e3ba5ec737b20d8db856b54b | [
"MIT"
] | 1 | 2016-08-12T20:52:09.000Z | 2016-08-12T20:59:35.000Z | olass/models/base_query.py | ufbmi/olass-client | 2fc949d4d59959e7e3ba5ec737b20d8db856b54b | [
"MIT"
] | 1 | 2016-06-28T16:43:09.000Z | 2016-06-28T16:43:09.000Z | """
Goal: Provides paginate() function
"""
from sqlalchemy import orm
from olass.models.pagination import Pagination
class BaseQuery(orm.Query):
"""
@see: flask-sqlalchemy/flask_sqlalchemy/__init__.py
"""
def paginate(self, page=None, per_page=None, error_out=True):
"""Returns ``per_page`` it... | 30.36 | 79 | 0.597497 | from sqlalchemy import orm
from olass.models.pagination import Pagination
class BaseQuery(orm.Query):
def paginate(self, page=None, per_page=None, error_out=True):
if page is None:
page = 1
if per_page is None:
per_page = 20
if error_out and page < 1:
... | true | true |
f71c06594a2607c810e62772c689e1182da44569 | 473 | py | Python | app/tasks/tasks.py | guomaoqiu/Celery_Flask_Demo | 7051361ca34c7e0d62678d8bd0e3c89403195d0f | [
"MIT"
] | 4 | 2018-04-10T10:06:03.000Z | 2021-02-06T04:48:50.000Z | app/tasks/tasks.py | guomaoqiu/Celery_Flask_Demo | 7051361ca34c7e0d62678d8bd0e3c89403195d0f | [
"MIT"
] | null | null | null | app/tasks/tasks.py | guomaoqiu/Celery_Flask_Demo | 7051361ca34c7e0d62678d8bd0e3c89403195d0f | [
"MIT"
] | 2 | 2018-06-05T08:34:19.000Z | 2018-08-13T10:41:29.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
from app import celery
from celery.utils.log import get_task_logger
import time
logger = get_task_logger(__name__)
# 定时导入
current_time = str(time.strftime('%Y-%m-%d %H:%M:%S'))
@celery.task(name="task1")
def task1():
print u"定时任务task1:每5秒执行一次" + current_time
# 记录日志
... | 18.92 | 54 | 0.674419 |
from app import celery
from celery.utils.log import get_task_logger
import time
logger = get_task_logger(__name__)
current_time = str(time.strftime('%Y-%m-%d %H:%M:%S'))
@celery.task(name="task1")
def task1():
print u"定时任务task1:每5秒执行一次" + current_time
logger.info(u"导入成功")
@celery.task(name="task2")
... | false | true |
f71c06f54e6701786b0f29d7880b93fa9b637655 | 649 | py | Python | gui.py | eduardokimmel/ofx_to_xlsx | f36dc430ca2424055feba8f04c7f48cd4741d82c | [
"MIT"
] | null | null | null | gui.py | eduardokimmel/ofx_to_xlsx | f36dc430ca2424055feba8f04c7f48cd4741d82c | [
"MIT"
] | null | null | null | gui.py | eduardokimmel/ofx_to_xlsx | f36dc430ca2424055feba8f04c7f48cd4741d82c | [
"MIT"
] | null | null | null | from tkinter.filedialog import askopenfilename
from tkinter import *
import cli
import gettext
window = Tk()
window.title("ofx_to_xlsx")
def close_window():
window.destroy()
def callback():
ofx = askopenfilename()
cli.run(ofx)
gettext.install('ofx_to_xlsx')
t = gettext.translation('gui_i18n', 'locale'... | 19.088235 | 71 | 0.702619 | from tkinter.filedialog import askopenfilename
from tkinter import *
import cli
import gettext
window = Tk()
window.title("ofx_to_xlsx")
def close_window():
window.destroy()
def callback():
ofx = askopenfilename()
cli.run(ofx)
gettext.install('ofx_to_xlsx')
t = gettext.translation('gui_i18n', 'locale'... | true | true |
f71c071affad74a0e7aea1a05a898c897c918ab8 | 691 | py | Python | emtract/model_inference.py | dvamossy/EmTract | 68a00e3d63fbc2c401b0d2b297bf96ffb75940e8 | [
"MIT"
] | 16 | 2021-12-02T18:59:56.000Z | 2022-03-31T11:42:12.000Z | emtract/model_inference.py | dvamossy/EmTract | 68a00e3d63fbc2c401b0d2b297bf96ffb75940e8 | [
"MIT"
] | null | null | null | emtract/model_inference.py | dvamossy/EmTract | 68a00e3d63fbc2c401b0d2b297bf96ffb75940e8 | [
"MIT"
] | 1 | 2021-12-09T06:05:22.000Z | 2021-12-09T06:05:22.000Z | import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
from emtract.model import Model, ModelType
import pandas as pd
class ModelInference:
MODEL_BASE_PATH = 'build/models/'
DATA_BASE_PATH = './emtract/data/'
def __init__(self, model_type):
if model_type == 'twitter':
self.model = Model(... | 27.64 | 62 | 0.662808 | import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
from emtract.model import Model, ModelType
import pandas as pd
class ModelInference:
MODEL_BASE_PATH = 'build/models/'
DATA_BASE_PATH = './emtract/data/'
def __init__(self, model_type):
if model_type == 'twitter':
self.model = Model(... | true | true |
f71c07a140ce757dc105e33553450a64b401d600 | 147 | py | Python | students/k33422/Alexandrin_Anton/Lr2/homework/main/admin.py | aytakr/ITMO_ICT_WebDevelopment_2021-2022 | 57c0eef5e1f413c7f031ee001d59e5122f990f26 | [
"MIT"
] | 7 | 2021-09-02T08:20:58.000Z | 2022-01-12T11:48:07.000Z | students/k33422/Alexandrin_Anton/Lr2/homework/main/admin.py | aytakr/ITMO_ICT_WebDevelopment_2021-2022 | 57c0eef5e1f413c7f031ee001d59e5122f990f26 | [
"MIT"
] | 76 | 2021-09-17T23:01:50.000Z | 2022-03-18T16:42:03.000Z | students/k33422/Alexandrin_Anton/Lr2/homework/main/admin.py | aytakr/ITMO_ICT_WebDevelopment_2021-2022 | 57c0eef5e1f413c7f031ee001d59e5122f990f26 | [
"MIT"
] | 60 | 2021-09-04T16:47:39.000Z | 2022-03-21T04:41:27.000Z | from django.contrib import admin
from .models import *
admin.site.register(Student)
admin.site.register(Homework)
admin.site.register(Assignment)
| 21 | 32 | 0.816327 | from django.contrib import admin
from .models import *
admin.site.register(Student)
admin.site.register(Homework)
admin.site.register(Assignment)
| true | true |
f71c0829da8f53bf5fb8a4964502e266c6e624a6 | 1,918 | py | Python | tests/test_rabbitmq_consumer_command.py | LaEmma/sparrow_cloud | fb9f76ea70b3ba5782c33f3b3379e2ffe4bab08c | [
"MIT"
] | null | null | null | tests/test_rabbitmq_consumer_command.py | LaEmma/sparrow_cloud | fb9f76ea70b3ba5782c33f3b3379e2ffe4bab08c | [
"MIT"
] | null | null | null | tests/test_rabbitmq_consumer_command.py | LaEmma/sparrow_cloud | fb9f76ea70b3ba5782c33f3b3379e2ffe4bab08c | [
"MIT"
] | null | null | null | import os
import unittest
from django.conf.urls import url
from django.http import HttpResponse
def task(*args, **kwargs):
print('*'*10)
def detail(request, question_id):
return HttpResponse("You're looking at question %s." % question_id)
urlpatterns = [
url(r'^/ssss/xxx/$', detail),
url(r'^/ssuuu... | 31.442623 | 88 | 0.606361 | import os
import unittest
from django.conf.urls import url
from django.http import HttpResponse
def task(*args, **kwargs):
print('*'*10)
def detail(request, question_id):
return HttpResponse("You're looking at question %s." % question_id)
urlpatterns = [
url(r'^/ssss/xxx/$', detail),
url(r'^/ssuuu... | true | true |
f71c08e2095d6c92591d4e24b87dfa59366adf76 | 1,108 | py | Python | manage.py | cjmabry/PoliChart | 787d987669de4891b1b1ac5f8ebc0ecd38ac2785 | [
"BSD-3-Clause"
] | null | null | null | manage.py | cjmabry/PoliChart | 787d987669de4891b1b1ac5f8ebc0ecd38ac2785 | [
"BSD-3-Clause"
] | null | null | null | manage.py | cjmabry/PoliChart | 787d987669de4891b1b1ac5f8ebc0ecd38ac2785 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import os
from flask.ext.script import Manager
from polichart import create_app, polling
from polichart.extensions import db
from polichart.utils import MALE
from flask import url_for
app = create_app()
manager = Manager(app)
@app.context_processor
def override_url_for():
return dict(u... | 21.307692 | 58 | 0.617329 |
import os
from flask.ext.script import Manager
from polichart import create_app, polling
from polichart.extensions import db
from polichart.utils import MALE
from flask import url_for
app = create_app()
manager = Manager(app)
@app.context_processor
def override_url_for():
return dict(url_for=dated_url_for)
... | true | true |
f71c093c62e3d49d16d3c9cbf3b0a2a8b7fd68d6 | 2,128 | py | Python | integrationtest/vm/installation/upgrade/test_zs_upgd_1.3_latest_on_cos7.py | bgerxx/woodpecker | fdc51245945cc9be4d1f028988079213eb99b2ad | [
"Apache-2.0"
] | null | null | null | integrationtest/vm/installation/upgrade/test_zs_upgd_1.3_latest_on_cos7.py | bgerxx/woodpecker | fdc51245945cc9be4d1f028988079213eb99b2ad | [
"Apache-2.0"
] | null | null | null | integrationtest/vm/installation/upgrade/test_zs_upgd_1.3_latest_on_cos7.py | bgerxx/woodpecker | fdc51245945cc9be4d1f028988079213eb99b2ad | [
"Apache-2.0"
] | null | null | null | '''
@author: MengLai
'''
import os
import tempfile
import uuid
import time
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstacklib.utils.ssh as ssh
import zstackwoodpecker.operations.scenario_operations ... | 33.777778 | 75 | 0.740132 | import os
import tempfile
import uuid
import time
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstacklib.utils.ssh as ssh
import zstackwoodpecker.operations.scenario_operations as scen_ops
test_stub = tes... | true | true |
f71c0a5782bf191b5540c2eb75fdf8f2a7d65eb4 | 4,189 | py | Python | tools/ISM_ticket_creation/ISM_ticket_creation.py | thahasinab/risksense_tools | 55399f21c680735e3c557484ec8788a33c1525e7 | [
"Apache-2.0"
] | null | null | null | tools/ISM_ticket_creation/ISM_ticket_creation.py | thahasinab/risksense_tools | 55399f21c680735e3c557484ec8788a33c1525e7 | [
"Apache-2.0"
] | null | null | null | tools/ISM_ticket_creation/ISM_ticket_creation.py | thahasinab/risksense_tools | 55399f21c680735e3c557484ec8788a33c1525e7 | [
"Apache-2.0"
] | null | null | null | import requests
import json
import time
import os
import toml
import zipfile
import csv
import pandas as pd
from datetime import date
from datetime import datetime
import logging
def incident_create(ism_url,ism_key,ism_attachment_url,final_directory,tag_name_list,flag_AH,assignee,assignee_desc,profile_link):
Patch... | 46.544444 | 1,031 | 0.627596 | import requests
import json
import time
import os
import toml
import zipfile
import csv
import pandas as pd
from datetime import date
from datetime import datetime
import logging
def incident_create(ism_url,ism_key,ism_attachment_url,final_directory,tag_name_list,flag_AH,assignee,assignee_desc,profile_link):
Patch... | true | true |
f71c0b020116ae97bd345db15ac8c2ee8e6c6d43 | 28,999 | py | Python | venv/Lib/site-packages/pip/_internal/cli/cmdoptions.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 38,667 | 2015-01-01T00:15:34.000Z | 2022-03-31T22:57:03.000Z | venv/Lib/site-packages/pip/_internal/cli/cmdoptions.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 1,192 | 2015-01-03T07:59:34.000Z | 2022-03-31T13:22:26.000Z | venv/Lib/site-packages/pip/_internal/cli/cmdoptions.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 11,269 | 2015-01-01T08:41:17.000Z | 2022-03-31T16:12:52.000Z | """
shared options and groups
The principle here is to define options once, but *not* instantiate them
globally. One reason being that options with action='append' can carry state
between parses. pip parses general options twice internally, and shouldn't
pass on state. To be consistent, all options will follow this de... | 28.291707 | 82 | 0.626746 |
import os
import textwrap
import warnings
from functools import partial
from optparse import SUPPRESS_HELP, Option, OptionGroup, OptionParser, Values
from textwrap import dedent
from typing import Any, Callable, Dict, Optional, Tuple
from pip._vendor.packaging.utils import canonicalize_name
from pip._internal.cli... | true | true |
f71c0e613c8658e9c5d1b5f8b68e473cd366b6c5 | 8,773 | py | Python | src/sst/elements/memHierarchy/tests/testsuite_default_memHierarchy_sdl.py | sudhanshu2/sst-elements | d658e5e4b26e5725488f9e93528506ddb22072ee | [
"BSD-3-Clause"
] | null | null | null | src/sst/elements/memHierarchy/tests/testsuite_default_memHierarchy_sdl.py | sudhanshu2/sst-elements | d658e5e4b26e5725488f9e93528506ddb22072ee | [
"BSD-3-Clause"
] | null | null | null | src/sst/elements/memHierarchy/tests/testsuite_default_memHierarchy_sdl.py | sudhanshu2/sst-elements | d658e5e4b26e5725488f9e93528506ddb22072ee | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from sst_unittest import *
from sst_unittest_support import *
import os.path
################################################################################
# Code to support a single instance module initialize, must be called setUp method
module_init = 0
module_sema = threading.Semaphore()
... | 40.428571 | 140 | 0.619514 |
from sst_unittest import *
from sst_unittest_support import *
import os.path
| true | true |
f71c0f38bd33c235f501fe3157c2816cd7eb598d | 2,430 | py | Python | data/p4VQE/R4/benchmark/startQiskit_noisy62.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startQiskit_noisy62.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startQiskit_noisy62.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=3
# total number=10
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
import networkx as nx
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collectio... | 27 | 118 | 0.631687 |
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
import networkx as nx
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from qiskit.tes... | true | true |
f71c0f815fea461fc753f56d6e32829a423105fd | 431 | py | Python | project/tasks/sample_tasks.py | idjemaoune/django-celery | 411e854fc63a4d42be2a6e8861c4dc6b89969161 | [
"MIT"
] | null | null | null | project/tasks/sample_tasks.py | idjemaoune/django-celery | 411e854fc63a4d42be2a6e8861c4dc6b89969161 | [
"MIT"
] | null | null | null | project/tasks/sample_tasks.py | idjemaoune/django-celery | 411e854fc63a4d42be2a6e8861c4dc6b89969161 | [
"MIT"
] | null | null | null | # project/tasks/sample_tasks.py
import time
from celery import shared_task
@shared_task
def send_email(email_id, message):
time.sleep(10)
print(f"Email is sent to {email_id}. Message sent was - {message}")
@shared_task
def get_micro_app_status(app):
print(f"La micro app {app}. est UP")
@shared_task
... | 17.958333 | 71 | 0.716937 |
import time
from celery import shared_task
@shared_task
def send_email(email_id, message):
time.sleep(10)
print(f"Email is sent to {email_id}. Message sent was - {message}")
@shared_task
def get_micro_app_status(app):
print(f"La micro app {app}. est UP")
@shared_task
def create_task(task_type):
... | true | true |
f71c0fb67deffb5ad5e92f615b5c852fabdd95ff | 9,938 | py | Python | docs/_downloads/d923ca53b1bfbeb3c222ae46d65d485e/transfer_learning_tutorial.py | pleiades-s/PyTorch-tutorials-kr | 3d749ea2fe67363b5d46340b742308b744fa0419 | [
"BSD-3-Clause"
] | 2 | 2021-01-18T04:59:05.000Z | 2021-03-20T00:56:24.000Z | docs/_downloads/d923ca53b1bfbeb3c222ae46d65d485e/transfer_learning_tutorial.py | pleiades-s/PyTorch-tutorials-kr | 3d749ea2fe67363b5d46340b742308b744fa0419 | [
"BSD-3-Clause"
] | null | null | null | docs/_downloads/d923ca53b1bfbeb3c222ae46d65d485e/transfer_learning_tutorial.py | pleiades-s/PyTorch-tutorials-kr | 3d749ea2fe67363b5d46340b742308b744fa0419 | [
"BSD-3-Clause"
] | 1 | 2022-02-27T10:47:39.000Z | 2022-02-27T10:47:39.000Z | # -*- coding: utf-8 -*-
"""
컴퓨터 비전(Vision)을 위한 전이학습(Transfer Learning)
=======================================================
**Author**: `Sasank Chilamkurthy <https://chsasank.github.io>`_
**번역**: `박정환 <http://github.com/9bow>`_
이 튜토리얼에서는 전이학습(Transfer Learning)을 이용하여 이미지 분류를 위한
합성곱 신경망을 어떻게 학습시키는지 배워보겠습니다. 전이학습에 ... | 29.229412 | 88 | 0.553934 |
from __future__ import print_function, division
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
import numpy as np
import torchvision
from torchvision import datasets, models, transforms
import matplotlib.pyplot as plt
import time
import os
import copy
plt.ion()... | true | true |
f71c100fdfb127051c66f6dd3ec6cfe317c4ad61 | 3,783 | py | Python | my3b1b/old/MicoaelPrimo.py | Micoael/3b1b-styled-video-code | 036b339573e48f807e215bc7c7be9c6fe32b601d | [
"Apache-2.0"
] | 7 | 2020-03-02T23:56:39.000Z | 2020-06-08T15:05:46.000Z | my3b1b/old/MicoaelPrimo.py | Micoael/3b1b-styled-video-code | 036b339573e48f807e215bc7c7be9c6fe32b601d | [
"Apache-2.0"
] | null | null | null | my3b1b/old/MicoaelPrimo.py | Micoael/3b1b-styled-video-code | 036b339573e48f807e215bc7c7be9c6fe32b601d | [
"Apache-2.0"
] | null | null | null | from manimlib.imports import *
class StartingScene(Scene):
def construct(_):
e = Text("Manim homework by mp",font="Consolas",color=BLUE)
_.play(Write(e),run_time=3)
_.wait()
_.play(Uncreate(e))
A = Dot().move_to(np.array([0-2,0,0]))
B = Dot().m... | 49.12987 | 133 | 0.576791 | from manimlib.imports import *
class StartingScene(Scene):
def construct(_):
e = Text("Manim homework by mp",font="Consolas",color=BLUE)
_.play(Write(e),run_time=3)
_.wait()
_.play(Uncreate(e))
A = Dot().move_to(np.array([0-2,0,0]))
B = Dot().m... | true | true |
f71c111b67dac5359468b1d2de3970e43bfa4ea3 | 5,551 | py | Python | leetcode_python/Array/longest-arithmetic-subsequence.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Array/longest-arithmetic-subsequence.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Array/longest-arithmetic-subsequence.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | """
1027. Longest Arithmetic Subsequence
Medium
Given an array nums of integers, return the length of the longest arithmetic subsequence in nums.
Recall that a subsequence of an array nums is a list nums[i1], nums[i2], ..., nums[ik] with 0 <= i1 < i2 < ... < ik <= nums.length - 1, and that a sequence seq is arithmet... | 31.361582 | 248 | 0.503513 |
class Solution:
def longestArithSeqLength(self, A):
dp = {}
for i in range(len(A)):
for j in range(i + 1, len(A)):
dp[j, A[j] - A[i]] = dp.get((i, A[j] - A[i]), 1) + 1
return max(dp.values())
# IDEA : HASH TABLE
# https://leetcode.com/prob... | true | true |
f71c1149bd0ccd4c108d6852f0e7e33eb102e6e2 | 1,820 | py | Python | tests/util/test_i18n.py | zsluedem/MonkTrader | 760942a59919b34c876467bc0eb4afb30689cbc1 | [
"MIT"
] | 2 | 2018-11-17T06:39:36.000Z | 2019-01-18T13:14:15.000Z | tests/util/test_i18n.py | zsluedem/MonkTrader | 760942a59919b34c876467bc0eb4afb30689cbc1 | [
"MIT"
] | 37 | 2018-11-04T15:05:04.000Z | 2019-03-09T09:26:30.000Z | tests/util/test_i18n.py | zsluedem/MonkTrader | 760942a59919b34c876467bc0eb4afb30689cbc1 | [
"MIT"
] | null | null | null | #
# MIT License
#
# Copyright (c) 2018 WillQ
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... | 37.142857 | 79 | 0.737363 |
import os
from unittest.mock import MagicMock, patch
from monkq.utils.i18n import LazyTranslation
def test_lazytranslation_not_setting() -> None:
with patch("monkq.utils.i18n.gettext", MagicMock()) as mockg:
mockg.find.return_value = None
trans = LazyTranslation()
... | true | true |
f71c138dfb3853f24c17b2b530c0d786d88a9cf0 | 5,959 | py | Python | modelEpochs.py | JDMusc/Online-Bullying-Image-Classifcation | 9196c60c554cf160d68cb9e9c41fda124abebf63 | [
"MIT"
] | null | null | null | modelEpochs.py | JDMusc/Online-Bullying-Image-Classifcation | 9196c60c554cf160d68cb9e9c41fda124abebf63 | [
"MIT"
] | null | null | null | modelEpochs.py | JDMusc/Online-Bullying-Image-Classifcation | 9196c60c554cf160d68cb9e9c41fda124abebf63 | [
"MIT"
] | null | null | null | import copy
import numpy as np
from numpy import log10
import os
from toolz import pipe as p
from tensorboardX import SummaryWriter
import torch
import torch.nn as nn
import numpy as np
import preprocessing as pp
def findParam(model, name_filter):
if callable(name_filter):
fn = name_filter
else:
... | 27.587963 | 80 | 0.614365 | import copy
import numpy as np
from numpy import log10
import os
from toolz import pipe as p
from tensorboardX import SummaryWriter
import torch
import torch.nn as nn
import numpy as np
import preprocessing as pp
def findParam(model, name_filter):
if callable(name_filter):
fn = name_filter
else:
... | true | true |
f71c143502daacb5d0cac62a6b711503065c58e7 | 505 | py | Python | functions/l3Consume.py | yuklia/serverless-lambda-chaining | dd24129933489c2f1a522b37d8f4c3e16eb47285 | [
"MIT"
] | null | null | null | functions/l3Consume.py | yuklia/serverless-lambda-chaining | dd24129933489c2f1a522b37d8f4c3e16eb47285 | [
"MIT"
] | null | null | null | functions/l3Consume.py | yuklia/serverless-lambda-chaining | dd24129933489c2f1a522b37d8f4c3e16eb47285 | [
"MIT"
] | null | null | null | import json
def handler(event, context):
message_from_publisher = json.loads(event['Records'][0]['Sns']['Message'])
my_param = message_from_publisher['myParamFromConsumerPublisher']
print("👷 Received paramater from ConsumerPublisher: '{0}'".format(my_param))
body = {
"message": "Go Serve... | 24.047619 | 80 | 0.637624 | import json
def handler(event, context):
message_from_publisher = json.loads(event['Records'][0]['Sns']['Message'])
my_param = message_from_publisher['myParamFromConsumerPublisher']
print("👷 Received paramater from ConsumerPublisher: '{0}'".format(my_param))
body = {
"message": "Go Serve... | true | true |
f71c145bb6baf46c8e813d23d04f55fadd9b6a4e | 112 | py | Python | test/nohtml.py | eaybek/nohtml | 9df8fc032891591516d8a719ebc15440d8cc7a0c | [
"MIT"
] | null | null | null | test/nohtml.py | eaybek/nohtml | 9df8fc032891591516d8a719ebc15440d8cc7a0c | [
"MIT"
] | null | null | null | test/nohtml.py | eaybek/nohtml | 9df8fc032891591516d8a719ebc15440d8cc7a0c | [
"MIT"
] | null | null | null | import unittest
class NohtmlTest(unittest.TestCase):
pass
if __name__ == "__main__":
unittest.main()
| 12.444444 | 36 | 0.705357 | import unittest
class NohtmlTest(unittest.TestCase):
pass
if __name__ == "__main__":
unittest.main()
| true | true |
f71c154fa91e7b9687d0c58c927b63ccf6253ccb | 3,682 | py | Python | ReUseModel/TestFAEModel.py | Eggiverse/FAE | 1b953ba6dfcced83e5929eeaa8f525ec4acde5ed | [
"MIT"
] | null | null | null | ReUseModel/TestFAEModel.py | Eggiverse/FAE | 1b953ba6dfcced83e5929eeaa8f525ec4acde5ed | [
"MIT"
] | null | null | null | ReUseModel/TestFAEModel.py | Eggiverse/FAE | 1b953ba6dfcced83e5929eeaa8f525ec4acde5ed | [
"MIT"
] | null | null | null |
import os
import csv
import numpy as np
from FAE.FeatureAnalysis.Normalizer import Normalizer
from FAE.DataContainer.DataContainer import DataContainer
from FAE.FeatureAnalysis.Classifier import Classifier
from FAE.Func.Metric import EstimateMetirc
from FAE.FeatureAnalysis.FeatureSelector import FeatureSelecto... | 32.875 | 111 | 0.69962 |
import os
import csv
import numpy as np
from FAE.FeatureAnalysis.Normalizer import Normalizer
from FAE.DataContainer.DataContainer import DataContainer
from FAE.FeatureAnalysis.Classifier import Classifier
from FAE.Func.Metric import EstimateMetirc
from FAE.FeatureAnalysis.FeatureSelector import FeatureSelecto... | true | true |
f71c159e39dcb104058740ebee5fb752312a3553 | 160 | py | Python | cranes/__init__.py | annehulsey/high-resolution_post-earthquake_recovery_simulation_of_safety_cordons | 8b8bedceee0343d22143f48992136fc2fc34e191 | [
"MIT"
] | null | null | null | cranes/__init__.py | annehulsey/high-resolution_post-earthquake_recovery_simulation_of_safety_cordons | 8b8bedceee0343d22143f48992136fc2fc34e191 | [
"MIT"
] | null | null | null | cranes/__init__.py | annehulsey/high-resolution_post-earthquake_recovery_simulation_of_safety_cordons | 8b8bedceee0343d22143f48992136fc2fc34e191 | [
"MIT"
] | null | null | null | from .base import *
from .mapping import *
from .community_damage_sampling import *
from .downtime_logistics import *
from .analysis_and_visualization import *
| 26.666667 | 41 | 0.8125 | from .base import *
from .mapping import *
from .community_damage_sampling import *
from .downtime_logistics import *
from .analysis_and_visualization import *
| true | true |
f71c1615d02213bb8e244cd957fa6b17a89b9787 | 2,153 | py | Python | plugins/zscaler/icon_zscaler/actions/lookup_url/schema.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/zscaler/icon_zscaler/actions/lookup_url/schema.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/zscaler/icon_zscaler/actions/lookup_url/schema.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | # GENERATED BY KOMAND SDK - DO NOT EDIT
import insightconnect_plugin_runtime
import json
class Component:
DESCRIPTION = "Look up the categorization of a given set of URLs"
class Input:
URLS = "urls"
class Output:
URL_CATEGORIZATION = "url_categorization"
class LookupUrlInput(insightconnect_p... | 21.53 | 72 | 0.533674 |
import insightconnect_plugin_runtime
import json
class Component:
DESCRIPTION = "Look up the categorization of a given set of URLs"
class Input:
URLS = "urls"
class Output:
URL_CATEGORIZATION = "url_categorization"
class LookupUrlInput(insightconnect_plugin_runtime.Input):
schema = json... | true | true |
f71c1852ffabfd6520c29aa0e5896783707f3f65 | 9,759 | py | Python | pyhtmlcv.py | lietu/pyhtmlcv | 68e75d5b761f4cbf4315d9c573fdc39872abbc20 | [
"BSD-3-Clause"
] | 3 | 2017-02-15T14:02:57.000Z | 2019-04-30T23:33:55.000Z | pyhtmlcv.py | lietu/pyhtmlcv | 68e75d5b761f4cbf4315d9c573fdc39872abbc20 | [
"BSD-3-Clause"
] | null | null | null | pyhtmlcv.py | lietu/pyhtmlcv | 68e75d5b761f4cbf4315d9c573fdc39872abbc20 | [
"BSD-3-Clause"
] | 1 | 2017-06-01T15:58:09.000Z | 2017-06-01T15:58:09.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
PyHtmlCv is a tool to that can be used to generate HTML CVs from a
simple JSON configuration.
:copyright: (c) 2012-2019 Janne Enberg
:license: BSD
"""
from argparse import ArgumentParser, ArgumentTypeError
import codecs
from datetime import datetime
from jinja2 import... | 28.043103 | 86 | 0.544216 |
from argparse import ArgumentParser, ArgumentTypeError
import codecs
from datetime import datetime
from jinja2 import Environment, FileSystemLoader
import json
try:
from pathlib import Path
except ImportError:
from pathlib2 import Path
import re
import sass
import six
import shutil
import sys
from time imp... | true | true |
f71c190a14841ef42f527cfad6bd4742ebd5bc55 | 929 | py | Python | nlpaug/util/audio/loader.py | lucidworks/nlpaug | 8e47fa39200db17f4dc1d61567af1419bc389071 | [
"MIT"
] | 1 | 2021-06-09T20:07:30.000Z | 2021-06-09T20:07:30.000Z | nlpaug/util/audio/loader.py | lucidworks/nlpaug | 8e47fa39200db17f4dc1d61567af1419bc389071 | [
"MIT"
] | null | null | null | nlpaug/util/audio/loader.py | lucidworks/nlpaug | 8e47fa39200db17f4dc1d61567af1419bc389071 | [
"MIT"
] | null | null | null | try:
import librosa
except ImportError:
# No installation required if not using this function
pass
class AudioLoader:
@staticmethod
def load_audio(file_path):
try:
import librosa
except ModuleNotFoundError:
raise ModuleNotFoundError(
"Missed ... | 28.151515 | 89 | 0.634015 | try:
import librosa
except ImportError:
pass
class AudioLoader:
@staticmethod
def load_audio(file_path):
try:
import librosa
except ModuleNotFoundError:
raise ModuleNotFoundError(
"Missed librosa library. Install import librosa by `pip insta... | true | true |
f71c191c5eb6a1641c149fff6ae72d57a8d19cda | 4,286 | py | Python | dataset/DeepFakes/faceswap-master/lib/training_data.py | MrThiago/FaceForensics | 1806e70d0dd2294a12a8afd1c3f59d6ecac639bf | [
"MIT"
] | 1,930 | 2018-04-20T14:52:01.000Z | 2022-03-30T13:53:31.000Z | dataset/DeepFakes/faceswap-master/lib/training_data.py | chrisgorgo/FaceForensics | a815daa9ebb7c12240a4b7162c431af0e1b959fa | [
"MIT"
] | 68 | 2019-02-14T09:09:02.000Z | 2022-03-23T08:55:23.000Z | dataset/DeepFakes/faceswap-master/lib/training_data.py | chrisgorgo/FaceForensics | a815daa9ebb7c12240a4b7162c431af0e1b959fa | [
"MIT"
] | 499 | 2018-04-20T11:27:11.000Z | 2022-03-29T16:29:50.000Z | import cv2
import numpy
from random import shuffle
from .utils import BackgroundGenerator
from .umeyama import umeyama
class TrainingDataGenerator():
def __init__(self, random_transform_args, coverage, scale=5, zoom=1): #TODO thos default should stay in the warp function
self.random_transform_args = rando... | 40.819048 | 187 | 0.617592 | import cv2
import numpy
from random import shuffle
from .utils import BackgroundGenerator
from .umeyama import umeyama
class TrainingDataGenerator():
def __init__(self, random_transform_args, coverage, scale=5, zoom=1):
self.random_transform_args = random_transform_args
self.coverage = coverage
... | true | true |
f71c1b0d0a31e515a655f2a67f62120cc4232d70 | 1,106 | py | Python | setup.py | albertosottile/SmartGadget-gatt | b5b4002f3635afcb97de5106676cc7142b1e9ca5 | [
"MIT"
] | 2 | 2021-06-14T18:08:16.000Z | 2021-08-29T06:48:10.000Z | setup.py | albertosottile/SmartGadget-gatt | b5b4002f3635afcb97de5106676cc7142b1e9ca5 | [
"MIT"
] | null | null | null | setup.py | albertosottile/SmartGadget-gatt | b5b4002f3635afcb97de5106676cc7142b1e9ca5 | [
"MIT"
] | 1 | 2021-08-29T06:48:11.000Z | 2021-08-29T06:48:11.000Z | #!/usr/bin/env python3
import setuptools
def read(fname):
with open(fname, 'r') as f:
return f.read()
setuptools.setup(
name="smartgadget",
version="0.1",
author="Alberto Sottile",
author_email="alby128@gmail.com",
description=' '.join([
'Interact with a Sensirion SHT31 Smart ... | 30.722222 | 65 | 0.621157 |
import setuptools
def read(fname):
with open(fname, 'r') as f:
return f.read()
setuptools.setup(
name="smartgadget",
version="0.1",
author="Alberto Sottile",
author_email="alby128@gmail.com",
description=' '.join([
'Interact with a Sensirion SHT31 Smart Gadget',
'Deve... | true | true |
f71c1b1f9c2288ed03520cd964f1b666fcfab9a4 | 1,302 | py | Python | CV_A4_/A4_compute_descriptors.py | pseudowasabi/computer-vision-exercises | 34b7c8402c32dbb00e484f90780ebb6546a3f8dc | [
"MIT"
] | null | null | null | CV_A4_/A4_compute_descriptors.py | pseudowasabi/computer-vision-exercises | 34b7c8402c32dbb00e484f90780ebb6546a3f8dc | [
"MIT"
] | null | null | null | CV_A4_/A4_compute_descriptors.py | pseudowasabi/computer-vision-exercises | 34b7c8402c32dbb00e484f90780ebb6546a3f8dc | [
"MIT"
] | null | null | null | '''
Computer vision assignment 4 by Yoseob Kim
A4_compute_descriptors.py
Compute similarity-reflected image descriptors with L1, L2 norm distances by using SIFT descriptors.
* Status: (working on it)
* GitHub Link: https://github.com/pseudowasabi/computer-vision-exercises/tree/master/CV_A4_
'''
import cv2
impo... | 22.842105 | 100 | 0.669739 |
import cv2
import numpy as np
import math
import time
import operator
import random
img = cv2.imread('ukbench00000.jpg', cv2.IMREAD_GRAYSCALE)
for i in range(1000):
offset = '00' if i < 10 else '0' if i < 100 else ''
offset += str(i)
f = open('./sift/sift100'+offset, 'rb')
sift_des = np.f... | true | true |
f71c1c5ae6f65d71e66399bf4776b2b7437ab5a8 | 713 | py | Python | audiophiler/util.py | Mstrodl/audiophiler | 2e3a8299b58ab92a851cae726cc9184a2dad05f8 | [
"MIT"
] | 5 | 2017-05-08T05:07:22.000Z | 2021-06-01T18:48:30.000Z | audiophiler/util.py | Mstrodl/audiophiler | 2e3a8299b58ab92a851cae726cc9184a2dad05f8 | [
"MIT"
] | 34 | 2017-09-11T19:18:40.000Z | 2021-08-28T21:38:15.000Z | audiophiler/util.py | Mstrodl/audiophiler | 2e3a8299b58ab92a851cae726cc9184a2dad05f8 | [
"MIT"
] | 20 | 2017-09-09T22:02:11.000Z | 2021-08-28T17:45:59.000Z | # File: util.py
# Audiophiler utility functions
# Credit to Liam Middlebrook and Ram Zallan
# https://github.com/liam-middlebrook/gallery
from functools import wraps
from flask import session
from audiophiler.models import Tour
def audiophiler_auth(func):
@wraps(func)
def wrapped_function(*args, **kwargs):
... | 27.423077 | 68 | 0.652174 |
from functools import wraps
from flask import session
from audiophiler.models import Tour
def audiophiler_auth(func):
@wraps(func)
def wrapped_function(*args, **kwargs):
uuid = str(session["userinfo"].get("sub", ""))
uid = str(session["userinfo"].get("preferred_username", ""))
auth... | true | true |
f71c1c8decca6e84cea60dec4d962fc15cc6ae66 | 4,251 | py | Python | qutip/hardware_info.py | kiuthed/qutip | b6fb8e5bbd9ffeae117b54e56313e8617038deab | [
"BSD-3-Clause"
] | null | null | null | qutip/hardware_info.py | kiuthed/qutip | b6fb8e5bbd9ffeae117b54e56313e8617038deab | [
"BSD-3-Clause"
] | null | null | null | qutip/hardware_info.py | kiuthed/qutip | b6fb8e5bbd9ffeae117b54e56313e8617038deab | [
"BSD-3-Clause"
] | null | null | null | # This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
... | 36.646552 | 79 | 0.638908 | true | true | |
f71c1cb01d78b077e343818c4290f9abafc4925e | 1,900 | py | Python | cron_descriptor/GetText.py | nathmo/cron-descriptor | 2475065be9e203ed5cea49ec6ca365384f433cb6 | [
"MIT"
] | 3 | 2018-12-11T18:51:36.000Z | 2019-10-16T19:10:19.000Z | cron_descriptor/GetText.py | nathmo/cron-descriptor | 2475065be9e203ed5cea49ec6ca365384f433cb6 | [
"MIT"
] | 2 | 2019-04-14T04:14:31.000Z | 2019-10-15T03:23:54.000Z | cron_descriptor/cron_descriptor/GetText.py | michaelblyons/SublimeSyntax-Crontab | 54f1fa7ff0c9d18aea3790555dba6e533ce3749b | [
"MIT"
] | 2 | 2019-04-11T06:13:54.000Z | 2019-10-04T02:49:58.000Z | # The MIT License (MIT)
#
# Copyright (c) 2016 Adam Schubert
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, mod... | 36.538462 | 80 | 0.7 |
import gettext
import os
import logging
logger = logging.getLogger(__name__)
class GetText(object):
def __init__(self, locale_code):
try:
filename = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'locale', '{}.mo'.format(l... | true | true |
f71c1cd7ddd442ab1b3e8652cdd667ec554c98f4 | 23,533 | py | Python | adnmtf/nmtf_core.py | Advestis/adnmtf | 7b36da64669894506071a75d8bd341edb0e75b9f | [
"MIT"
] | null | null | null | adnmtf/nmtf_core.py | Advestis/adnmtf | 7b36da64669894506071a75d8bd341edb0e75b9f | [
"MIT"
] | null | null | null | adnmtf/nmtf_core.py | Advestis/adnmtf | 7b36da64669894506071a75d8bd341edb0e75b9f | [
"MIT"
] | null | null | null | """Non-negative matrix and tensor factorization core functions
"""
# Author: Paul Fogel
# License: MIT
# Jan 4, '20
from typing import Tuple
import numpy as np
from .nmtf_utils import EPSILON, sparse_opt
import logging
logger = logging.getLogger(__name__)
# TODO (pcotte): typing
# TODO (pcotte): docstrings (with ... | 31.169536 | 119 | 0.470658 |
from typing import Tuple
import numpy as np
from .nmtf_utils import EPSILON, sparse_opt
import logging
logger = logging.getLogger(__name__)
# TODO (pcotte): typing
# TODO (pcotte): docstrings (with parameters and returns)
def ntf_stack(m, mmis, n_blocks):
n, p = m.shape
mmis = mmis.astype(np.int)
... | true | true |
f71c1d13e2b4281f5e462dfbd3127b8ee3404a3a | 6,928 | py | Python | actions.py | prateekralhan/Chatbot-Development-using-RASA-Framework-and-Zomato-API---PGD-IIITB-Assignment | 5e33586df2bbe146d950f33e018e9e990031e347 | [
"Apache-2.0"
] | 1 | 2020-05-21T10:20:03.000Z | 2020-05-21T10:20:03.000Z | actions.py | prateekralhan/Chatbot-Development-using-RASA-Framework-and-Zomato-API---PGD-IIITB-Assignment | 5e33586df2bbe146d950f33e018e9e990031e347 | [
"Apache-2.0"
] | null | null | null | actions.py | prateekralhan/Chatbot-Development-using-RASA-Framework-and-Zomato-API---PGD-IIITB-Assignment | 5e33586df2bbe146d950f33e018e9e990031e347 | [
"Apache-2.0"
] | 1 | 2021-12-06T03:10:37.000Z | 2021-12-06T03:10:37.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
# importing the necessary libraries
# from rasa_core.actions.action import Action
from rasa_sdk import Action
#from rasa_sdk.forms import ( BooleanFormField, EntityFormField, FormAction, FreeTextFormField )
... | 32.679245 | 177 | 0.705831 | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from rasa_sdk import Action
from rasa_sdk.events import SlotSet
import zomatopy
import json
zomato_config={ "user_key":"<Enter your Zomato API key here >"}
result_of_last_query = ""
class ActionSearc... | true | true |
f71c1d88fc7cda064575b3b49230553d31ba1b56 | 9,193 | py | Python | services/ui/paths/label.py | sbworth/getnoc | a9a5647df31822062db3db7afe7ae1c005d166f7 | [
"BSD-3-Clause"
] | 84 | 2017-10-22T11:01:39.000Z | 2022-02-27T03:43:48.000Z | services/ui/paths/label.py | sbworth/getnoc | a9a5647df31822062db3db7afe7ae1c005d166f7 | [
"BSD-3-Clause"
] | 22 | 2017-12-11T07:21:56.000Z | 2021-09-23T02:53:50.000Z | services/ui/paths/label.py | sbworth/getnoc | a9a5647df31822062db3db7afe7ae1c005d166f7 | [
"BSD-3-Clause"
] | 23 | 2017-12-06T06:59:52.000Z | 2022-02-24T00:02:25.000Z | # ----------------------------------------------------------------------
# Label REST API
# ----------------------------------------------------------------------
# Copyright (C) 2007-2021 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
# Third-party m... | 44.843902 | 94 | 0.657892 |
from fastapi import APIRouter
from noc.main.models.label import Label
from ..models.label import DefaultLabelItem, FormLabelItem, LabelLabelItem
from ..utils.ref import get_reference
from ..utils.rest.document import DocumentResourceAPI
from ..utils.rest.op import FilterExact, FuncFilter, FilterBool
router =... | true | true |
f71c1e7d575a6e860d1fb2e06dd08a3844470ff2 | 51,171 | py | Python | dojo/engagement/views.py | pabloalexsandroalmeida83/django-DefectDojo | 094fbbf0d994c2f9b5c7ff071a28d4d5ed1f3a1c | [
"BSD-3-Clause"
] | null | null | null | dojo/engagement/views.py | pabloalexsandroalmeida83/django-DefectDojo | 094fbbf0d994c2f9b5c7ff071a28d4d5ed1f3a1c | [
"BSD-3-Clause"
] | null | null | null | dojo/engagement/views.py | pabloalexsandroalmeida83/django-DefectDojo | 094fbbf0d994c2f9b5c7ff071a28d4d5ed1f3a1c | [
"BSD-3-Clause"
] | null | null | null | import logging
import csv
import re
from openpyxl import Workbook
from openpyxl.styles import Font
from tempfile import NamedTemporaryFile
from datetime import datetime
import operator
from django.contrib.auth.models import User
from django.conf import settings
from django.contrib import messages
from django.core.exce... | 40.547544 | 182 | 0.643431 | import logging
import csv
import re
from openpyxl import Workbook
from openpyxl.styles import Font
from tempfile import NamedTemporaryFile
from datetime import datetime
import operator
from django.contrib.auth.models import User
from django.conf import settings
from django.contrib import messages
from django.core.exce... | true | true |
f71c1eaf10e717ab23c28074e182c01dfdc1b475 | 5,366 | py | Python | distributed/distributed/db.py | Yuanmessi/Bold-Falcon | 00fcaba0b3d9c462b9d20ecb256ff85db5d119e2 | [
"BSD-3-Clause"
] | 71 | 2016-11-13T03:26:45.000Z | 2022-02-22T08:13:04.000Z | distributed/distributed/db.py | Yuanmessi/Bold-Falcon | 00fcaba0b3d9c462b9d20ecb256ff85db5d119e2 | [
"BSD-3-Clause"
] | 3 | 2021-07-01T08:09:05.000Z | 2022-01-28T03:38:36.000Z | distributed/distributed/db.py | Yuanmessi/Bold-Falcon | 00fcaba0b3d9c462b9d20ecb256ff85db5d119e2 | [
"BSD-3-Clause"
] | 36 | 2016-12-13T11:37:56.000Z | 2021-11-11T12:20:10.000Z | # Copyright (C) 2014-2016 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import json
from datetime import datetime
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.inspection import inspect
db = SQLAlchemy(sessi... | 34.619355 | 77 | 0.660268 |
import json
from datetime import datetime
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.inspection import inspect
db = SQLAlchemy(session_options=dict(autoflush=True))
ALEMBIC_VERSION = "4b86bc0d40aa"
class Serializer(object):
def to_dict(self):
ret = {}
for key in inspect(self)... | true | true |
f71c1f3f5d963f1a9f0cad8f49f08a8a8952fb0f | 7,941 | py | Python | CTFd/config.py | mayoneko/CTFd | 825190ba3aef10f9cdc736f4d6f8ea2a5c8590ac | [
"Apache-2.0"
] | 2 | 2019-06-19T07:11:28.000Z | 2019-06-21T05:30:07.000Z | CTFd/config.py | mayoneko/CTFd | 825190ba3aef10f9cdc736f4d6f8ea2a5c8590ac | [
"Apache-2.0"
] | null | null | null | CTFd/config.py | mayoneko/CTFd | 825190ba3aef10f9cdc736f4d6f8ea2a5c8590ac | [
"Apache-2.0"
] | null | null | null | import os
''' GENERATE SECRET KEY '''
if not os.getenv('SECRET_KEY'):
# Attempt to read the secret from the secret file
# This will fail if the secret has not been written
try:
with open('.ctfd_secret_key', 'rb') as secret:
key = secret.read()
except (OSError, IOError):
key... | 37.107477 | 122 | 0.679008 | import os
if not os.getenv('SECRET_KEY'):
try:
with open('.ctfd_secret_key', 'rb') as secret:
key = secret.read()
except (OSError, IOError):
key = None
if not key:
key = os.urandom(64)
try:
with open('.ctfd_secret_key', '... | true | true |
f71c1f9b0854ca663169a6e52dc7055a0f7125c4 | 1,718 | py | Python | player_service.py | yetanotherape/poker-player-vostok | c308a1b015900243817dc9be2707c72848d61f25 | [
"MIT"
] | null | null | null | player_service.py | yetanotherape/poker-player-vostok | c308a1b015900243817dc9be2707c72848d61f25 | [
"MIT"
] | null | null | null | player_service.py | yetanotherape/poker-player-vostok | c308a1b015900243817dc9be2707c72848d61f25 | [
"MIT"
] | null | null | null | import time
import cgi
import json
import BaseHTTPServer
import os
from player import Player
HOST_NAME = '0.0.0.0'
PORT_NUMBER = os.environ.has_key('PORT') and int(os.environ['PORT']) or 9000
class PlayerService(BaseHTTPServer.BaseHTTPRequestHandler):
def do_POST(self):
self.send_response(200)
... | 29.62069 | 81 | 0.632712 | import time
import cgi
import json
import BaseHTTPServer
import os
from player import Player
HOST_NAME = '0.0.0.0'
PORT_NUMBER = os.environ.has_key('PORT') and int(os.environ['PORT']) or 9000
class PlayerService(BaseHTTPServer.BaseHTTPRequestHandler):
def do_POST(self):
self.send_response(200)
... | false | true |
f71c20b62ca77df8f80354e21bf08002ca39890b | 984 | py | Python | src/jsm/api/mixins/infos.py | charbonnierg/jetstream.py | 4d8dc56fc6953d0a28d207b9b162c6f8d0080d37 | [
"Apache-2.0"
] | 8 | 2021-07-26T10:54:10.000Z | 2021-12-06T08:41:02.000Z | src/jsm/api/mixins/infos.py | charbonnierg/jetstream.py | 4d8dc56fc6953d0a28d207b9b162c6f8d0080d37 | [
"Apache-2.0"
] | 3 | 2021-08-09T10:25:39.000Z | 2021-12-06T08:40:41.000Z | src/jsm/api/mixins/infos.py | charbonnierg/jetstream.py | 4d8dc56fc6953d0a28d207b9b162c6f8d0080d37 | [
"Apache-2.0"
] | 3 | 2021-08-22T01:55:11.000Z | 2021-09-13T13:51:42.000Z | # Copyright 2021 - Guillaume Charbonnier
# Licensed under the Apache License, Version 2.0 (the "License");
# http://www.apache.org/licenses/LICENSE-2.0
from __future__ import annotations
from typing import Optional, Union
from jsm.models.account_info import IoNatsJetstreamApiV1AccountInfoResponse
from jsm.models.erro... | 32.8 | 76 | 0.729675 |
from __future__ import annotations
from typing import Optional, Union
from jsm.models.account_info import IoNatsJetstreamApiV1AccountInfoResponse
from jsm.models.errors import IoNatsJetstreamApiV1ErrorResponse
from .request_reply import BaseJetStreamRequestReplyMixin, JetStreamResponse
class AccountInfosMixin(B... | true | true |
f71c21777d66133ec1da30715a6556ddee5fd447 | 467 | py | Python | integration/keeper_secrets_manager_cli/keeper_secrets_manager_cli/exception.py | Keeper-Security/secrets-manager | 0044dec7f323ae2e531f52ef2435bd7205949fe9 | [
"MIT"
] | 9 | 2022-01-10T18:39:45.000Z | 2022-03-06T03:51:41.000Z | integration/keeper_secrets_manager_cli/keeper_secrets_manager_cli/exception.py | Keeper-Security/secrets-manager | 0044dec7f323ae2e531f52ef2435bd7205949fe9 | [
"MIT"
] | 10 | 2022-01-27T00:51:05.000Z | 2022-03-30T08:42:01.000Z | integration/keeper_secrets_manager_cli/keeper_secrets_manager_cli/exception.py | Keeper-Security/secrets-manager | 0044dec7f323ae2e531f52ef2435bd7205949fe9 | [
"MIT"
] | 6 | 2021-12-17T18:59:26.000Z | 2022-03-28T16:47:28.000Z | import click
from colorama import Fore, Style
class KsmCliException(click.ClickException):
in_a_shell = False
def colorize(self):
if KsmCliException.in_a_shell is False:
return str(self.message)
else:
return Fore.RED + str(self.message) + Style.RESET_ALL
def form... | 19.458333 | 65 | 0.663812 | import click
from colorama import Fore, Style
class KsmCliException(click.ClickException):
in_a_shell = False
def colorize(self):
if KsmCliException.in_a_shell is False:
return str(self.message)
else:
return Fore.RED + str(self.message) + Style.RESET_ALL
def form... | true | true |
f71c235a81782aee7af143ed9a0e3681bf47b496 | 5,934 | py | Python | simple_distillation_mgr/VLE_data_ethanol_water.py | ykholod/kettlebell-simple-distillation-mgr | 172900253be790f9fe7712ba5f20bcbb12a2a635 | [
"MIT"
] | null | null | null | simple_distillation_mgr/VLE_data_ethanol_water.py | ykholod/kettlebell-simple-distillation-mgr | 172900253be790f9fe7712ba5f20bcbb12a2a635 | [
"MIT"
] | null | null | null | simple_distillation_mgr/VLE_data_ethanol_water.py | ykholod/kettlebell-simple-distillation-mgr | 172900253be790f9fe7712ba5f20bcbb12a2a635 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
""" VLE data for ethanol-water mixture, isobaric, 1.01 bar """
__author__ = "Yaroslav Kholod"
__copyright__ = "Copyright 2019, The Kettlebell project"
__credits__ = "Yaroslav Kholod"
__license__ = "MIT"
__version__ = "0.1.0"
__maintainer__ = "Yaroslav Kholod"
__email__ = "pret... | 26.373333 | 62 | 0.731378 |
__author__ = "Yaroslav Kholod"
__copyright__ = "Copyright 2019, The Kettlebell project"
__credits__ = "Yaroslav Kholod"
__license__ = "MIT"
__version__ = "0.1.0"
__maintainer__ = "Yaroslav Kholod"
__email__ = "pretorian.yaroslav@gmail.com"
__status__ = "Development"
vle_data_dew = {}
0] = 78.21
vle_data... | true | true |
f71c249886014075a96d3e57f520b3963e70bc00 | 675 | py | Python | pytest/testSigning.py | RomanValov/ArmoryDB | 625eff9712161676ad83deb03616e6edb48283ca | [
"MIT"
] | 505 | 2016-02-04T15:54:46.000Z | 2022-03-27T18:43:01.000Z | pytest/testSigning.py | jimmysong/BitcoinArmory | 1c7190176897a2e0f3e4e198ab2f199059bb2402 | [
"MIT"
] | 528 | 2016-02-06T19:50:12.000Z | 2022-01-15T10:21:16.000Z | pytest/testSigning.py | jimmysong/BitcoinArmory | 1c7190176897a2e0f3e4e198ab2f199059bb2402 | [
"MIT"
] | 208 | 2015-01-02T10:31:40.000Z | 2021-12-14T07:37:36.000Z | import sys
sys.path.append('..')
import unittest
import random
from armoryengine.ALL import *
class SigningTester(unittest.TestCase):
def testLowSig(self):
sbdPrivKey = SecureBinaryData(b'\x01'*32)
pub = CryptoECDSA().ComputePublicKey(sbdPrivKey).toBinStr()
for i in range(100):
msg = ... | 28.125 | 82 | 0.657778 | import sys
sys.path.append('..')
import unittest
import random
from armoryengine.ALL import *
class SigningTester(unittest.TestCase):
def testLowSig(self):
sbdPrivKey = SecureBinaryData(b'\x01'*32)
pub = CryptoECDSA().ComputePublicKey(sbdPrivKey).toBinStr()
for i in range(100):
msg = ... | true | true |
f71c26869793672d4719326ffb01b5d7f0f78eb2 | 12,414 | py | Python | texar/torch/modules/decoders/rnn_decoders_test.py | wwt17/texar-pytorch | 9fb3ae8f7b541da5c808357033a93fba1817bfbd | [
"Apache-2.0"
] | 19 | 2020-07-29T15:25:45.000Z | 2022-01-19T17:49:42.000Z | texar/torch/modules/decoders/rnn_decoders_test.py | wwt17/texar-pytorch | 9fb3ae8f7b541da5c808357033a93fba1817bfbd | [
"Apache-2.0"
] | 3 | 2021-02-16T10:26:23.000Z | 2021-06-08T16:50:40.000Z | texar/torch/modules/decoders/rnn_decoders_test.py | wwt17/texar-pytorch | 9fb3ae8f7b541da5c808357033a93fba1817bfbd | [
"Apache-2.0"
] | 1 | 2019-10-06T07:54:30.000Z | 2019-10-06T07:54:30.000Z | """
Unit tests for RNN decoders.
"""
import unittest
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from texar.torch.hyperparams import HParams
from texar.torch.modules.decoders.decoder_helpers import get_helper
from texar.torch.modules.decoders.rnn_decoders import (
Attent... | 39.160883 | 86 | 0.617931 |
import unittest
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from texar.torch.hyperparams import HParams
from texar.torch.modules.decoders.decoder_helpers import get_helper
from texar.torch.modules.decoders.rnn_decoders import (
AttentionRNNDecoder, AttentionRNNDecoderOut... | true | true |
f71c2776956637e7ed8b7da0a4acf3481ed4e4c7 | 3,001 | py | Python | huaweicloud-sdk-vss/huaweicloudsdkvss/v3/model/delete_domains_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-vss/huaweicloudsdkvss/v3/model/delete_domains_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-vss/huaweicloudsdkvss/v3/model/delete_domains_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class DeleteDomainsRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The k... | 26.324561 | 79 | 0.553149 |
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class DeleteDomainsRequest:
sensitive_list = []
openapi_types = {
'domain_name': 'str'
}
attribute_map = {
'domain_name': 'domain_name'
}
def __init__(self, domain_name=No... | true | true |
f71c29769d72428dea8c648a9ffeb523dd34dd62 | 6,207 | py | Python | examples/mountaincar.py | knollsen/agent57 | 7d3d7890f8eb3a1420945e0b7bcb85ad87459167 | [
"MIT"
] | 1 | 2021-02-24T08:22:35.000Z | 2021-02-24T08:22:35.000Z | examples/mountaincar.py | knollsen/agent57 | 7d3d7890f8eb3a1420945e0b7bcb85ad87459167 | [
"MIT"
] | null | null | null | examples/mountaincar.py | knollsen/agent57 | 7d3d7890f8eb3a1420945e0b7bcb85ad87459167 | [
"MIT"
] | null | null | null | import gym
from keras.optimizers import Adam
import traceback
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../'))
from agent.agent57 import ActorUser
from agent.policy import EpsilonGreedy, AnnealingEpsilonGreedy
from agent.memory import PERRankBaseMemory, PERProportionalMemory
from ... | 27.343612 | 80 | 0.595779 | import gym
from keras.optimizers import Adam
import traceback
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../'))
from agent.agent57 import ActorUser
from agent.policy import EpsilonGreedy, AnnealingEpsilonGreedy
from agent.memory import PERRankBaseMemory, PERProportionalMemory
from ... | true | true |
f71c2a25b344a3cfa098ae966121ffc6edd9ccd3 | 4,074 | py | Python | train.py | artemkurylev/Context-Aware_Crowd_Counting-pytorch | d68ddd87b99f2afc512357cb8fcb0ca41ea22865 | [
"MIT"
] | 71 | 2019-05-21T02:10:46.000Z | 2022-03-17T05:19:35.000Z | train.py | GuoleiSun/Context-Aware_Crowd_Counting-pytorch | d68ddd87b99f2afc512357cb8fcb0ca41ea22865 | [
"MIT"
] | 28 | 2019-05-14T01:32:21.000Z | 2021-07-06T08:39:10.000Z | train.py | GuoleiSun/Context-Aware_Crowd_Counting-pytorch | d68ddd87b99f2afc512357cb8fcb0ca41ea22865 | [
"MIT"
] | 22 | 2019-05-22T09:38:51.000Z | 2022-03-22T23:31:25.000Z | import numpy as np
import time
import torch
import torch.nn as nn
import os
import visdom
import random
from tqdm import tqdm as tqdm
from cannet import CANNet
from my_dataset import CrowdDataset
if __name__=="__main__":
# configuration
train_image_root='./data/Shanghai_part_A/train_data/images'
train_dma... | 32.854839 | 124 | 0.60972 | import numpy as np
import time
import torch
import torch.nn as nn
import os
import visdom
import random
from tqdm import tqdm as tqdm
from cannet import CANNet
from my_dataset import CrowdDataset
if __name__=="__main__":
train_image_root='./data/Shanghai_part_A/train_data/images'
train_dmap_root='./data/... | true | true |
f71c2aa0bf024d0c142df184c4a0782128c38601 | 579 | py | Python | tests/test_ext_indicator_cycles.py | ryanrussell/pandas-ta | 720bbcf0196d363d621beeced8fba711990d075d | [
"MIT"
] | 2,298 | 2019-02-20T18:38:18.000Z | 2022-03-31T07:45:50.000Z | tests/test_ext_indicator_cycles.py | ryanrussell/pandas-ta | 720bbcf0196d363d621beeced8fba711990d075d | [
"MIT"
] | 451 | 2019-02-26T00:50:02.000Z | 2022-03-31T03:17:39.000Z | tests/test_ext_indicator_cycles.py | ryanrussell/pandas-ta | 720bbcf0196d363d621beeced8fba711990d075d | [
"MIT"
] | 579 | 2019-03-19T01:53:03.000Z | 2022-03-31T11:13:50.000Z | from pandas.core.series import Series
from .config import sample_data
from .context import pandas_ta
from unittest import TestCase
from pandas import DataFrame
class TestCylesExtension(TestCase):
@classmethod
def setUpClass(cls):
cls.data = sample_data
@classmethod
def tearDownClass(cls):
... | 22.269231 | 61 | 0.70639 | from pandas.core.series import Series
from .config import sample_data
from .context import pandas_ta
from unittest import TestCase
from pandas import DataFrame
class TestCylesExtension(TestCase):
@classmethod
def setUpClass(cls):
cls.data = sample_data
@classmethod
def tearDownClass(cls):
... | true | true |
f71c2bcacd1a2766209c84a64e9d8e489810169f | 274 | py | Python | buildscripts/condarecipe.hsa/run_test.py | ehsantn/numba | 4749ef7ccc630b7f649ec972497bc5b7fca79303 | [
"BSD-2-Clause",
"MIT"
] | 4 | 2017-06-30T14:22:30.000Z | 2021-01-11T16:47:23.000Z | buildscripts/condarecipe.hsa/run_test.py | ehsantn/numba | 4749ef7ccc630b7f649ec972497bc5b7fca79303 | [
"BSD-2-Clause",
"MIT"
] | 1 | 2018-04-03T22:37:40.000Z | 2018-04-03T23:53:43.000Z | buildscripts/condarecipe.hsa/run_test.py | ehsantn/numba | 4749ef7ccc630b7f649ec972497bc5b7fca79303 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | import sys
import numba
args = []
if sys.platform.startswith('win32'):
args += ['-b']
else:
args += ['-m', '-b']
args += ['numba.tests']
if not numba.runtests.main(*args):
print("Test failed")
sys.exit(1)
print('numba.__version__: %s' % numba.__version__)
| 18.266667 | 50 | 0.613139 | import sys
import numba
args = []
if sys.platform.startswith('win32'):
args += ['-b']
else:
args += ['-m', '-b']
args += ['numba.tests']
if not numba.runtests.main(*args):
print("Test failed")
sys.exit(1)
print('numba.__version__: %s' % numba.__version__)
| true | true |
f71c2c1d589bfaed486a8c50f486a53a358a0d09 | 59,359 | py | Python | python/ccxt/async_support/timex.py | sandutsar/ccxt | f27c187fa1626a6c261c6fa5caaae89cb657461d | [
"MIT"
] | null | null | null | python/ccxt/async_support/timex.py | sandutsar/ccxt | f27c187fa1626a6c261c6fa5caaae89cb657461d | [
"MIT"
] | null | null | null | python/ccxt/async_support/timex.py | sandutsar/ccxt | f27c187fa1626a6c261c6fa5caaae89cb657461d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import Authenticatio... | 43.904586 | 2,235 | 0.497953 |
rt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import BadRequest
from ccxt.base.errors import InsufficientFunds
from ccxt.base.errors import InvalidOrder
from ccxt.base.er... | true | true |
f71c2d2de4124b6e764541c80fea3098c5dcf2c2 | 231,565 | py | Python | zerver/tests/test_messages.py | myii/zulip | 915d8013271f1823954dd8d4441842842857ab9f | [
"Apache-2.0"
] | null | null | null | zerver/tests/test_messages.py | myii/zulip | 915d8013271f1823954dd8d4441842842857ab9f | [
"Apache-2.0"
] | null | null | null | zerver/tests/test_messages.py | myii/zulip | 915d8013271f1823954dd8d4441842842857ab9f | [
"Apache-2.0"
] | null | null | null | from django.db import IntegrityError
from django.db.models import Q
from django.conf import settings
from django.http import HttpResponse
from django.test import TestCase, override_settings
from django.utils.timezone import now as timezone_now
from zerver.lib import bugdown
from zerver.decorator import JsonableError
f... | 44.023764 | 145 | 0.613132 | from django.db import IntegrityError
from django.db.models import Q
from django.conf import settings
from django.http import HttpResponse
from django.test import TestCase, override_settings
from django.utils.timezone import now as timezone_now
from zerver.lib import bugdown
from zerver.decorator import JsonableError
f... | true | true |
f71c2d89d64d953f36a10a9d27d38da71f45ea05 | 436 | py | Python | Python/python-practice/chapter7-while/sandwich_orders.py | jiaoqiyuan/Tests | a3595b0e4b430d910f90e428d6b6b4465f67a059 | [
"Apache-2.0"
] | null | null | null | Python/python-practice/chapter7-while/sandwich_orders.py | jiaoqiyuan/Tests | a3595b0e4b430d910f90e428d6b6b4465f67a059 | [
"Apache-2.0"
] | null | null | null | Python/python-practice/chapter7-while/sandwich_orders.py | jiaoqiyuan/Tests | a3595b0e4b430d910f90e428d6b6b4465f67a059 | [
"Apache-2.0"
] | null | null | null | sandwich_orders = ['aaa', 'pastrami', 'bbb', 'pastrami', 'ccc','pastrami']
finished_sandwiches = []
print("\nAll pastrami had been sold!")
while 'pastrami' in sandwich_orders:
sandwich_orders.remove('pastrami')
while sandwich_orders:
sandwich_order = sandwich_orders.pop()
print("\nI made your tuna sanwichi... | 33.538462 | 74 | 0.729358 | sandwich_orders = ['aaa', 'pastrami', 'bbb', 'pastrami', 'ccc','pastrami']
finished_sandwiches = []
print("\nAll pastrami had been sold!")
while 'pastrami' in sandwich_orders:
sandwich_orders.remove('pastrami')
while sandwich_orders:
sandwich_order = sandwich_orders.pop()
print("\nI made your tuna sanwichi... | true | true |
f71c2e710a36a4f82f3feb6e43398072d821ab5d | 219 | py | Python | olc_webportalv2/cowbat/admin.py | OLC-Bioinformatics/olc_genomics_portal | d70ec669a3a49106f8290fff5dee089726259a23 | [
"MIT"
] | 3 | 2019-01-03T21:22:21.000Z | 2019-04-23T15:47:29.000Z | olc_webportalv2/cowbat/admin.py | lowandrew/olc_webportalv2 | e75ba1b7af85bb25b59138d31e268ecde6616208 | [
"MIT"
] | 49 | 2019-01-03T18:15:12.000Z | 2022-03-11T23:37:20.000Z | olc_webportalv2/cowbat/admin.py | OLC-Bioinformatics/olc_webportalv2 | d70ec669a3a49106f8290fff5dee089726259a23 | [
"MIT"
] | 58 | 2019-01-03T21:21:59.000Z | 2021-11-02T18:00:20.000Z | from django.contrib import admin
from .models import DataFile, SequencingRun, InterOpFile
# Register your models here.
admin.site.register(DataFile)
admin.site.register(SequencingRun)
admin.site.register(InterOpFile)
| 24.333333 | 56 | 0.826484 | from django.contrib import admin
from .models import DataFile, SequencingRun, InterOpFile
admin.site.register(DataFile)
admin.site.register(SequencingRun)
admin.site.register(InterOpFile)
| true | true |
f71c3158cd7fa547b538702286ea7c2954416084 | 2,113 | py | Python | nipype/interfaces/afni/tests/test_auto_ROIStats.py | PAmcconnell/nipype | 39fbd5411a844ce7c023964d3295eb7643b95af5 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/afni/tests/test_auto_ROIStats.py | PAmcconnell/nipype | 39fbd5411a844ce7c023964d3295eb7643b95af5 | [
"Apache-2.0"
] | 2 | 2018-04-26T12:09:32.000Z | 2018-04-27T06:36:49.000Z | nipype/interfaces/afni/tests/test_auto_ROIStats.py | PAmcconnell/nipype | 39fbd5411a844ce7c023964d3295eb7643b95af5 | [
"Apache-2.0"
] | 1 | 2019-11-14T14:16:57.000Z | 2019-11-14T14:16:57.000Z | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..preprocess import ROIStats
def test_ROIStats_inputs():
input_map = dict(
args=dict(argstr='%s', ),
debug=dict(argstr='-debug', ),
environ=dict(
nohash=True,
usedefault=True,
),
format1D=dic... | 28.945205 | 67 | 0.510648 |
from ..preprocess import ROIStats
def test_ROIStats_inputs():
input_map = dict(
args=dict(argstr='%s', ),
debug=dict(argstr='-debug', ),
environ=dict(
nohash=True,
usedefault=True,
),
format1D=dict(
argstr='-1Dformat',
xor=['... | true | true |
f71c315a2c062c492837c96d407768a4e6981339 | 2,392 | py | Python | libs/cherrypy/tutorial/tut06_default_method.py | scambra/HTPC-Manager | 1a1440db84ae1b6e7a2610c7f3bd5b6adf0aab1d | [
"MIT"
] | 674 | 2015-11-06T04:22:47.000Z | 2022-02-26T17:31:43.000Z | libs/cherrypy/tutorial/tut06_default_method.py | scambra/HTPC-Manager | 1a1440db84ae1b6e7a2610c7f3bd5b6adf0aab1d | [
"MIT"
] | 713 | 2015-11-06T10:48:58.000Z | 2018-11-27T16:32:18.000Z | libs/cherrypy/tutorial/tut06_default_method.py | scambra/HTPC-Manager | 1a1440db84ae1b6e7a2610c7f3bd5b6adf0aab1d | [
"MIT"
] | 115 | 2015-01-08T14:41:00.000Z | 2022-02-13T12:31:17.000Z | """
Tutorial - The default method
Request handler objects can implement a method called "default" that
is called when no other suitable method/object could be found.
Essentially, if CherryPy2 can't find a matching request handler object
for the given request URI, it will use the default method of the object
located de... | 37.375 | 74 | 0.669732 |
import cherrypy
class UsersPage:
def index(self):
# display a list of links to random, made-up users. In a real
# application, this could be generated from a database result set.
return '''
<a href="./remi">Remi Delon</a><br/>
<a href="./hendrik">Hendrik ... | true | true |
f71c31685adf10f4b09b39fca342aeaf980132fc | 9,541 | py | Python | image-classifier/image-classifier.py | subhadip7879/neural-net | 04aacf7cdec89ea0f58f2c7397c72adefa8c2d4e | [
"MIT"
] | null | null | null | image-classifier/image-classifier.py | subhadip7879/neural-net | 04aacf7cdec89ea0f58f2c7397c72adefa8c2d4e | [
"MIT"
] | 3 | 2017-10-29T17:39:20.000Z | 2017-10-29T18:35:08.000Z | image-classifier/image-classifier.py | subhadip7879/neural-net | 04aacf7cdec89ea0f58f2c7397c72adefa8c2d4e | [
"MIT"
] | 6 | 2017-10-29T17:32:46.000Z | 2018-10-05T09:49:31.000Z | from IPython.display import Image
Image('images/02_network_flowchart.png')
Image('images/02_convolution.png')
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
from sklearn.metrics import confusion_matrix
import time
from datetime import timedelta
import math
from tensorflow.examples.tutoria... | 30.097792 | 87 | 0.659889 | from IPython.display import Image
Image('images/02_network_flowchart.png')
Image('images/02_convolution.png')
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
from sklearn.metrics import confusion_matrix
import time
from datetime import timedelta
import math
from tensorflow.examples.tutoria... | true | true |
f71c319545eacca0285b17d4ce54f5d246ae71d3 | 17,588 | py | Python | twilio/rest/trunking/v1/trunk/phone_number.py | neetaramaswamy/twilio-python | 28472ffab1a170824ba17f12a6c1692a5e849439 | [
"MIT"
] | 30 | 2018-06-12T12:00:53.000Z | 2021-05-02T01:27:16.000Z | venv/lib/python3.6/site-packages/twilio/rest/trunking/v1/trunk/phone_number.py | ostar0816/mc-crypto | 80ad9896aed1dc952f819a404a458ccfad207d8e | [
"MIT"
] | 10 | 2020-06-06T01:10:07.000Z | 2022-03-12T00:12:22.000Z | venv/lib/python3.6/site-packages/twilio/rest/trunking/v1/trunk/phone_number.py | ostar0816/mc-crypto | 80ad9896aed1dc952f819a404a458ccfad207d8e | [
"MIT"
] | 4 | 2018-06-12T14:14:20.000Z | 2018-06-19T16:01:49.000Z | # coding=utf-8
"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.... | 30.641115 | 99 | 0.609108 |
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page
class PhoneNumberList(ListResource):
def __... | true | true |
f71c31b5f216202481da86a95da2f3bc59155e05 | 20,865 | py | Python | autotest/osr/osr_ct.py | bnordgren/gdal | 8b9bff36d6e2c4eceb56e8f596286be7f3fc9f24 | [
"MIT"
] | 1 | 2018-11-29T10:15:53.000Z | 2018-11-29T10:15:53.000Z | autotest/osr/osr_ct.py | a0x8o/gdal | 54aa47ee60eea48fa4989d6ce41fdae4e02c6458 | [
"MIT"
] | 1 | 2017-12-30T02:12:01.000Z | 2017-12-30T02:12:01.000Z | autotest/osr/osr_ct.py | notcaremath/gdal | 2c1586ffda1e49d170b96f8f0d87bc7516554047 | [
"MIT"
] | null | null | null | #!/usr/bin/env pytest
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test coordinate transformations.
# Author: Frank Warmerdam <warmerdam@pobox.com>
#
########################################################... | 36.161179 | 458 | 0.620129 | true | true | |
f71c32e40c090845453a2573a352eecf99ded05c | 2,896 | py | Python | openml/__init__.py | Rong-Inspur/openml-python | 07d429c843cf589d8096db76d520317acf7a99ab | [
"BSD-3-Clause"
] | null | null | null | openml/__init__.py | Rong-Inspur/openml-python | 07d429c843cf589d8096db76d520317acf7a99ab | [
"BSD-3-Clause"
] | null | null | null | openml/__init__.py | Rong-Inspur/openml-python | 07d429c843cf589d8096db76d520317acf7a99ab | [
"BSD-3-Clause"
] | null | null | null | """
The OpenML module implements a python interface to
`OpenML <https://www.openml.org>`_, a collaborative platform for machine
learning. OpenML can be used to
* store, download and analyze datasets
* make experiments and their results (e.g. models, predictions)
accesible and reproducible for everybody
* analyze exp... | 23.737705 | 76 | 0.699931 |
from . import _api_calls
from . import config
from .datasets import OpenMLDataset, OpenMLDataFeature
from . import datasets
from . import evaluations
from .evaluations import OpenMLEvaluation
from . import extensions
from . import exceptions
from . import tasks
from .tasks import (
OpenMLTask,
OpenMLSplit,
... | true | true |
f71c33cccf1872a2d06d40b32de68921437e9c87 | 540 | py | Python | src/bos_consensus/middlewares/blockchain/base.py | LuffyEMonkey/isaac-consensus-protocol | 806d967d56ef8862a477b2515c7854af289c10a0 | [
"Apache-2.0"
] | 1 | 2018-04-10T11:00:59.000Z | 2018-04-10T11:00:59.000Z | src/bos_consensus/middlewares/blockchain/base.py | LuffyEMonkey/isaac-consensus-protocol | 806d967d56ef8862a477b2515c7854af289c10a0 | [
"Apache-2.0"
] | null | null | null | src/bos_consensus/middlewares/blockchain/base.py | LuffyEMonkey/isaac-consensus-protocol | 806d967d56ef8862a477b2515c7854af289c10a0 | [
"Apache-2.0"
] | null | null | null | from bos_consensus.util import LoggingMixin
class NoFurtherBlockchainMiddlewares(Exception):
pass
class StopReceiveBallot(Exception):
pass
class BaseBlockchainMiddleware(LoggingMixin):
blockchain = None
def __init__(self, blockchain):
self.blockchain = blockchain
super(BaseBlockc... | 20.769231 | 80 | 0.724074 | from bos_consensus.util import LoggingMixin
class NoFurtherBlockchainMiddlewares(Exception):
pass
class StopReceiveBallot(Exception):
pass
class BaseBlockchainMiddleware(LoggingMixin):
blockchain = None
def __init__(self, blockchain):
self.blockchain = blockchain
super(BaseBlockc... | true | true |
f71c347fa097a89874460ad438e91b290e146610 | 6,795 | py | Python | Materials/views.py | Gguidini/artheart-db-explorer | 8e854248ff799f74f2702f767e5614e154e4a7f8 | [
"MIT"
] | null | null | null | Materials/views.py | Gguidini/artheart-db-explorer | 8e854248ff799f74f2702f767e5614e154e4a7f8 | [
"MIT"
] | null | null | null | Materials/views.py | Gguidini/artheart-db-explorer | 8e854248ff799f74f2702f767e5614e154e4a7f8 | [
"MIT"
] | null | null | null | """
This file defines functions to manipulate user interaction with the web-interface.
Responsible for views related to the models defined in Materials/models.py.
"""
import os
from django.core.paginator import Paginator
from django.http import HttpResponseForbidden
from django.shortcuts import HttpResponse, redirec... | 31.027397 | 98 | 0.607653 |
import os
from django.core.paginator import Paginator
from django.http import HttpResponseForbidden
from django.shortcuts import HttpResponse, redirect, render
from django.urls import reverse_lazy
from ArtHeart.settings import MEDIA_ROOT, MEDIA_URL
from .forms import ApostilaUpload, CategoryUpload, ProjectUpload
fr... | true | true |
f71c352600ea4dd69dce91611e638d4ac22561c3 | 285 | py | Python | utils/__init__.py | 1219521375/bottom-up-attention.pytorch | 4a2e64383f024cc56728dd2a0ee63c8a171663c8 | [
"Apache-2.0"
] | 3 | 2022-02-18T13:38:47.000Z | 2022-03-30T11:30:35.000Z | utils/__init__.py | 1219521375/bottom-up-attention.pytorch | 4a2e64383f024cc56728dd2a0ee63c8a171663c8 | [
"Apache-2.0"
] | null | null | null | utils/__init__.py | 1219521375/bottom-up-attention.pytorch | 4a2e64383f024cc56728dd2a0ee63c8a171663c8 | [
"Apache-2.0"
] | null | null | null | from .utils import save_features
from .extract_features_faster import extract_feat_faster_start
from .extract_features_multigpu import extract_feat_multigpu_start
from .extract_features_singlegpu import extract_feat_singlegpu_start
from .extract_d2features import extract_feat_d2_start | 57 | 68 | 0.915789 | from .utils import save_features
from .extract_features_faster import extract_feat_faster_start
from .extract_features_multigpu import extract_feat_multigpu_start
from .extract_features_singlegpu import extract_feat_singlegpu_start
from .extract_d2features import extract_feat_d2_start | true | true |
f71c359d2395a2f0e5c51625afa87da5d3779d1a | 296,654 | py | Python | tests/test_core.py | Matheus28/emscripten | c1d3ca07227607043a92d55dee65a733851d6813 | [
"MIT"
] | null | null | null | tests/test_core.py | Matheus28/emscripten | c1d3ca07227607043a92d55dee65a733851d6813 | [
"MIT"
] | null | null | null | tests/test_core.py | Matheus28/emscripten | c1d3ca07227607043a92d55dee65a733851d6813 | [
"MIT"
] | null | null | null | # Copyright 2013 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
import glob
import hashlib
import json
import logging
import os
impor... | 33.856882 | 545 | 0.637918 |
import glob
import hashlib
import json
import logging
import os
import random
import re
import shutil
import sys
import time
import unittest
from pathlib import Path
from functools import wraps
if __name__ == '__main__':
raise Exception('do not run this file directly; do something like: tests/runner')
from too... | true | true |
f71c3617afc853a7653c8b2fa5b96fb74a081eed | 464 | py | Python | python/string-manipulation/alternating_characters.py | anishLearnsToCode/hackerrabk-interview-preparation-kit | 9d31eefe336e6dbef104ae78f06dd46686c28f84 | [
"MIT"
] | 2 | 2020-06-04T09:48:30.000Z | 2021-11-28T15:43:00.000Z | python/string-manipulation/alternating_characters.py | anishLearnsToCode/hackerrabk-interview-preparation-kit | 9d31eefe336e6dbef104ae78f06dd46686c28f84 | [
"MIT"
] | null | null | null | python/string-manipulation/alternating_characters.py | anishLearnsToCode/hackerrabk-interview-preparation-kit | 9d31eefe336e6dbef104ae78f06dd46686c28f84 | [
"MIT"
] | 1 | 2020-11-01T01:03:08.000Z | 2020-11-01T01:03:08.000Z | def minimum_deletions(string: str) -> int:
current_character = string[0]
count = 0
deletions = 0
for character in string:
if character == current_character:
count += 1
else:
current_character = character
deletions += count - 1
count = 1
... | 24.421053 | 42 | 0.594828 | def minimum_deletions(string: str) -> int:
current_character = string[0]
count = 0
deletions = 0
for character in string:
if character == current_character:
count += 1
else:
current_character = character
deletions += count - 1
count = 1
... | true | true |
f71c36d4dffacd0a0f9415f50fd7e32ca1fa2928 | 6,067 | py | Python | oops_fhir/r4/code_system/v3_substance_admin_substitution.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/code_system/v3_substance_admin_substitution.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/code_system/v3_substance_admin_substitution.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | from pathlib import Path
from fhir.resources.codesystem import CodeSystem
from oops_fhir.utils import CodeSystemConcept
__all__ = ["v3substanceAdminSubstitution"]
_resource = CodeSystem.parse_file(Path(__file__).with_suffix(".json"))
class v3substanceAdminSubstitution:
"""
v3 Code System substanceAdminSu... | 63.197917 | 890 | 0.447338 | from pathlib import Path
from fhir.resources.codesystem import CodeSystem
from oops_fhir.utils import CodeSystemConcept
__all__ = ["v3substanceAdminSubstitution"]
_resource = CodeSystem.parse_file(Path(__file__).with_suffix(".json"))
class v3substanceAdminSubstitution:
underscore_act_substance_admin_substit... | true | true |
f71c37bb391e2b9895264076e05236334fa0075c | 570 | py | Python | tests/test_poetcli.py | jkerola/poetcli | e307513fa073beaddd7247d944fcef7092ee95dd | [
"MIT"
] | null | null | null | tests/test_poetcli.py | jkerola/poetcli | e307513fa073beaddd7247d944fcef7092ee95dd | [
"MIT"
] | null | null | null | tests/test_poetcli.py | jkerola/poetcli | e307513fa073beaddd7247d944fcef7092ee95dd | [
"MIT"
] | null | null | null | from pytest import raises
from poetcli.main import PoetCLITest
def test_poetcli():
# test poetcli without any subcommands or arguments
with PoetCLITest() as app:
app.run()
assert app.exit_code == 0
def test_poetcli_debug():
# test that debug mode is functional
argv = ['--debug']
... | 21.923077 | 55 | 0.64386 | from pytest import raises
from poetcli.main import PoetCLITest
def test_poetcli():
with PoetCLITest() as app:
app.run()
assert app.exit_code == 0
def test_poetcli_debug():
argv = ['--debug']
with PoetCLITest(argv=argv) as app:
app.run()
assert app.debug is True
... | true | true |
f71c38457ce1146b10dc11311b97086931643887 | 2,269 | py | Python | cengal/hardware_info/cpu.py | FI-Mihej/Cengal | 516b9780da6ccc9168f8f89d7ba13dc29e24bc0b | [
"Apache-2.0"
] | 3 | 2018-07-23T18:48:58.000Z | 2021-07-18T14:17:20.000Z | cengal/hardware_info/cpu.py | FI-Mihej/Cengal | 516b9780da6ccc9168f8f89d7ba13dc29e24bc0b | [
"Apache-2.0"
] | null | null | null | cengal/hardware_info/cpu.py | FI-Mihej/Cengal | 516b9780da6ccc9168f8f89d7ba13dc29e24bc0b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
# Copyright © 2017 ButenkoMS. All rights reserved. Contacts: <gtalk@butenkoms.space>
#
# 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... | 31.082192 | 100 | 0.712649 |
import cpuinfo
__author__ = "ButenkoMS <gtalk@butenkoms.space>"
__copyright__ = "Copyright © 2017 ButenkoMS. All rights reserved. Contacts: <gtalk@butenkoms.space>"
__credits__ = ["ButenkoMS <gtalk@butenkoms.space>", ]
__license__ = "Apache License, Version 2.0"
__version__ = "0.0.1"
__maintainer__ =... | true | true |
f71c38629e95ab04b4b2bedf6a45506097a47901 | 6,731 | py | Python | glfw/library.py | brpollock/pyGLFW | 1f78383e0b466ad4af83270ef9631d306665e714 | [
"MIT"
] | null | null | null | glfw/library.py | brpollock/pyGLFW | 1f78383e0b466ad4af83270ef9631d306665e714 | [
"MIT"
] | null | null | null | glfw/library.py | brpollock/pyGLFW | 1f78383e0b466ad4af83270ef9631d306665e714 | [
"MIT"
] | null | null | null | """
Python bindings for GLFW.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import ctypes
import os
import glob
import sys
import subprocess
import textwrap
def _find_library_candidates(library_names,
library_file_exten... | 34.695876 | 109 | 0.588323 |
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import ctypes
import os
import glob
import sys
import subprocess
import textwrap
def _find_library_candidates(library_names,
library_file_extensions,
... | true | true |
f71c38e7407523eed8a014449cd499676148e894 | 1,456 | py | Python | azure-servicefabric/azure/servicefabric/models/scaling_mechanism_description_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-servicefabric/azure/servicefabric/models/scaling_mechanism_description_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-servicefabric/azure/servicefabric/models/scaling_mechanism_description_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2018-10-16T13:08:23.000Z | 2018-10-16T13:08:23.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 33.860465 | 174 | 0.644231 |
from msrest.serialization import Model
class ScalingMechanismDescription(Model):
_validation = {
'kind': {'required': True},
}
_attribute_map = {
'kind': {'key': 'Kind', 'type': 'str'},
}
_subtype_map = {
'kind': {'PartitionInstanceCount': 'PartitionInstanceCo... | true | true |
f71c39ebffaad67624f3ef9efc20843ab2437935 | 4,779 | py | Python | selfdrive/controls/lib/long_mpc.py | DS1SQM/HKG082_SCC_2 | c5b1c7fb593a69b1bc585eaa9947c0a76f381bbc | [
"MIT"
] | null | null | null | selfdrive/controls/lib/long_mpc.py | DS1SQM/HKG082_SCC_2 | c5b1c7fb593a69b1bc585eaa9947c0a76f381bbc | [
"MIT"
] | null | null | null | selfdrive/controls/lib/long_mpc.py | DS1SQM/HKG082_SCC_2 | c5b1c7fb593a69b1bc585eaa9947c0a76f381bbc | [
"MIT"
] | 1 | 2020-10-20T12:26:33.000Z | 2020-10-20T12:26:33.000Z | import os
import math
import cereal.messaging as messaging
from common.numpy_fast import clip, interp
from selfdrive.swaglog import cloudlog
from common.realtime import sec_since_boot
from selfdrive.controls.lib.radar_helpers import _LEAD_ACCEL_TAU
from selfdrive.controls.lib.longitudinal_mpc import libmpc_py
from sel... | 35.139706 | 113 | 0.669178 | import os
import math
import cereal.messaging as messaging
from common.numpy_fast import clip, interp
from selfdrive.swaglog import cloudlog
from common.realtime import sec_since_boot
from selfdrive.controls.lib.radar_helpers import _LEAD_ACCEL_TAU
from selfdrive.controls.lib.longitudinal_mpc import libmpc_py
from sel... | true | true |
f71c39f0319329a2f4f59ab30550497ff4c60f40 | 6,860 | py | Python | script/bfe.py | tiancity-NJU/REID | 125a520a9c0b94440a7757e6f3c3c8bf976906ec | [
"MIT"
] | 1 | 2020-06-15T07:50:05.000Z | 2020-06-15T07:50:05.000Z | script/bfe.py | tiancity-NJU/REID | 125a520a9c0b94440a7757e6f3c3c8bf976906ec | [
"MIT"
] | null | null | null | script/bfe.py | tiancity-NJU/REID | 125a520a9c0b94440a7757e6f3c3c8bf976906ec | [
"MIT"
] | 4 | 2019-04-09T13:10:58.000Z | 2020-03-06T15:22:38.000Z | # encoding: utf-8
import os
import sys
from os import path as osp
from pprint import pprint
import numpy as np
import torch
from tensorboardX import SummaryWriter
from torch import nn
from torch.backends import cudnn
from torch.utils.data import DataLoader
sys.path.insert(0,os.path.abspath(os.path.dirname(__file__)+o... | 34.3 | 115 | 0.655248 |
import os
import sys
from os import path as osp
from pprint import pprint
import numpy as np
import torch
from tensorboardX import SummaryWriter
from torch import nn
from torch.backends import cudnn
from torch.utils.data import DataLoader
sys.path.insert(0,os.path.abspath(os.path.dirname(__file__)+os.sep+'..'))
fro... | true | true |
f71c3aaf6ae1025d594d51ec2a103091d3f8a9c3 | 21,405 | py | Python | pandapower/build_gen.py | mathildebadoual/pandapower | 9ba4bcb78e84b644d2ba6df0c08e285c54af8ddc | [
"BSD-3-Clause"
] | 1 | 2020-10-19T06:39:15.000Z | 2020-10-19T06:39:15.000Z | pandapower/build_gen.py | mathildebadoual/pandapower | 9ba4bcb78e84b644d2ba6df0c08e285c54af8ddc | [
"BSD-3-Clause"
] | null | null | null | pandapower/build_gen.py | mathildebadoual/pandapower | 9ba4bcb78e84b644d2ba6df0c08e285c54af8ddc | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2016-2018 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.
import numpy as np
import numpy.core.numeric as ncn
from numpy import array, zeros, isnan
from pandas import DataFrame
... | 46.131466 | 120 | 0.608783 |
import numpy as np
import numpy.core.numeric as ncn
from numpy import array, zeros, isnan
from pandas import DataFrame
from pandapower.idx_bus import PV, REF, VA, VM, BUS_TYPE, NONE, VMAX, VMIN, PQ
from pandapower.idx_gen import QMIN, QMAX, PMIN, PMAX, GEN_STATUS, GEN_BUS, PG, VG, QG
def _build_gen_... | true | true |
f71c3ac798ea0aa03af1f53d6228417fc90cca0c | 861 | py | Python | abtools/__init__.py | menis/abtools | bfc7c6c508b174bb3b74d8f152156242ddd2ee77 | [
"MIT"
] | 9 | 2016-06-13T20:00:04.000Z | 2022-03-19T19:07:23.000Z | abtools/__init__.py | menis/abtools | bfc7c6c508b174bb3b74d8f152156242ddd2ee77 | [
"MIT"
] | null | null | null | abtools/__init__.py | menis/abtools | bfc7c6c508b174bb3b74d8f152156242ddd2ee77 | [
"MIT"
] | 4 | 2018-04-10T09:05:21.000Z | 2022-01-27T21:23:06.000Z | import os
if not os.environ.get('READTHEDOCS', None):
from ._compare import run as compare
from ._correct import run as correct
from ._finder import run as finder
from ._phylogeny import run as phylogeny
# import _stats as stats
from pkg_resources import get_distribution, DistributionNotFound... | 33.115385 | 74 | 0.688734 | import os
if not os.environ.get('READTHEDOCS', None):
from ._compare import run as compare
from ._correct import run as correct
from ._finder import run as finder
from ._phylogeny import run as phylogeny
from pkg_resources import get_distribution, DistributionNotFound
import os.path
... | true | true |
f71c3b9ce33e658445e5575868064ec2d77a48fe | 2,312 | py | Python | src/borg/shellpattern.py | russelldavis/borg | 20abc9d68742a8cf5da8503cef96b2e9a5c83213 | [
"BSD-3-Clause"
] | 2 | 2021-08-19T16:25:15.000Z | 2021-11-17T10:54:16.000Z | src/borg/shellpattern.py | tschwinge/borg | 3e2d5b2b220aee2db68f81bbc0108332abc9cda9 | [
"BSD-3-Clause"
] | null | null | null | src/borg/shellpattern.py | tschwinge/borg | 3e2d5b2b220aee2db68f81bbc0108332abc9cda9 | [
"BSD-3-Clause"
] | null | null | null | import os
import re
def translate(pat, match_end=r"\Z"):
"""Translate a shell-style pattern to a regular expression.
The pattern may include ``**<sep>`` (<sep> stands for the platform-specific path separator; "/" on POSIX systems) for
matching zero or more directory levels and "*" for matching zero or mo... | 35.030303 | 121 | 0.493945 | import os
import re
def translate(pat, match_end=r"\Z"):
sep = os.path.sep
n = len(pat)
i = 0
res = ""
while i < n:
c = pat[i]
i += 1
if c == "*":
if i + 1 < n and pat[i] == "*" and pat[i + 1] == sep:
res += r"... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.