hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c0832747d30388e3e049763a54c581b207fd8e6 | 610 | py | Python | enroll.py | JarbasHiveMind/HiveMind-matrix-bridge | cc100f9a9a823e9235b8774c5d545c33520a985a | [
"Apache-2.0"
] | 1 | 2021-08-09T07:40:02.000Z | 2021-08-09T07:40:02.000Z | enroll.py | JarbasHiveMind/HiveMind-matrix-bridge | cc100f9a9a823e9235b8774c5d545c33520a985a | [
"Apache-2.0"
] | 1 | 2021-08-11T23:42:19.000Z | 2021-08-11T23:42:19.000Z | enroll.py | JarbasHiveMind/HiveMind-matrix-bridge | cc100f9a9a823e9235b8774c5d545c33520a985a | [
"Apache-2.0"
] | null | null | null | from jarbas_hive_mind.database import ClientDatabase
# name can be anything, currently not used, meant for humans
name = "NotHuman"
# access key, think of it like a password
key = "erpDerPerrDurHUr"
# pre-shared symmetric encryption key, to end2end encrypt your payloads
# (optional) automated key exchange is WIP and... | 30.5 | 75 | 0.765574 | from jarbas_hive_mind.database import ClientDatabase
name = "NotHuman"
key = "erpDerPerrDurHUr"
crypto_key = None
mail = "jarbasai@mailfence.com"
with ClientDatabase() as db:
db.add_client(name, mail, key, crypto_key=crypto_key)
| true | true |
1c0832d0296309956fc0b1ed09c32b7f92ace24e | 556 | py | Python | Instructions.py | TomDouris/solitaire | 255ad0f7b0959479aad98c55817457cd1c7037ea | [
"MIT"
] | null | null | null | Instructions.py | TomDouris/solitaire | 255ad0f7b0959479aad98c55817457cd1c7037ea | [
"MIT"
] | null | null | null | Instructions.py | TomDouris/solitaire | 255ad0f7b0959479aad98c55817457cd1c7037ea | [
"MIT"
] | null | null | null | # Instructions.py
import pygame
import constants
from Location import Location
class Instructions:
def __init__(self, instructions):
self.instructions = instructions
def draw(self, screen):
font = pygame.font.SysFont(constants.FONT_ARIAL, int(round(constants.CELL_WIDTH*1/2)), False, False)
... | 30.888889 | 114 | 0.726619 |
import pygame
import constants
from Location import Location
class Instructions:
def __init__(self, instructions):
self.instructions = instructions
def draw(self, screen):
font = pygame.font.SysFont(constants.FONT_ARIAL, int(round(constants.CELL_WIDTH*1/2)), False, False)
for i, instru... | true | true |
1c08339413be78b95bb9d0f9c94a99329e6aca7b | 18,612 | py | Python | pythonforandroid/bootstraps/pygame/build/build.py | wo01/python-for-android | df0866d95c9c508299a6f948302454beb971e3ac | [
"MIT"
] | 1 | 2019-09-20T03:05:58.000Z | 2019-09-20T03:05:58.000Z | pythonforandroid/bootstraps/pygame/build/build.py | tangingw/python-for-android | 7c125ad96f71a950ed272a116a9446c6f60e87a9 | [
"MIT"
] | null | null | null | pythonforandroid/bootstraps/pygame/build/build.py | tangingw/python-for-android | 7c125ad96f71a950ed272a116a9446c6f60e87a9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.7
from os.path import dirname, join, isfile, realpath, relpath, split, exists
from zipfile import ZipFile
import sys
sys.path.insert(0, 'buildlib/jinja2.egg')
sys.path.insert(0, 'buildlib')
from fnmatch import fnmatch
import tarfile
import os
import shutil
import subprocess
import time
import j... | 34.659218 | 83 | 0.58156 |
from os.path import dirname, join, isfile, realpath, relpath, split, exists
from zipfile import ZipFile
import sys
sys.path.insert(0, 'buildlib/jinja2.egg')
sys.path.insert(0, 'buildlib')
from fnmatch import fnmatch
import tarfile
import os
import shutil
import subprocess
import time
import jinja2
if os.name == 'nt'... | true | true |
1c083482ee10b52e6680756db2f99aa19a4e23ea | 20,570 | py | Python | pennylane/devices/tests/test_gates.py | Sinestro38/pennylane | 2115cb593de698785bee89740b72ea09895d5f1c | [
"Apache-2.0"
] | null | null | null | pennylane/devices/tests/test_gates.py | Sinestro38/pennylane | 2115cb593de698785bee89740b72ea09895d5f1c | [
"Apache-2.0"
] | 1 | 2021-05-27T05:36:41.000Z | 2021-05-27T05:36:41.000Z | pennylane/devices/tests/test_gates.py | Slimane33/pennylane | fe5d1dffa152fd34e4f9224df02eecb219affa06 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2021 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... | 33.832237 | 98 | 0.588721 |
from cmath import exp
from math import cos, sin, sqrt
import pytest
import numpy as np
import pennylane as qml
from scipy.linalg import block_diag
from flaky import flaky
pytestmark = pytest.mark.skip_unsupported
np.random.seed(42)
ops = {
"BasisState": qml.BasisState(np.array([0]), wires=[0]),
"CNOT":... | true | true |
1c0834f7a66e8431dc458e907de9674427833cae | 2,782 | py | Python | extra/frames.py | meninge/moineau | a4597a7823c765e76a186008510cfd23bfbf010e | [
"MIT"
] | null | null | null | extra/frames.py | meninge/moineau | a4597a7823c765e76a186008510cfd23bfbf010e | [
"MIT"
] | 1 | 2017-02-03T07:30:28.000Z | 2017-02-03T07:47:04.000Z | extra/frames.py | meninge/moineau | a4597a7823c765e76a186008510cfd23bfbf010e | [
"MIT"
] | null | null | null | """
file: moineau/extra/frames.py
author: Hugues de Valon
Parse MNIST datasets to create C arrays containing the frames and the labels.
usage (place yourself in the same folder than this file):
python frames.py [FRAMES_NUMBER] [MNIST_FRAMES_DATA] [MNIST_LABELS_DATA]
If no arguments are given use default behaviour... | 37.093333 | 81 | 0.634076 |
import sys
DATA_BEGIN = 0x10
LABEL_BEGIN = 0x8
IMAGE_NUMBER = 1000
ROWS = 28
COLUMNS = 28
FRAME_SIZE = ROWS * COLUMNS
def write_frames_array(mnist_frames_file, frame_number):
if frame_number > IMAGE_NUMBER:
raise Exception('Too much frames wanted')
with open("../src/frames.c", "w+") as frames:
... | true | true |
1c0835b0f3db47cdd84f289eef8da66c3b5def20 | 6,902 | py | Python | ST_DM/KDD2021-MSTPAC/code/MST-PAC/frame/core/cpu_predictor.py | zhangyimi/Research | 866f91d9774a38d205d6e9a3b1ee6293748261b3 | [
"Apache-2.0"
] | 1,319 | 2020-02-14T10:42:07.000Z | 2022-03-31T15:42:18.000Z | ST_DM/KDD2021-MSTPAC/code/MST-PAC/frame/core/cpu_predictor.py | green9989/Research | 94519a72e7936c77f62a31709634b72c09aabf74 | [
"Apache-2.0"
] | 192 | 2020-02-14T02:53:34.000Z | 2022-03-31T02:25:48.000Z | ST_DM/KDD2021-MSTPAC/code/MST-PAC/frame/core/cpu_predictor.py | green9989/Research | 94519a72e7936c77f62a31709634b72c09aabf74 | [
"Apache-2.0"
] | 720 | 2020-02-14T02:12:38.000Z | 2022-03-31T12:21:15.000Z | #############################################################################
#
# Copyright (c) 2019 Baidu.com, Inc. All Rights Reserved
#
############################################################################
"""
Specify the brief cpu_predictor.py
Author: map(wushilei@baidu.com)
Date: 2019/08/22 17:06:30... | 37.308108 | 95 | 0.581136 |
from __future__ import print_function
import os
import sys
import argparse
import numpy as np
import logging
import paddle.fluid as fluid
from base_frame import BaseFrame
from utils import flags
from utils.load_conf_file import LoadConfFile
FLAGS = flags.FLAGS
class CPUPredictor(BaseFrame):
def __init__(se... | true | true |
1c0835e2b3cf3f44f25575500bb30fc47a420a5e | 539 | py | Python | tests/test_effects/dummy3_effect.py | RatJuggler/led-shim-effects | 3c63f5f2ce3f35f52e784489deb9212757c18cd2 | [
"MIT"
] | 1 | 2021-04-17T16:18:14.000Z | 2021-04-17T16:18:14.000Z | tests/test_effects/dummy3_effect.py | RatJuggler/led-shim-effects | 3c63f5f2ce3f35f52e784489deb9212757c18cd2 | [
"MIT"
] | 12 | 2019-07-26T18:01:56.000Z | 2019-08-31T15:35:17.000Z | tests/test_effects/dummy3_effect.py | RatJuggler/led-shim-demo | 3c63f5f2ce3f35f52e784489deb9212757c18cd2 | [
"MIT"
] | null | null | null | from ledshimdemo.canvas import Canvas
from ledshimdemo.colours import Colours
from ledshimdemo.abstract_effect import AbstractEffect
class Dummy3Effect(AbstractEffect):
"""
A dummy effect.
"""
def __init__(self, canvas: Canvas) -> None:
self.__colour = 0
super(Dummy3Effect, self).__in... | 26.95 | 93 | 0.680891 | from ledshimdemo.canvas import Canvas
from ledshimdemo.colours import Colours
from ledshimdemo.abstract_effect import AbstractEffect
class Dummy3Effect(AbstractEffect):
def __init__(self, canvas: Canvas) -> None:
self.__colour = 0
super(Dummy3Effect, self).__init__("Dummy3Effect", "A dummy effect... | true | true |
1c083601cee7078f7d932dc185a07c077237fcd5 | 707 | py | Python | ROBOT_CODE/python/displacement.py | tvetere/Zebra-Robotics-Team-Code | a8e407ea6e81c7f82b9e8ce20cee373e45e58eba | [
"MIT"
] | 1 | 2018-07-13T16:55:37.000Z | 2018-07-13T16:55:37.000Z | ROBOT_CODE/python/displacement.py | tvetere/Zebra-Robotics-Team-Code | a8e407ea6e81c7f82b9e8ce20cee373e45e58eba | [
"MIT"
] | null | null | null | ROBOT_CODE/python/displacement.py | tvetere/Zebra-Robotics-Team-Code | a8e407ea6e81c7f82b9e8ce20cee373e45e58eba | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import cv2
import numpy as np
fn = 'perfect'
img = cv2.imread(fn+'.jpg')
img = cv2.resize(img, (500, 500))
crop_img = img[250:500, 0:500]
# NOTE: its img[y: y + h, x: x + w] and *not* img[x: x + w, y: y + h]
'''
for i in range(500):
cv2.circle(crop_img, (i,250), 1, (255,255,0), 1)
'''
#fo... | 17.675 | 69 | 0.60396 | import cv2
import numpy as np
fn = 'perfect'
img = cv2.imread(fn+'.jpg')
img = cv2.resize(img, (500, 500))
crop_img = img[250:500, 0:500]
min = 1000
max = -1000
count = 0
for y in range(0, 249):
col = crop_img[y,249]
if (col[0]<50 and col[1]>90 and col[2]>90):
count+=1
print(count)
print(count/249*100,"%... | true | true |
1c0836dfe18662ad5fe4620e04bf4e13bf28854b | 6,412 | py | Python | tests/transforms/test_albu_transform.py | bluseking/-first-agnostic-computer-vision-framework-to-offer-a-curated-collection-with-hundreds-of-high-qualit | 2d91eacfab7fcaf09c93352f1e7816ccb2c252b9 | [
"Apache-2.0"
] | null | null | null | tests/transforms/test_albu_transform.py | bluseking/-first-agnostic-computer-vision-framework-to-offer-a-curated-collection-with-hundreds-of-high-qualit | 2d91eacfab7fcaf09c93352f1e7816ccb2c252b9 | [
"Apache-2.0"
] | null | null | null | tests/transforms/test_albu_transform.py | bluseking/-first-agnostic-computer-vision-framework-to-offer-a-curated-collection-with-hundreds-of-high-qualit | 2d91eacfab7fcaf09c93352f1e7816ccb2c252b9 | [
"Apache-2.0"
] | null | null | null | from icevision.tfms.albumentations.albumentations_adapter import (
AlbumentationsMasksComponent,
)
import pytest
from icevision.all import *
from albumentations.augmentations.transforms import (
LongestMaxSize,
Normalize,
PadIfNeeded,
)
from icevision.tfms.albumentations.albumentations_helpers import (
... | 36.431818 | 88 | 0.684654 | from icevision.tfms.albumentations.albumentations_adapter import (
AlbumentationsMasksComponent,
)
import pytest
from icevision.all import *
from albumentations.augmentations.transforms import (
LongestMaxSize,
Normalize,
PadIfNeeded,
)
from icevision.tfms.albumentations.albumentations_helpers import (
... | true | true |
1c0836e37e9276d220bdf1ae6e9e67d0f489d986 | 7,651 | py | Python | labml_nn/capsule_networks/__init__.py | BioGeek/annotated_deep_learning_paper_implementations | e2516cc3063cdfdf11cda05f22a10082297aa33e | [
"MIT"
] | 2,890 | 2020-10-19T07:44:38.000Z | 2021-05-03T08:47:27.000Z | labml_nn/capsule_networks/__init__.py | BioGeek/annotated_deep_learning_paper_implementations | e2516cc3063cdfdf11cda05f22a10082297aa33e | [
"MIT"
] | 19 | 2020-10-17T04:13:15.000Z | 2021-04-28T05:15:19.000Z | labml_nn/capsule_networks/__init__.py | BioGeek/annotated_deep_learning_paper_implementations | e2516cc3063cdfdf11cda05f22a10082297aa33e | [
"MIT"
] | 125 | 2020-10-22T09:57:20.000Z | 2021-04-28T13:33:40.000Z | """
---
title: Capsule Networks
summary: >
PyTorch implementation and tutorial of Capsule Networks.
Capsule network is a neural network architecture that embeds features
as capsules and routes them with a voting mechanism to next layer of capsules.
---
# Capsule Networks
This is a [PyTorch](https://pytorch.org)... | 40.696809 | 222 | 0.634296 |
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
from labml_helpers.module import Module
class Squash(Module):
def __init__(self, epsilon=1e-8):
super().__init__()
self.epsilon = epsilon
def forward(self, s: torch.Tensor):
s2 = (s ** 2).sum(dim... | true | true |
1c083703ebf3421b7eee977fe21fe47215335619 | 826 | py | Python | mahjonggscoring/rules/test/test_three_kongs.py | kajiki/py-mahjongg-scoring | b23202de018a8206a4be5594247faa0754e7e54e | [
"MIT"
] | null | null | null | mahjonggscoring/rules/test/test_three_kongs.py | kajiki/py-mahjongg-scoring | b23202de018a8206a4be5594247faa0754e7e54e | [
"MIT"
] | null | null | null | mahjonggscoring/rules/test/test_three_kongs.py | kajiki/py-mahjongg-scoring | b23202de018a8206a4be5594247faa0754e7e54e | [
"MIT"
] | null | null | null | import unittest2
from mahjonggscoring.rules import ThreeKongs
from mahjonggscoring import Hand
class TestThreeKongs(unittest2.TestCase):
def setUp(self):
data = [["W", "W", "W", "W"], ["8#", "8#", "8#"], ["3#", "3#", "3#", "3#"], ["2/", "2/", "2/", "2/"], ["3●", "3●"]]
hand = Hand(data)
self.examination = Three... | 34.416667 | 117 | 0.615012 | import unittest2
from mahjonggscoring.rules import ThreeKongs
from mahjonggscoring import Hand
class TestThreeKongs(unittest2.TestCase):
def setUp(self):
data = [["W", "W", "W", "W"], ["8#", "8#", "8#"], ["3#", "3#", "3#", "3#"], ["2/", "2/", "2/", "2/"], ["3●", "3●"]]
hand = Hand(data)
self.examination = Three... | true | true |
1c08377b80da093c69f509725e97af52e9f9d356 | 567 | bzl | Python | tools/workspace/com_jidesoft_jide_oss/repository.bzl | RobotLocomotion/drake-python3.7 | ae397a4c6985262d23e9675b9bf3927c08d027f5 | [
"BSD-3-Clause"
] | 2 | 2021-02-25T02:01:02.000Z | 2021-03-17T04:52:04.000Z | tools/workspace/com_jidesoft_jide_oss/repository.bzl | RobotLocomotion/drake-python3.7 | ae397a4c6985262d23e9675b9bf3927c08d027f5 | [
"BSD-3-Clause"
] | null | null | null | tools/workspace/com_jidesoft_jide_oss/repository.bzl | RobotLocomotion/drake-python3.7 | ae397a4c6985262d23e9675b9bf3927c08d027f5 | [
"BSD-3-Clause"
] | 1 | 2021-06-13T12:05:39.000Z | 2021-06-13T12:05:39.000Z | # -*- mode: python -*-
load("@bazel_tools//tools/build_defs/repo:java.bzl", "java_import_external")
def com_jidesoft_jide_oss_repository(
name,
mirrors = None):
java_import_external(
name = name,
licenses = ["restricted"], # GPL-2.0 WITH Classpath-exception-2.0
jar_urls = ... | 33.352941 | 96 | 0.626102 |
load("@bazel_tools//tools/build_defs/repo:java.bzl", "java_import_external")
def com_jidesoft_jide_oss_repository(
name,
mirrors = None):
java_import_external(
name = name,
licenses = ["restricted"], jar_urls = [
x.format(fulljar = "com/jidesoft/jide-oss/2.9.7/... | true | true |
1c08383eadef76e8b80fda31f8e826e0601c537b | 1,383 | py | Python | nagios/check_pgsql_xmin.py | trentford/iem | 7264d24f2d79a3cd69251a09758e6531233a732f | [
"MIT"
] | 1 | 2019-10-07T17:01:24.000Z | 2019-10-07T17:01:24.000Z | nagios/check_pgsql_xmin.py | trentford/iem | 7264d24f2d79a3cd69251a09758e6531233a732f | [
"MIT"
] | null | null | null | nagios/check_pgsql_xmin.py | trentford/iem | 7264d24f2d79a3cd69251a09758e6531233a732f | [
"MIT"
] | null | null | null | """
Return the maximum xmin in the database, having too large of a value leads to
bad things and eventual database not accepting new writes. I had to lower
the default postgresql setting from 200 mil to 180 mil as the database does
lots of writes and autovac sometimes can not keep up.
"""
from __future__ impor... | 29.425532 | 79 | 0.569053 | from __future__ import print_function
import sys
from pyiem.util import get_dbconn
IEM = get_dbconn('iem', user='nobody')
icursor = IEM.cursor()
def check():
icursor.execute("""
SELECT datname, age(datfrozenxid) FROM pg_database
ORDER by age DESC LIMIT 1
""")
row = icursor.fetchone()
... | true | true |
1c0839d1896db9fadfb161abf04c88a70932ad65 | 1,465 | py | Python | Application/task2.py | sevgo/Programming101 | ac25c4d9695563b449a629c60ec77a739c9f5be3 | [
"BSD-3-Clause"
] | null | null | null | Application/task2.py | sevgo/Programming101 | ac25c4d9695563b449a629c60ec77a739c9f5be3 | [
"BSD-3-Clause"
] | 1 | 2021-09-16T05:44:31.000Z | 2021-09-16T05:44:31.000Z | Application/task2.py | sevgo/Programming101 | ac25c4d9695563b449a629c60ec77a739c9f5be3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Task2: Tetrahedron filled with water.
#
from task1 import fill_tetrahedron
import math
def get_volumes_sorted(sides):
"""Calculates volumes of regular tetrahedrons
by given list of their sides and return a sorted
list of calculated volumes"""
vol = []
if sides:
fo... | 27.12963 | 72 | 0.586348 | from task1 import fill_tetrahedron
import math
def get_volumes_sorted(sides):
vol = []
if sides:
for el in sides:
elm = int(el)
vol.append(fill_tetrahedron(elm))
else:
print ("List is empty!")
return None
vol.sort()
return vol
def tetrahedron_fill... | true | true |
1c0839ed57c2abbbeebc752466dc115f015b6783 | 955 | py | Python | sqlite.py | John-Ingham/Python-sqlite-database | 4e5159bc6907a6f65245522179180d4a4cd3d050 | [
"MIT"
] | null | null | null | sqlite.py | John-Ingham/Python-sqlite-database | 4e5159bc6907a6f65245522179180d4a4cd3d050 | [
"MIT"
] | null | null | null | sqlite.py | John-Ingham/Python-sqlite-database | 4e5159bc6907a6f65245522179180d4a4cd3d050 | [
"MIT"
] | null | null | null | # Don't need this using Django
#
#
import sqlite3
conn = sqlite3.connect('candidate.db') #file or in memory database
c = conn.cursor()
# c.execute("""CREATE TABLE candidates (
# name text,
# candidate_ref text)
# """)
# c.execute("""CR... | 29.84375 | 100 | 0.574869 | #
#
import sqlite3
conn = sqlite3.connect('candidate.db') #file or in memory database
c = conn.cursor()
# c.execute("""CREATE TABLE candidates (
# name text,
# candidate_ref text)
# """)
# c.execute("""CREATE TABLE candidate_scores (
#... | true | true |
1c083a27519542448854bd3c9f02e7dfb6921c03 | 149 | py | Python | labs/week 6/lab01Q4.py | michealcannon/data-rep-exercises | a6ec992d92e11959f2ca929fcd0491f811c1ae72 | [
"Apache-2.0"
] | null | null | null | labs/week 6/lab01Q4.py | michealcannon/data-rep-exercises | a6ec992d92e11959f2ca929fcd0491f811c1ae72 | [
"Apache-2.0"
] | null | null | null | labs/week 6/lab01Q4.py | michealcannon/data-rep-exercises | a6ec992d92e11959f2ca929fcd0491f811c1ae72 | [
"Apache-2.0"
] | null | null | null | import requests
url = 'http://127.0.0.1:5000/cars/08%20C%201234'
response = requests.delete(url)
print (response.status_code)
print (response.text) | 21.285714 | 48 | 0.751678 | import requests
url = 'http://127.0.0.1:5000/cars/08%20C%201234'
response = requests.delete(url)
print (response.status_code)
print (response.text) | true | true |
1c083a6d809b044fbdfb5cd9aa34e2b7d6479a24 | 1,770 | py | Python | ambari-agent/src/main/python/ambari_agent/listeners/ConfigurationEventListener.py | g-boros/ambari | e5e10cd81fcf48cbcee82456769145ad8c954e1e | [
"Apache-2.0"
] | 1 | 2018-04-06T16:47:12.000Z | 2018-04-06T16:47:12.000Z | ambari-agent/src/main/python/ambari_agent/listeners/ConfigurationEventListener.py | bazaarvoice/ambari | 69c9fc16e665826240e49d46ad2210d2d9619513 | [
"Apache-2.0"
] | null | null | null | ambari-agent/src/main/python/ambari_agent/listeners/ConfigurationEventListener.py | bazaarvoice/ambari | 69c9fc16e665826240e49d46ad2210d2d9619513 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
'''
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")... | 34.038462 | 106 | 0.775706 |
import logging
import ambari_stomp
from ambari_agent.listeners import EventListener
from ambari_agent import Constants
logger = logging.getLogger(__name__)
class ConfigurationEventListener(EventListener):
def __init__(self, configuration_cache):
self.configuration_cache = configuration_cache
def on_event(... | true | true |
1c083abf2fc4226d3081fff2f3e12a493ace5ae7 | 654 | py | Python | setup.py | ellisware/factory_pkg | f44da252e89c67dcea9ec80ada9ed0838bd0f009 | [
"MIT"
] | null | null | null | setup.py | ellisware/factory_pkg | f44da252e89c67dcea9ec80ada9ed0838bd0f009 | [
"MIT"
] | null | null | null | setup.py | ellisware/factory_pkg | f44da252e89c67dcea9ec80ada9ed0838bd0f009 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="factory_pkg",
version="0.0.1",
author="Mike Ellis",
author_email="mike.ellis3@gmail.com",
description="Modeling a OASREST API",
long_description=long_description,
long_description_... | 26.16 | 50 | 0.643731 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="factory_pkg",
version="0.0.1",
author="Mike Ellis",
author_email="mike.ellis3@gmail.com",
description="Modeling a OASREST API",
long_description=long_description,
long_description_... | true | true |
1c083b34a8284b906bdffdd2d5141b106350acf8 | 3,182 | py | Python | src/dispatch/tag/views.py | roor0/dispatch | 12c4f567096411abe62abaf61c7c124496764346 | [
"Apache-2.0"
] | 3,417 | 2020-02-23T22:54:47.000Z | 2022-03-31T13:01:01.000Z | src/dispatch/tag/views.py | roor0/dispatch | 12c4f567096411abe62abaf61c7c124496764346 | [
"Apache-2.0"
] | 607 | 2020-02-24T14:27:02.000Z | 2022-03-30T19:15:39.000Z | src/dispatch/tag/views.py | roor0/dispatch | 12c4f567096411abe62abaf61c7c124496764346 | [
"Apache-2.0"
] | 359 | 2020-02-24T19:04:43.000Z | 2022-03-29T06:48:12.000Z | from fastapi import APIRouter, Depends, HTTPException, status
from sqlalchemy.orm import Session
from dispatch.database.core import get_db, get_class_by_tablename
from dispatch.database.service import common_parameters, search_filter_sort_paginate
from dispatch.models import PrimaryKey
from dispatch.tag.recommender im... | 36.159091 | 96 | 0.69736 | from fastapi import APIRouter, Depends, HTTPException, status
from sqlalchemy.orm import Session
from dispatch.database.core import get_db, get_class_by_tablename
from dispatch.database.service import common_parameters, search_filter_sort_paginate
from dispatch.models import PrimaryKey
from dispatch.tag.recommender im... | true | true |
1c083bb8b729f8d9933a8d938785c16bf871e4b7 | 400 | py | Python | tests/basics/while_cond.py | geowor01/micropython | 7fb13eeef4a85f21cae36f1d502bcc53880e1815 | [
"MIT"
] | 7 | 2019-10-18T13:41:39.000Z | 2022-03-15T17:27:57.000Z | tests/basics/while_cond.py | geowor01/micropython | 7fb13eeef4a85f21cae36f1d502bcc53880e1815 | [
"MIT"
] | null | null | null | tests/basics/while_cond.py | geowor01/micropython | 7fb13eeef4a85f21cae36f1d502bcc53880e1815 | [
"MIT"
] | 2 | 2020-06-23T09:10:15.000Z | 2020-12-22T06:42:14.000Z | # test while conditions which are optimised by the compiler
while 0:
print(0)
else:
print(1)
while 1:
print(2)
break
while 2:
print(3)
break
while -1:
print(4)
break
while False:
print('a')
else:
print('b')
while True:
print('a')
break
while not False:
print('a... | 10.526316 | 59 | 0.5725 |
while 0:
print(0)
else:
print(1)
while 1:
print(2)
break
while 2:
print(3)
break
while -1:
print(4)
break
while False:
print('a')
else:
print('b')
while True:
print('a')
break
while not False:
print('a')
break
while not True:
print('a')
else:
print... | true | true |
1c083be6e9ccf836434df291311c2d87dfa8ae85 | 1,418 | py | Python | setup.py | cosmic-api/cosmic.py | d8f12ecc73a4ce2c64078422a3c0ded680191902 | [
"MIT"
] | 1 | 2016-04-11T12:47:08.000Z | 2016-04-11T12:47:08.000Z | setup.py | cosmic-api/cosmic.py | d8f12ecc73a4ce2c64078422a3c0ded680191902 | [
"MIT"
] | null | null | null | setup.py | cosmic-api/cosmic.py | d8f12ecc73a4ce2c64078422a3c0ded680191902 | [
"MIT"
] | null | null | null | #!/usr/bin/python"""
"""
Cosmic
------
Cosmic is a tiny web API framework based on
`Teleport <http://teleport-json.org/>`_.
Links
`````
* `Website <http://www.cosmic-api.com/>`_
* `Documentation <http://www.cosmic-api.com/docs/cosmic/python/latest/>`_
* `Development version <https://github.com/cosmic-api/cosmic.py>`... | 21.815385 | 73 | 0.636812 |
from setuptools import setup
import os
root = os.path.abspath(os.path.dirname(__file__))
with open("{}/LICENSE".format(root)) as license_file:
license_text = license_file.read()
with open("{}/CHANGES.rst".format(root)) as changes_file:
changelog_text = changes_file.read()
long_description = """
{}
License
... | true | true |
1c083c3ca930187e9ebad88ab1f3bf5aa1f6a877 | 2,706 | py | Python | homeassistant/components/zha/const.py | smart-home-iot/home-assistant | c050eb4100368b272ecbeab06c4ffaf1982f4bcd | [
"Apache-2.0"
] | 2 | 2019-05-13T10:51:17.000Z | 2019-06-03T06:44:19.000Z | homeassistant/components/zha/const.py | smart-home-iot/home-assistant | c050eb4100368b272ecbeab06c4ffaf1982f4bcd | [
"Apache-2.0"
] | null | null | null | homeassistant/components/zha/const.py | smart-home-iot/home-assistant | c050eb4100368b272ecbeab06c4ffaf1982f4bcd | [
"Apache-2.0"
] | 1 | 2019-09-03T13:54:33.000Z | 2019-09-03T13:54:33.000Z | """All constants related to the ZHA component."""
DEVICE_CLASS = {}
SINGLE_INPUT_CLUSTER_DEVICE_CLASS = {}
SINGLE_OUTPUT_CLUSTER_DEVICE_CLASS = {}
COMPONENT_CLUSTERS = {}
def populate_data():
"""Populate data using constants from bellows.
These cannot be module level, as importing bellows must be done in a
... | 40.38806 | 72 | 0.692535 |
DEVICE_CLASS = {}
SINGLE_INPUT_CLUSTER_DEVICE_CLASS = {}
SINGLE_OUTPUT_CLUSTER_DEVICE_CLASS = {}
COMPONENT_CLUSTERS = {}
def populate_data():
from zigpy import zcl
from zigpy.profiles import PROFILES, zha, zll
DEVICE_CLASS[zha.PROFILE_ID] = {
zha.DeviceType.ON_OFF_SWITCH: 'binary_sensor',
... | true | true |
1c083c47dea05a4cd833348d53d31e77a5fb6368 | 115 | py | Python | news/models.py | vindeolal/pari | 8c69d15101480c3e803d6d74f8007cefee20c350 | [
"BSD-3-Clause"
] | null | null | null | news/models.py | vindeolal/pari | 8c69d15101480c3e803d6d74f8007cefee20c350 | [
"BSD-3-Clause"
] | null | null | null | news/models.py | vindeolal/pari | 8c69d15101480c3e803d6d74f8007cefee20c350 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from django.db import models
from wagtail.wagtailcore.models import Page
| 19.166667 | 43 | 0.852174 | from __future__ import unicode_literals
from django.db import models
from wagtail.wagtailcore.models import Page
| true | true |
1c083ca7c29444f8b18683137ef0a61e3ab5d625 | 1,896 | py | Python | scripts/macos-gen-dmg.py | Aragami1408/taisei | cbe07e53df4c4a0c430823ab83d3e605b017a4c5 | [
"CC-BY-4.0"
] | 573 | 2017-10-12T17:48:57.000Z | 2022-03-28T05:44:43.000Z | scripts/macos-gen-dmg.py | Aragami1408/taisei | cbe07e53df4c4a0c430823ab83d3e605b017a4c5 | [
"CC-BY-4.0"
] | 153 | 2017-10-18T19:51:33.000Z | 2022-03-31T11:06:40.000Z | scripts/macos-gen-dmg.py | Aragami1408/taisei | cbe07e53df4c4a0c430823ab83d3e605b017a4c5 | [
"CC-BY-4.0"
] | 72 | 2017-11-17T17:32:46.000Z | 2022-03-23T11:36:33.000Z | #!/usr/bin/env python3
from taiseilib.tempinstall import temp_install
from taiseilib.common import run_main
from pathlib import Path
import argparse
import subprocess
import shlex
import os
from sys import platform
def main(args):
parser = argparse.ArgumentParser(description='Generate a .dmg package for macOS.... | 29.625 | 100 | 0.578586 |
from taiseilib.tempinstall import temp_install
from taiseilib.common import run_main
from pathlib import Path
import argparse
import subprocess
import shlex
import os
from sys import platform
def main(args):
parser = argparse.ArgumentParser(description='Generate a .dmg package for macOS.', prog=args[0])
p... | true | true |
1c083cb6cd60ea94287e81e4d82d98d590bdf537 | 2,164 | py | Python | examples/dfp/v201711/workflow_request_service/get_workflow_approval_requests.py | christineyi3898/googleads-python-lib | cd707dc897b93cf1bbb19355f7424e7834e7fb55 | [
"Apache-2.0"
] | 1 | 2019-10-21T04:10:22.000Z | 2019-10-21T04:10:22.000Z | examples/dfp/v201711/workflow_request_service/get_workflow_approval_requests.py | christineyi3898/googleads-python-lib | cd707dc897b93cf1bbb19355f7424e7834e7fb55 | [
"Apache-2.0"
] | null | null | null | examples/dfp/v201711/workflow_request_service/get_workflow_approval_requests.py | christineyi3898/googleads-python-lib | cd707dc897b93cf1bbb19355f7424e7834e7fb55 | [
"Apache-2.0"
] | 1 | 2019-10-21T04:10:51.000Z | 2019-10-21T04:10:51.000Z | #!/usr/bin/env python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 37.310345 | 79 | 0.700092 | """This example gets workflow approval requests.
Workflow approval requests must be approved or rejected for a workflow to
finish.
"""
from googleads import dfp
def main(client):
workflow_request_service = client.GetService(
'WorkflowRequestService', version='v201711')
statement = (dfp.StatementBuilde... | false | true |
1c083cbf5952df39254a352daaeba23f86a2fc63 | 1,188 | py | Python | 16_customer_category_from_csv.py | dionisiotorres/import_scripts | 14e12c6874e1277b4ad4cdbe46f6b454b43c2aec | [
"Unlicense"
] | null | null | null | 16_customer_category_from_csv.py | dionisiotorres/import_scripts | 14e12c6874e1277b4ad4cdbe46f6b454b43c2aec | [
"Unlicense"
] | null | null | null | 16_customer_category_from_csv.py | dionisiotorres/import_scripts | 14e12c6874e1277b4ad4cdbe46f6b454b43c2aec | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
import xmlrpc.client
import ssl
import csv
from scriptconfig import url, db, pwd
socket = xmlrpc.client.ServerProxy(url,context=ssl._create_unverified_context())
categs = socket.execute(db, 2, pwd, 'res.partner.category', 'search_read', [], ['id','code'])
categories = {categ['code']: categ['i... | 33.942857 | 94 | 0.554714 |
import xmlrpc.client
import ssl
import csv
from scriptconfig import url, db, pwd
socket = xmlrpc.client.ServerProxy(url,context=ssl._create_unverified_context())
categs = socket.execute(db, 2, pwd, 'res.partner.category', 'search_read', [], ['id','code'])
categories = {categ['code']: categ['id'] for categ in categs... | true | true |
1c083d852d0f34a9689daf83dfe8404d2a3a8f2f | 477 | py | Python | voobras/lista.py | GU1LH3RME-LIMA/pythonWebjs | 4786ef3b900f3b45522a0d3f0c4b83e1e68ae25b | [
"MIT"
] | null | null | null | voobras/lista.py | GU1LH3RME-LIMA/pythonWebjs | 4786ef3b900f3b45522a0d3f0c4b83e1e68ae25b | [
"MIT"
] | null | null | null | voobras/lista.py | GU1LH3RME-LIMA/pythonWebjs | 4786ef3b900f3b45522a0d3f0c4b83e1e68ae25b | [
"MIT"
] | null | null | null |
from flask import Flask,render_template,request
from classeprin import *
app=Flask(__name__)
DB_URL='mysql+mysqldb://root:''@localhost:3306/flights'
app.config["SQLALCHEMY_DATABASE_URI"] = DB_URL
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
db.init_app(app)
def main():
flights=Flights.query.all()
for... | 22.714286 | 70 | 0.712788 |
from flask import Flask,render_template,request
from classeprin import *
app=Flask(__name__)
DB_URL='mysql+mysqldb://root:''@localhost:3306/flights'
app.config["SQLALCHEMY_DATABASE_URI"] = DB_URL
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
db.init_app(app)
def main():
flights=Flights.query.all()
for... | true | true |
1c083e38a0902c803592caeeefc9821f8b713914 | 97 | py | Python | bayesian_torch/layers/variational_layers/__init__.py | JunhoPark0314/bayesian-torch | 1590cc483ae7649cd60aad2886ae95f32bea0dbe | [
"BSD-3-Clause"
] | 117 | 2021-01-12T11:14:09.000Z | 2022-03-27T08:04:35.000Z | bayesian_torch/layers/variational_layers/__init__.py | piEsposito/bayesian-torch | f1fc4e5b044fae587279ef29bc9cd33364791d56 | [
"BSD-3-Clause"
] | 12 | 2021-04-01T10:36:51.000Z | 2021-12-16T21:51:30.000Z | bayesian_torch/layers/variational_layers/__init__.py | piEsposito/bayesian-torch | f1fc4e5b044fae587279ef29bc9cd33364791d56 | [
"BSD-3-Clause"
] | 17 | 2021-01-13T13:16:54.000Z | 2022-03-06T16:28:45.000Z | from .linear_variational import *
from .conv_variational import *
from .rnn_variational import *
| 24.25 | 33 | 0.814433 | from .linear_variational import *
from .conv_variational import *
from .rnn_variational import *
| true | true |
1c083ee8e064fe4ba0b5540528998288f160d2c1 | 271 | py | Python | ambra_sdk/service/entrypoints/qctask.py | dicomgrid/sdk-python | bb12eed311bad73dfb863917df4dc5cbcd91a447 | [
"Apache-2.0"
] | 9 | 2020-04-20T23:45:44.000Z | 2021-04-18T11:22:17.000Z | ambra_sdk/service/entrypoints/qctask.py | dicomgrid/sdk-python | bb12eed311bad73dfb863917df4dc5cbcd91a447 | [
"Apache-2.0"
] | 13 | 2020-02-08T16:15:05.000Z | 2021-09-13T22:55:28.000Z | ambra_sdk/service/entrypoints/qctask.py | dicomgrid/sdk-python | bb12eed311bad73dfb863917df4dc5cbcd91a447 | [
"Apache-2.0"
] | 6 | 2020-03-25T17:47:45.000Z | 2021-04-18T11:22:19.000Z | from ambra_sdk.service.entrypoints.generated.qctask import \
AsyncQctask as GAsyncQctask
from ambra_sdk.service.entrypoints.generated.qctask import Qctask as GQctask
class Qctask(GQctask):
"""Qctask."""
class AsyncQctask(GAsyncQctask):
"""AsyncQctask."""
| 22.583333 | 76 | 0.763838 | from ambra_sdk.service.entrypoints.generated.qctask import \
AsyncQctask as GAsyncQctask
from ambra_sdk.service.entrypoints.generated.qctask import Qctask as GQctask
class Qctask(GQctask):
class AsyncQctask(GAsyncQctask):
| true | true |
1c083f3469b9e78735db7b835540904bd482e587 | 1,823 | py | Python | app/main/views.py | HarryThuku/Group-of-Schools | 28437162933b701508526df68c393a83d28b242a | [
"MIT"
] | null | null | null | app/main/views.py | HarryThuku/Group-of-Schools | 28437162933b701508526df68c393a83d28b242a | [
"MIT"
] | null | null | null | app/main/views.py | HarryThuku/Group-of-Schools | 28437162933b701508526df68c393a83d28b242a | [
"MIT"
] | null | null | null | from flask import render_template, request, redirect, url_for, abort, flash, jsonify
from . import main
import os
# from .forms import [form_name]
from ..models import Teachers
from .. import db, photos
from flask_login import login_required, current_user, logout_user, fresh_login_required
import markdown2
# General ... | 27.621212 | 87 | 0.647285 | from flask import render_template, request, redirect, url_for, abort, flash, jsonify
from . import main
import os
from ..models import Teachers
from .. import db, photos
from flask_login import login_required, current_user, logout_user, fresh_login_required
import markdown2
from config import appData
@main.route('/'... | true | true |
1c083ffe2946546d01a2909817cb1f417b55e099 | 81,204 | py | Python | tensorflow/python/eager/context.py | WHSnyder/tensorflow | a4821531c61821b1442417694aaf93821f07045a | [
"Apache-2.0"
] | null | null | null | tensorflow/python/eager/context.py | WHSnyder/tensorflow | a4821531c61821b1442417694aaf93821f07045a | [
"Apache-2.0"
] | 2 | 2021-08-25T16:14:53.000Z | 2022-02-10T04:26:59.000Z | tensorflow/python/eager/context.py | WHSnyder/tensorflow | a4821531c61821b1442417694aaf93821f07045a | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 33.806828 | 114 | 0.720223 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import contextlib
import copy
import os
import random
import threading
from absl import logging
import numpy as np
import six
from tensorflow.core.framework import function_pb2
from tensor... | true | true |
1c084024c160df790ccc2ce582a57584d9a25823 | 2,393 | py | Python | raspi_lcd.py | yuma-m/raspi_lcd | 5bf49f752d67636956f582e702227b602c071298 | [
"MIT"
] | 4 | 2017-11-01T20:00:54.000Z | 2019-05-18T07:03:01.000Z | raspi_lcd.py | yuma-m/raspi_lcd | 5bf49f752d67636956f582e702227b602c071298 | [
"MIT"
] | null | null | null | raspi_lcd.py | yuma-m/raspi_lcd | 5bf49f752d67636956f582e702227b602c071298 | [
"MIT"
] | 1 | 2021-08-08T04:44:15.000Z | 2021-08-08T04:44:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import time
import smbus
import unicodedata
from config import BUS_NUMBER, LCD_ADDR, SLEEP_TIME, DELAY_TIME
from character_table import INITIALIZE_CODES, LINEBREAK_CODE, CHAR_TABLE
COMMAND_ADDR = 0x00
DATA_ADDR = 0x80
c... | 30.291139 | 87 | 0.651483 |
from __future__ import print_function
import sys
import time
import smbus
import unicodedata
from config import BUS_NUMBER, LCD_ADDR, SLEEP_TIME, DELAY_TIME
from character_table import INITIALIZE_CODES, LINEBREAK_CODE, CHAR_TABLE
COMMAND_ADDR = 0x00
DATA_ADDR = 0x80
class LCDController:
def __init__(self):
... | true | true |
1c084082b93ecffc299b08aa464e0b422997924c | 602 | py | Python | tests/utils/test_updates.py | LyzardKing/maestral-dropbox | c1b030de85b69f8867b6a8a6564921f5e851aa1c | [
"MIT"
] | 1 | 2021-02-06T11:26:01.000Z | 2021-02-06T11:26:01.000Z | tests/utils/test_updates.py | LyzardKing/maestral-dropbox | c1b030de85b69f8867b6a8a6564921f5e851aa1c | [
"MIT"
] | null | null | null | tests/utils/test_updates.py | LyzardKing/maestral-dropbox | c1b030de85b69f8867b6a8a6564921f5e851aa1c | [
"MIT"
] | null | null | null | from maestral.utils.updates import (
get_newer_version, check_update_available, is_stable_version
)
def test_has_newer_version():
releases = ('0.6.1', '0.7.0', '1.1.0', '1.2.0.dev2', '1.2.0.beta1', '1.2.0.rc1',)
assert get_newer_version('1.1.0', releases) is None
assert get_newer_version('0.7.0', rel... | 30.1 | 85 | 0.669435 | from maestral.utils.updates import (
get_newer_version, check_update_available, is_stable_version
)
def test_has_newer_version():
releases = ('0.6.1', '0.7.0', '1.1.0', '1.2.0.dev2', '1.2.0.beta1', '1.2.0.rc1',)
assert get_newer_version('1.1.0', releases) is None
assert get_newer_version('0.7.0', rel... | true | true |
1c0840ae873c6ded25875e1036ac15fdf2fdc2d5 | 6,628 | py | Python | airflow/contrib/operators/gcp_cloud_build_operator.py | fxdmhtt/airflow | cf88f7bc7bbd3e9bf110e98f025759a96c130235 | [
"Apache-2.0"
] | 15 | 2017-04-06T09:01:50.000Z | 2021-10-02T13:54:31.000Z | airflow/contrib/operators/gcp_cloud_build_operator.py | fxdmhtt/airflow | cf88f7bc7bbd3e9bf110e98f025759a96c130235 | [
"Apache-2.0"
] | 26 | 2019-08-05T13:44:11.000Z | 2022-03-30T10:06:18.000Z | airflow/contrib/operators/gcp_cloud_build_operator.py | upjohnc/airflow-upjohn-k8s | caadbc1618d73e054de99138b0892cea3a9327c4 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 21 | 2017-08-20T03:01:05.000Z | 2021-09-07T06:47:51.000Z | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 33.64467 | 109 | 0.668075 | from copy import deepcopy
import re
from urllib.parse import urlparse, unquote
import six
from airflow import AirflowException
from airflow.contrib.hooks.gcp_cloud_build_hook import CloudBuildHook
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
REGEX_REPO_PATH = re.compile... | true | true |
1c0840c6f561d64dd84c6a456588ea536bee809b | 3,700 | py | Python | train/utils.py | hassanmohsin/2d-image-classification | 7b52a203fa305d6064fe938d380c94067dc696ee | [
"MIT"
] | null | null | null | train/utils.py | hassanmohsin/2d-image-classification | 7b52a203fa305d6064fe938d380c94067dc696ee | [
"MIT"
] | null | null | null | train/utils.py | hassanmohsin/2d-image-classification | 7b52a203fa305d6064fe938d380c94067dc696ee | [
"MIT"
] | null | null | null | import os
import torch
import torch.functional as F
import torch.nn as nn
class FocalLoss(nn.Module):
def __init__(self, alpha=0.25, gamma=3):
super(FocalLoss, self).__init__()
self.alpha = alpha
self.gamma = gamma
def forward(self, inputs, targets):
bce_loss = F.binary_cross... | 35.238095 | 99 | 0.653514 | import os
import torch
import torch.functional as F
import torch.nn as nn
class FocalLoss(nn.Module):
def __init__(self, alpha=0.25, gamma=3):
super(FocalLoss, self).__init__()
self.alpha = alpha
self.gamma = gamma
def forward(self, inputs, targets):
bce_loss = F.binary_cross... | true | true |
1c0841e85fb7d7b7906e92c06b4341d9e5f432f4 | 1,412 | py | Python | tests/test_webdriver_chrome.py | taizo/splinter | 57761eae9b0d4eced332083046c0a4b39b0d29aa | [
"BSD-3-Clause"
] | null | null | null | tests/test_webdriver_chrome.py | taizo/splinter | 57761eae9b0d4eced332083046c0a4b39b0d29aa | [
"BSD-3-Clause"
] | null | null | null | tests/test_webdriver_chrome.py | taizo/splinter | 57761eae9b0d4eced332083046c0a4b39b0d29aa | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2013 splinter authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
import os
import unittest
from splinter import Browser
from .fake_webapp import EXAMPLE_APP
from .base import WebDriverTests
from selen... | 26.148148 | 67 | 0.677054 |
import os
import unittest
from splinter import Browser
from .fake_webapp import EXAMPLE_APP
from .base import WebDriverTests
from selenium.common.exceptions import WebDriverException
def chrome_installed():
try:
Browser("chrome")
except WebDriverException:
return False
return True
@un... | true | true |
1c08426d654ddb53e3fea5b84d5e8170425a6194 | 1,655 | py | Python | pylastests/test_vlrs.py | k0kod/pylas | e1637f3de4e13c4037f0177da661cb67d3c3dfe9 | [
"BSD-3-Clause"
] | 44 | 2018-03-19T20:05:32.000Z | 2022-02-21T12:16:29.000Z | pylastests/test_vlrs.py | k0kod/pylas | e1637f3de4e13c4037f0177da661cb67d3c3dfe9 | [
"BSD-3-Clause"
] | 32 | 2018-03-19T21:33:36.000Z | 2022-02-21T12:22:07.000Z | pylastests/test_vlrs.py | k0kod/pylas | e1637f3de4e13c4037f0177da661cb67d3c3dfe9 | [
"BSD-3-Clause"
] | 12 | 2018-02-22T18:40:43.000Z | 2021-04-13T13:43:30.000Z | import pytest
import pylas
from pylastests import test_common
def test_adding_classification_lookup():
simple = pylas.read(test_common.simple_las)
classification_lookup = pylas.vlrs.known.ClassificationLookupVlr()
assert len(classification_lookup.lookups) == 0
classification_lookup[20] = "computer"
... | 32.45098 | 78 | 0.745015 | import pytest
import pylas
from pylastests import test_common
def test_adding_classification_lookup():
simple = pylas.read(test_common.simple_las)
classification_lookup = pylas.vlrs.known.ClassificationLookupVlr()
assert len(classification_lookup.lookups) == 0
classification_lookup[20] = "computer"
... | true | true |
1c08431bafd1fc6d80134aa53fec8490a870ffae | 116 | py | Python | responder/config/main.py | stellaraf/responder | e94929fd1b6eb4ea4aad722ab5f54f0dd7a35331 | [
"BSD-3-Clause"
] | null | null | null | responder/config/main.py | stellaraf/responder | e94929fd1b6eb4ea4aad722ab5f54f0dd7a35331 | [
"BSD-3-Clause"
] | null | null | null | responder/config/main.py | stellaraf/responder | e94929fd1b6eb4ea4aad722ab5f54f0dd7a35331 | [
"BSD-3-Clause"
] | null | null | null | """Validate & Initialize Configuration."""
# Project
from responder.models.config import Params
params = Params()
| 16.571429 | 42 | 0.75 |
from responder.models.config import Params
params = Params()
| true | true |
1c08435cef377c9f4d20f7992376b69f952553df | 861 | py | Python | lib/vocabulary.py | yasfmy/attention_model | 330c64878a783b2e294adb502a1eb030de346bf0 | [
"MIT"
] | 1 | 2016-11-09T13:38:52.000Z | 2016-11-09T13:38:52.000Z | lib/vocabulary.py | yasfmy/attention_model | 330c64878a783b2e294adb502a1eb030de346bf0 | [
"MIT"
] | null | null | null | lib/vocabulary.py | yasfmy/attention_model | 330c64878a783b2e294adb502a1eb030de346bf0 | [
"MIT"
] | null | null | null | from collections import defaultdict, Counter
from itertools import chain, takewhile
from config import START_TOKEN, END_TOKEN, UNKNOWN_TOKEN, UNKNOWN_LABEL
class Vocabulary:
def __new__(cls, words_generator, th=5):
obj = super().__new__(cls)
word_freq = Counter(chain.from_iterable((words_generato... | 27.774194 | 78 | 0.620209 | from collections import defaultdict, Counter
from itertools import chain, takewhile
from config import START_TOKEN, END_TOKEN, UNKNOWN_TOKEN, UNKNOWN_LABEL
class Vocabulary:
def __new__(cls, words_generator, th=5):
obj = super().__new__(cls)
word_freq = Counter(chain.from_iterable((words_generato... | true | true |
1c084468399e95fe157f82e7785edcad7bcf91cd | 6,178 | py | Python | setup.py | dougbrion/ModernGL | 6de8938ccd0042c1389a32b697af5f9c9d279e41 | [
"MIT"
] | null | null | null | setup.py | dougbrion/ModernGL | 6de8938ccd0042c1389a32b697af5f9c9d279e41 | [
"MIT"
] | null | null | null | setup.py | dougbrion/ModernGL | 6de8938ccd0042c1389a32b697af5f9c9d279e41 | [
"MIT"
] | null | null | null | import os
import platform
import re
import sys
from distutils.sysconfig import get_config_var
from distutils.version import LooseVersion
from setuptools import Extension, setup
# pylint: disable=C0103, W0212
if sys.version_info < (3, 0):
raise Exception('Python 2 is not supported!')
PLATFORMS = {'windows', 'lin... | 31.520408 | 105 | 0.649725 | import os
import platform
import re
import sys
from distutils.sysconfig import get_config_var
from distutils.version import LooseVersion
from setuptools import Extension, setup
if sys.version_info < (3, 0):
raise Exception('Python 2 is not supported!')
PLATFORMS = {'windows', 'linux', 'darwin', 'cygwin', 'andro... | true | true |
1c0846d73b489c6a5b556f5245d171bd05d00742 | 4,127 | py | Python | test/test_metadata.py | rrobertsrgare/server-client-python | 3f4db45584fb352e9f21c870027a2302cb824909 | [
"CC0-1.0",
"MIT"
] | 470 | 2016-09-14T23:38:48.000Z | 2022-03-31T07:59:53.000Z | test/test_metadata.py | jorwoods/server-client-python | fefd6f18d8a6617829c6323879d2c3ed77a4cda6 | [
"CC0-1.0",
"MIT"
] | 772 | 2016-09-09T18:15:44.000Z | 2022-03-31T22:01:08.000Z | test/test_metadata.py | jorwoods/server-client-python | fefd6f18d8a6617829c6323879d2c3ed77a4cda6 | [
"CC0-1.0",
"MIT"
] | 346 | 2016-09-10T00:05:00.000Z | 2022-03-30T18:55:47.000Z | import unittest
import os.path
import json
import requests_mock
import tableauserverclient as TSC
from tableauserverclient.server.endpoint.exceptions import GraphQLError
TEST_ASSET_DIR = os.path.join(os.path.dirname(__file__), 'assets')
METADATA_QUERY_SUCCESS = os.path.join(TEST_ASSET_DIR, 'metadata_query_success.js... | 41.686869 | 120 | 0.643324 | import unittest
import os.path
import json
import requests_mock
import tableauserverclient as TSC
from tableauserverclient.server.endpoint.exceptions import GraphQLError
TEST_ASSET_DIR = os.path.join(os.path.dirname(__file__), 'assets')
METADATA_QUERY_SUCCESS = os.path.join(TEST_ASSET_DIR, 'metadata_query_success.js... | true | true |
1c0848406451658d3464d950773f86e154c7a46d | 725 | py | Python | ido/modul.py | PiciAkk/ROBIN5-Csomagok | 35e2378038fbfcb33901d157f7a69f6e35af2800 | [
"MIT"
] | null | null | null | ido/modul.py | PiciAkk/ROBIN5-Csomagok | 35e2378038fbfcb33901d157f7a69f6e35af2800 | [
"MIT"
] | null | null | null | ido/modul.py | PiciAkk/ROBIN5-Csomagok | 35e2378038fbfcb33901d157f7a69f6e35af2800 | [
"MIT"
] | null | null | null | import datetime
import pytz
import pycountry_convert as pc
from googletrans import Translator
import json
import requests
from geopy.geocoders import Nominatim
def forditas(szoveg, forrasnyelv, celnyelv):
translator = Translator()
return translator.translate(szoveg, src=forrasnyelv, dest=celnyelv).text
def va... | 27.884615 | 76 | 0.731034 | import datetime
import pytz
import pycountry_convert as pc
from googletrans import Translator
import json
import requests
from geopy.geocoders import Nominatim
def forditas(szoveg, forrasnyelv, celnyelv):
translator = Translator()
return translator.translate(szoveg, src=forrasnyelv, dest=celnyelv).text
def va... | true | true |
1c08485273c755b12e97237301e3302bfaa3d914 | 838 | py | Python | app/api/api_report.py | Alexsik76/Flask_API | 9a1de43583a3b0d6a2d9b2ecc1424199a9eb5332 | [
"MIT"
] | null | null | null | app/api/api_report.py | Alexsik76/Flask_API | 9a1de43583a3b0d6a2d9b2ecc1424199a9eb5332 | [
"MIT"
] | null | null | null | app/api/api_report.py | Alexsik76/Flask_API | 9a1de43583a3b0d6a2d9b2ecc1424199a9eb5332 | [
"MIT"
] | null | null | null | from flask import jsonify, make_response
from dicttoxml import dicttoxml
from flask_restful import Resource, reqparse
from playhouse.shortcuts import model_to_dict
from app.models import Racer
class ApiReport(Resource):
def get(self):
"""
file: ./docs/spec.yml
"""
data = [model_t... | 28.896552 | 84 | 0.645585 | from flask import jsonify, make_response
from dicttoxml import dicttoxml
from flask_restful import Resource, reqparse
from playhouse.shortcuts import model_to_dict
from app.models import Racer
class ApiReport(Resource):
def get(self):
data = [model_to_dict(racer) for racer in Racer.select().order_by(Rac... | true | true |
1c08489fbfa1e470048305a2bcf33d4734d0daf2 | 1,634 | py | Python | src/ssm_document_generator/command/result.py | awslabs/aws-systems-manager-document-generator | 2c041fd52342d95da4535fe3236e43933cc6e08d | [
"Apache-2.0"
] | 54 | 2018-03-07T18:46:50.000Z | 2022-01-26T04:35:56.000Z | src/ssm_document_generator/command/result.py | eshack94/aws-systems-manager-document-generator | 2c041fd52342d95da4535fe3236e43933cc6e08d | [
"Apache-2.0"
] | 2 | 2018-09-30T23:39:08.000Z | 2020-04-03T17:15:21.000Z | src/ssm_document_generator/command/result.py | eshack94/aws-systems-manager-document-generator | 2c041fd52342d95da4535fe3236e43933cc6e08d | [
"Apache-2.0"
] | 12 | 2018-07-27T21:04:12.000Z | 2021-10-20T18:02:57.000Z | import json
import traceback
from ssm_document_generator.command.result_status import ResultStatus
from ssm_document_generator.command.result_type import ResultType
class Result:
"""
Util for simplifying providing unified interface to generated commands
"""
@classmethod
def success(cls, result_d... | 35.521739 | 107 | 0.659119 | import json
import traceback
from ssm_document_generator.command.result_status import ResultStatus
from ssm_document_generator.command.result_type import ResultType
class Result:
@classmethod
def success(cls, result_data, metadata=None):
if metadata is None:
metadata = {}
return... | true | true |
1c084bb45ae346bd7ae0f9747994c9e15dd749db | 1,369 | py | Python | extra_foam/pipeline/tests/test_queue.py | zhujun98/EXtra-foam | 680d6d7fd4afdcbc41eb8e440feac54b6cecab33 | [
"BSD-3-Clause"
] | 7 | 2019-11-27T09:31:37.000Z | 2022-02-12T21:28:49.000Z | extra_foam/pipeline/tests/test_queue.py | zhujun98/EXtra-foam | 680d6d7fd4afdcbc41eb8e440feac54b6cecab33 | [
"BSD-3-Clause"
] | 172 | 2019-12-03T07:56:02.000Z | 2022-03-25T15:46:45.000Z | extra_foam/pipeline/tests/test_queue.py | zhujun98/EXtra-foam | 680d6d7fd4afdcbc41eb8e440feac54b6cecab33 | [
"BSD-3-Clause"
] | 9 | 2019-11-27T09:32:38.000Z | 2022-01-05T09:56:10.000Z | import unittest
from queue import Empty, Full
from threading import Thread
from extra_foam.pipeline.f_queue import SimpleQueue
class TestSimpleQueue(unittest.TestCase):
def testGeneral(self):
queue = SimpleQueue(maxsize=2)
self.assertTrue(queue.empty())
queue.put_nowait(1)
queue.p... | 27.38 | 51 | 0.573411 | import unittest
from queue import Empty, Full
from threading import Thread
from extra_foam.pipeline.f_queue import SimpleQueue
class TestSimpleQueue(unittest.TestCase):
def testGeneral(self):
queue = SimpleQueue(maxsize=2)
self.assertTrue(queue.empty())
queue.put_nowait(1)
queue.p... | true | true |
1c084bb5509e909ddecc12991569c4bc5f8328a2 | 7,891 | py | Python | mirdata/datasets/compmusic_otmm_makam.py | AngeloMendes/mirdata | 6cd0fd740dc619ad3f583ece366bf8a31a48fe86 | [
"BSD-3-Clause"
] | null | null | null | mirdata/datasets/compmusic_otmm_makam.py | AngeloMendes/mirdata | 6cd0fd740dc619ad3f583ece366bf8a31a48fe86 | [
"BSD-3-Clause"
] | null | null | null | mirdata/datasets/compmusic_otmm_makam.py | AngeloMendes/mirdata | 6cd0fd740dc619ad3f583ece366bf8a31a48fe86 | [
"BSD-3-Clause"
] | null | null | null | """OTMM Makam Recognition Dataset Loader
.. admonition:: Dataset Info
:class: dropdown
This dataset is designed to test makam recognition methodologies on Ottoman-Turkish makam music.
It is composed of 50 recording from each of the 20 most common makams in CompMusic Project's Dunya Ottoman-Turkish
Mak... | 32.879167 | 119 | 0.648334 |
import csv
import json
import os
from typing import TextIO
import numpy as np
from mirdata import annotations, core, download_utils, io, jams_utils
BIBTEX = """
@software{sertan_senturk_2016_58413,
author = {Sertan Şentürk and
Altuğ Karakurt},
title = {{otmm_makam_recognition_datas... | true | true |
1c084dc52fca494b436a71cdd379e71416e33d8d | 2,721 | py | Python | src/easynlp/question_answering.py | easynlp/easynlp | 4b3b405a64ca166cc19ee9c43b79a475cf699996 | [
"MIT"
] | 6 | 2021-07-09T08:13:44.000Z | 2021-11-10T04:09:33.000Z | src/easynlp/question_answering.py | easynlp/easynlp | 4b3b405a64ca166cc19ee9c43b79a475cf699996 | [
"MIT"
] | 1 | 2021-07-09T17:18:16.000Z | 2021-07-09T17:18:16.000Z | src/easynlp/question_answering.py | easynlp/easynlp | 4b3b405a64ca166cc19ee9c43b79a475cf699996 | [
"MIT"
] | 1 | 2022-02-09T15:37:14.000Z | 2022-02-09T15:37:14.000Z | from easynlp.data import handle_data
import transformers
from typing import Dict, List, Optional, Union
import pandas as pd
import datasets
def question_answering(
data: Union[List[Dict[str, str]], Dict[str, List], pd.DataFrame, datasets.Dataset],
input_column: str = "text",
context_column: str = "context... | 30.920455 | 87 | 0.679897 | from easynlp.data import handle_data
import transformers
from typing import Dict, List, Optional, Union
import pandas as pd
import datasets
def question_answering(
data: Union[List[Dict[str, str]], Dict[str, List], pd.DataFrame, datasets.Dataset],
input_column: str = "text",
context_column: str = "context... | true | true |
1c084ef4aee389a90c26eb8c8a4e9b4e1fbb5106 | 24,809 | py | Python | NBA Project/venv/Lib/site-packages/plotly/graph_objs/volume/colorbar/__init__.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | 1 | 2020-08-08T21:56:11.000Z | 2020-08-08T21:56:11.000Z | NBA Project/venv/Lib/site-packages/plotly/graph_objs/volume/colorbar/__init__.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | 2 | 2021-03-31T19:54:17.000Z | 2021-06-02T02:33:56.000Z | NBA Project/venv/Lib/site-packages/plotly/graph_objs/volume/colorbar/__init__.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Title(_BaseTraceHierarchyType):
# font
# ----
@property
def font(self):
"""
Sets this color bar's title font. Note that the title's font
used to be set by the now depr... | 34.504868 | 88 | 0.564835 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Title(_BaseTraceHierarchyType):
@property
def font(self):
return self["font"]
@font.setter
def font(self, val):
self["font"] = val
@property
def side... | true | true |
1c084f9748400b1935dd0701491e5a93aa972a93 | 7,339 | py | Python | sdk/python/pulumi_azure_native/databoxedge/v20200901preview/get_io_t_addon.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/databoxedge/v20200901preview/get_io_t_addon.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/databoxedge/v20200901preview/get_io_t_addon.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 35.97549 | 228 | 0.650906 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
__all__ = [
'GetIoTAddonResult',
'AwaitableGetIoTAddonResult',
'get_io_t_addon',
]
@pulumi.output_type
class GetIoTAddonResult:
def... | true | true |
1c084fad0315e642cde2fea74a400b1c40cae876 | 684 | py | Python | tests/test_package.py | JonathanShor/DoubletDetection | fd08d1c0310a78a63438ddff0693a1fba0ad50e4 | [
"MIT"
] | 70 | 2017-06-02T23:26:39.000Z | 2022-03-16T02:35:08.000Z | tests/test_package.py | JonathanShor/DoubletDetection | fd08d1c0310a78a63438ddff0693a1fba0ad50e4 | [
"MIT"
] | 64 | 2017-05-27T19:16:56.000Z | 2022-03-13T01:42:40.000Z | tests/test_package.py | JonathanShor/DoubletDetection | fd08d1c0310a78a63438ddff0693a1fba0ad50e4 | [
"MIT"
] | 28 | 2017-08-16T03:37:19.000Z | 2022-02-01T19:36:36.000Z | import numpy as np
import doubletdetection
def test_classifier():
counts = np.random.poisson(size=(500, 100))
# no phenograph
clf = doubletdetection.BoostClassifier(n_iters=2, use_phenograph=False, standard_scaling=True)
clf.fit(counts).predict(p_thresh=1e-16, voter_thresh=0.5)
clf.doublet_scor... | 31.090909 | 98 | 0.748538 | import numpy as np
import doubletdetection
def test_classifier():
counts = np.random.poisson(size=(500, 100))
clf = doubletdetection.BoostClassifier(n_iters=2, use_phenograph=False, standard_scaling=True)
clf.fit(counts).predict(p_thresh=1e-16, voter_thresh=0.5)
clf.doublet_score()
clf... | true | true |
1c084fb00a99f5d46fb241869d5522d4ff373318 | 4,195 | py | Python | Python/ds/Trie.py | zhcet19/NeoAlgo-1 | c534a23307109280bda0e4867d6e8e490002a4ee | [
"MIT"
] | 897 | 2020-06-25T00:12:52.000Z | 2022-03-24T00:49:31.000Z | Python/ds/Trie.py | zhcet19/NeoAlgo-1 | c534a23307109280bda0e4867d6e8e490002a4ee | [
"MIT"
] | 5,707 | 2020-06-24T17:53:28.000Z | 2022-01-22T05:03:15.000Z | Python/ds/Trie.py | zhcet19/NeoAlgo-1 | c534a23307109280bda0e4867d6e8e490002a4ee | [
"MIT"
] | 1,817 | 2020-06-25T03:51:05.000Z | 2022-03-29T05:14:07.000Z | class Trienode:
"""
Each node in the Trie will contain the following structure
"""
def __init__(self, char):
self.char = char
self.wordend = 0
self.children = [None for i in range(26)]
class Trie:
"""
The Trie data structure
"""
def __init__(self):
"""... | 22.798913 | 77 | 0.516567 | class Trienode:
def __init__(self, char):
self.char = char
self.wordend = 0
self.children = [None for i in range(26)]
class Trie:
def __init__(self):
self.root = Trienode('/')
def insert(self, word):
ptr = self.root
for c in word:
... | true | true |
1c085056d217f9c909d36b4b31411a3013828e57 | 48,016 | py | Python | mypy/checkstrformat.py | alcides/mypy | 931e2cd1e0db2d0e3323d40abe2642701e3af3eb | [
"PSF-2.0"
] | null | null | null | mypy/checkstrformat.py | alcides/mypy | 931e2cd1e0db2d0e3323d40abe2642701e3af3eb | [
"PSF-2.0"
] | null | null | null | mypy/checkstrformat.py | alcides/mypy | 931e2cd1e0db2d0e3323d40abe2642701e3af3eb | [
"PSF-2.0"
] | null | null | null | """
Format expression type checker.
This file is conceptually part of ExpressionChecker and TypeChecker. Main functionality
is located in StringFormatterChecker.check_str_format_call() for '{}'.format(), and in
StringFormatterChecker.check_str_interpolation() for printf-style % interpolation.
Note that although at ru... | 48.160481 | 98 | 0.593823 |
import re
from typing import (
cast, List, Tuple, Dict, Callable, Union, Optional, Pattern, Match, Set
)
from typing_extensions import Final, TYPE_CHECKING, TypeAlias as _TypeAlias
from mypy.types import (
AnnotatedType, Type, AnyType, TupleType, Instance, UnionType, TypeOfAny,
get_proper_type, TypeVarTy... | true | true |
1c0851579fc33ad217180581db660c53ec76b0fa | 1,172 | py | Python | wsidicom/__init__.py | imi-bigpicture/wsidicom | 4e9fb87f56766883397e31685a5e16c8f0941915 | [
"Apache-2.0"
] | 7 | 2021-11-30T08:33:19.000Z | 2022-03-15T13:46:01.000Z | wsidicom/__init__.py | imi-bigpicture/wsidicom | 4e9fb87f56766883397e31685a5e16c8f0941915 | [
"Apache-2.0"
] | 3 | 2021-12-15T14:39:15.000Z | 2022-03-24T15:33:08.000Z | wsidicom/__init__.py | imi-bigpicture/wsidicom | 4e9fb87f56766883397e31685a5e16c8f0941915 | [
"Apache-2.0"
] | 4 | 2022-02-04T09:57:49.000Z | 2022-02-14T08:13:13.000Z | # Copyright 2021 SECTRA AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 45.076923 | 78 | 0.661263 |
from .config import settings
from .graphical_annotations import (Annotation, AnnotationGroup,
AnnotationInstance, ConceptCode,
Measurement, Point, PointAnnotationGroup,
Polygon, PolygonAnnotationGroup, Polyline,... | true | true |
1c0852089ca67f0fc27fe717af5fd6551f9099df | 3,246 | py | Python | pmanagement/users/serializers/users.py | Ferald89/projectmanagemen | 88d96f2f59daca0029b69a60e69c0118dacc30ea | [
"MIT"
] | null | null | null | pmanagement/users/serializers/users.py | Ferald89/projectmanagemen | 88d96f2f59daca0029b69a60e69c0118dacc30ea | [
"MIT"
] | 2 | 2020-06-15T17:13:04.000Z | 2020-06-15T17:13:05.000Z | pmanagement/users/serializers/users.py | Ferald89/projectmanagemen | 88d96f2f59daca0029b69a60e69c0118dacc30ea | [
"MIT"
] | null | null | null | """User serializers. """
# Django
from django.contrib.auth import authenticate, password_validation
from django.core.validators import RegexValidator
# Django REST Framework
from rest_framework import serializers
from rest_framework.authtoken.models import Token
from rest_framework.validators import UniqueValidator
... | 31.211538 | 106 | 0.653112 |
from django.contrib.auth import authenticate, password_validation
from django.core.validators import RegexValidator
from rest_framework import serializers
from rest_framework.authtoken.models import Token
from rest_framework.validators import UniqueValidator
from pmanagement.users.models import User, Profile
from p... | true | true |
1c08534d654f711fa5daf38590a242072b669347 | 1,545 | py | Python | lib/file_crawler_file_process.py | corinnaerin/python-file-crawler | d38f4cb4e73abc657a6ce21c7cfa6c92731d71f4 | [
"MIT"
] | null | null | null | lib/file_crawler_file_process.py | corinnaerin/python-file-crawler | d38f4cb4e73abc657a6ce21c7cfa6c92731d71f4 | [
"MIT"
] | null | null | null | lib/file_crawler_file_process.py | corinnaerin/python-file-crawler | d38f4cb4e73abc657a6ce21c7cfa6c92731d71f4 | [
"MIT"
] | null | null | null | import errno
import logging
from re import MULTILINE
logger = logging.getLogger('file_crawler.' + __name__)
def file_worker(re, file_queue, results):
while True:
if not file_queue.empty():
file_path = file_queue.get()
_check_file(re, file_path, results)
file_queue.task... | 34.333333 | 116 | 0.633657 | import errno
import logging
from re import MULTILINE
logger = logging.getLogger('file_crawler.' + __name__)
def file_worker(re, file_queue, results):
while True:
if not file_queue.empty():
file_path = file_queue.get()
_check_file(re, file_path, results)
file_queue.task... | true | true |
1c0853f62fed95bb1a4bfa6fdef7fcd9d2b65a48 | 257 | py | Python | src/Lab.py | RobertTheBrucey/CurtinLabBot3 | 1932c4e7e66b5f135b40fd50bf9066bb20cc0800 | [
"MIT"
] | null | null | null | src/Lab.py | RobertTheBrucey/CurtinLabBot3 | 1932c4e7e66b5f135b40fd50bf9066bb20cc0800 | [
"MIT"
] | null | null | null | src/Lab.py | RobertTheBrucey/CurtinLabBot3 | 1932c4e7e66b5f135b40fd50bf9066bb20cc0800 | [
"MIT"
] | null | null | null | class Lab():
def __init__(self, host, users=-1, ip="0.0.0.0"):
self.host = host
self.hostname = host
self.users = users
self.ip = ip
self.load1min = -1.0
self.load5min = -1.0
self.load15min = -1.0 | 25.7 | 53 | 0.513619 | class Lab():
def __init__(self, host, users=-1, ip="0.0.0.0"):
self.host = host
self.hostname = host
self.users = users
self.ip = ip
self.load1min = -1.0
self.load5min = -1.0
self.load15min = -1.0 | true | true |
1c0854273146eac44f9b45d1da3441c62f82e79b | 1,507 | py | Python | watchmen/common/security/algorithm_service.py | Insurance-Metrics-Measure-Advisory/watchman-data-connector | 8ecab0c5b28174f1611e51deba8d94a42f53d51d | [
"MIT"
] | 125 | 2021-03-13T07:39:46.000Z | 2022-02-28T03:14:17.000Z | watchmen/common/security/algorithm_service.py | Insurance-Metrics-Measure-Advisory/watchman-data-connector | 8ecab0c5b28174f1611e51deba8d94a42f53d51d | [
"MIT"
] | null | null | null | watchmen/common/security/algorithm_service.py | Insurance-Metrics-Measure-Advisory/watchman-data-connector | 8ecab0c5b28174f1611e51deba8d94a42f53d51d | [
"MIT"
] | 17 | 2021-03-13T07:31:58.000Z | 2021-05-20T09:38:02.000Z | from watchmen.common.security.algorithm import algorithm_aes, algorithm_md5, algorithm_mask_mail, algorithm_mask_center, \
algorithm_date
AES256_PKCS5_PADDING = 'AES256-PKCS5-PADDING'
MD5 = 'MD5'
SHA256 = 'SHA256'
MASK_MAIL = 'MASK-MAIL'
MASK_CENTER_3 = 'MASK-CENTER-3'
MASK_CENTER_5 = 'MASK-CENTER-5'
MASK_LAST_3 =... | 35.880952 | 122 | 0.750498 | from watchmen.common.security.algorithm import algorithm_aes, algorithm_md5, algorithm_mask_mail, algorithm_mask_center, \
algorithm_date
AES256_PKCS5_PADDING = 'AES256-PKCS5-PADDING'
MD5 = 'MD5'
SHA256 = 'SHA256'
MASK_MAIL = 'MASK-MAIL'
MASK_CENTER_3 = 'MASK-CENTER-3'
MASK_CENTER_5 = 'MASK-CENTER-5'
MASK_LAST_3 =... | true | true |
1c0854b48dc80f4f517547193dd98eff32f3c83b | 608 | py | Python | circuit-python/hid-mouse.py | TrevorDArcyEvans/Pico-Play | 44fef9cc9bccaad768abb8c23ed3e19d533bb9db | [
"MIT"
] | null | null | null | circuit-python/hid-mouse.py | TrevorDArcyEvans/Pico-Play | 44fef9cc9bccaad768abb8c23ed3e19d533bb9db | [
"MIT"
] | null | null | null | circuit-python/hid-mouse.py | TrevorDArcyEvans/Pico-Play | 44fef9cc9bccaad768abb8c23ed3e19d533bb9db | [
"MIT"
] | null | null | null | # https://hridaybarot.home.blog/2021/01/31/using-raspberry-pi-pico-has-hid-device-to-control-mouse-and-keyboard/
#
# Download or clone this repo:
# https://github.com/adafruit/Adafruit_CircuitPython_HID
#
# In there, there is a folder called adafruit_hid ,
# copy that folder to the Pico where CircuitPython is already... | 28.952381 | 112 | 0.748355 |
import usb_hid
from adafruit_hid.mouse import Mouse
mouse = Mouse(usb_hid.devices)
# x pixels and y pixels.
# So if the current position is (100,200), it'll move to
x = 100
y = 100
mouse.move(x, y)
| true | true |
1c0854e0c320806139c18f6463f20395f7353f46 | 2,914 | py | Python | siamese_sts/siamese_net/siamese_lstm.py | shahrukhx01/siamese-nn-semantic-text-similarity | df15c4f1473f8ab3ff1dbfb1c4a888817c684ecd | [
"Apache-2.0"
] | 18 | 2021-12-31T02:26:43.000Z | 2022-03-16T14:04:07.000Z | siamese_sts/siamese_net/siamese_lstm.py | shahrukhx01/siamese-nn-semantic-text-similarity | df15c4f1473f8ab3ff1dbfb1c4a888817c684ecd | [
"Apache-2.0"
] | null | null | null | siamese_sts/siamese_net/siamese_lstm.py | shahrukhx01/siamese-nn-semantic-text-similarity | df15c4f1473f8ab3ff1dbfb1c4a888817c684ecd | [
"Apache-2.0"
] | 3 | 2021-12-31T09:50:03.000Z | 2022-01-01T23:05:35.000Z | import torch
import torch.nn as nn
from torch.autograd import Variable
from siamese_sts.utils.utils import similarity_score
"""
Wrapper class using Pytorch nn.Module to create the architecture for our
binary classification model
"""
class SiameseLSTM(nn.Module):
def __init__(
self,
batch_size: i... | 32.741573 | 86 | 0.636925 | import torch
import torch.nn as nn
from torch.autograd import Variable
from siamese_sts.utils.utils import similarity_score
class SiameseLSTM(nn.Module):
def __init__(
self,
batch_size: int,
output_size: int,
hidden_size: int,
vocab_size: int,
embedding_size: int,
... | true | true |
1c085790117e19711435c36d4b749e37470d3eb3 | 16,292 | py | Python | libs/dscache/odc/dscache/_jsoncache.py | robbibt/odc-tools | e2df2c9ef65dbd5652d97cd88617989b4b724814 | [
"Apache-2.0"
] | null | null | null | libs/dscache/odc/dscache/_jsoncache.py | robbibt/odc-tools | e2df2c9ef65dbd5652d97cd88617989b4b724814 | [
"Apache-2.0"
] | null | null | null | libs/dscache/odc/dscache/_jsoncache.py | robbibt/odc-tools | e2df2c9ef65dbd5652d97cd88617989b4b724814 | [
"Apache-2.0"
] | null | null | null | from uuid import UUID
import json
import lmdb
import zstandard
import operator
import functools
import itertools
import toolz
from types import SimpleNamespace
from pathlib import Path
FORMAT_VERSION = b'0001'
def key_to_bytes(k):
if isinstance(k, str):
return k.encode('utf8')
if isinstance(k, UUID):... | 29.729927 | 104 | 0.587835 | from uuid import UUID
import json
import lmdb
import zstandard
import operator
import functools
import itertools
import toolz
from types import SimpleNamespace
from pathlib import Path
FORMAT_VERSION = b'0001'
def key_to_bytes(k):
if isinstance(k, str):
return k.encode('utf8')
if isinstance(k, UUID):... | true | true |
1c08583a6a94e19efbb386b37c28962f964dcebb | 2,259 | py | Python | azure/durable_functions/models/Task.py | priyaananthasankar/azure-functions-durable-python-1 | 5494962583ff12794d3c856f098e0bded8d74069 | [
"MIT"
] | null | null | null | azure/durable_functions/models/Task.py | priyaananthasankar/azure-functions-durable-python-1 | 5494962583ff12794d3c856f098e0bded8d74069 | [
"MIT"
] | null | null | null | azure/durable_functions/models/Task.py | priyaananthasankar/azure-functions-durable-python-1 | 5494962583ff12794d3c856f098e0bded8d74069 | [
"MIT"
] | null | null | null | from datetime import datetime
from .actions.Action import Action
class Task:
"""Represents some pending action.
Similar to a native JavaScript promise in
that it acts as a placeholder for outstanding asynchronous work, but has
a synchronous implementation and is specific to Durable Functions.
T... | 29.337662 | 83 | 0.647632 | from datetime import datetime
from .actions.Action import Action
class Task:
def __init__(self, is_completed, is_faulted, action,
result=None, timestamp=None, id_=None, exc=None, is_played=False):
self._is_completed: bool = is_completed
self._is_faulted: bool = is_faulted
... | true | true |
1c0858942d088db1f0b467b49774c42e667d3f5f | 512 | py | Python | mechanicalsoup/utils.py | Cr7pt0nic/CP-BruteHammer | be6844d3639452706c3debeb0f71898003c5815b | [
"MIT"
] | null | null | null | mechanicalsoup/utils.py | Cr7pt0nic/CP-BruteHammer | be6844d3639452706c3debeb0f71898003c5815b | [
"MIT"
] | null | null | null | mechanicalsoup/utils.py | Cr7pt0nic/CP-BruteHammer | be6844d3639452706c3debeb0f71898003c5815b | [
"MIT"
] | null | null | null | class LinkNotFoundError(Exception):
"""Exception raised when mechanicalsoup fails to find something.
This happens in situations like (non-exhaustive list):
* :func:`~mechanicalsoup.StatefulBrowser.find_link` is called, but
no link is found.
* The browser was configured with raise_on_404=True and a 404
... | 30.117647 | 68 | 0.730469 | class LinkNotFoundError(Exception):
pass
| true | true |
1c085972799216b443b40a452387881c8673e28d | 336 | py | Python | tests/fixtures/python.py | SeanSobey/leasot | a572342f2dfc11def096a7051a1615aee0c714bd | [
"MIT"
] | 820 | 2015-01-09T23:26:59.000Z | 2022-03-25T04:35:37.000Z | tests/fixtures/python.py | SeanSobey/leasot | a572342f2dfc11def096a7051a1615aee0c714bd | [
"MIT"
] | 246 | 2015-01-09T23:32:23.000Z | 2022-03-31T11:08:51.000Z | tests/fixtures/python.py | SeanSobey/leasot | a572342f2dfc11def096a7051a1615aee0c714bd | [
"MIT"
] | 97 | 2015-01-09T23:27:08.000Z | 2022-03-17T22:21:27.000Z | #!/usr/bin/env python
import random
class Card(object)
# TODO: refactor this
def __init__(self, suit=0, rank=2):
self.suit = suit
self.rank = rank
def __cmp__(self, other):
"""FIXME: Move this out"""
t1 = self.suit, self.rank
t2 = other.suit, other.rank
ret... | 21 | 39 | 0.574405 |
import random
class Card(object)
def __init__(self, suit=0, rank=2):
self.suit = suit
self.rank = rank
def __cmp__(self, other):
"""FIXME: Move this out"""
t1 = self.suit, self.rank
t2 = other.suit, other.rank
return cmp(t1, t2)
| false | true |
1c085a43a430b55979459d250668d93f392b242b | 2,143 | py | Python | src/example/open_weather_map_call_actual_baar.py | cgasser/solar-data-sourcing | bfc6d22235ebc540c0976c88f6cdd55b3c1a3300 | [
"MIT"
] | 1 | 2017-12-08T09:28:34.000Z | 2017-12-08T09:28:34.000Z | src/example/open_weather_map_call_actual_baar.py | cgasser/solar-data-sourcing | bfc6d22235ebc540c0976c88f6cdd55b3c1a3300 | [
"MIT"
] | null | null | null | src/example/open_weather_map_call_actual_baar.py | cgasser/solar-data-sourcing | bfc6d22235ebc540c0976c88f6cdd55b3c1a3300 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
### lightweight open weather map api caller to test if this can be used to gatter data_weather
import http.client
import json
import time
import requests
import logging
import csv
import collections
import pandas as pd
def open_weather_call(zipId,appId,epoch_time):
conn = http.client.HTTPC... | 38.267857 | 130 | 0.667755 |
import http.client
import json
import time
import requests
import logging
import csv
import collections
import pandas as pd
def open_weather_call(zipId,appId,epoch_time):
conn = http.client.HTTPConnection("")
r = requests.get("http://api.openweathermap.org/data/2.5/weather?zip="+ str(zipId) +",ch" +"&appid="... | true | true |
1c085c429751470496346032142f793a67c94307 | 7,320 | py | Python | room_location/Living/models/net.py | realcrane/floorplan | 5eef5914dd3ca4f8e2a6a88f4c26283ee81da7a0 | [
"Unlicense"
] | 1 | 2022-03-07T09:19:34.000Z | 2022-03-07T09:19:34.000Z | room_location/Living/models/net.py | realcrane/floorplan | 5eef5914dd3ca4f8e2a6a88f4c26283ee81da7a0 | [
"Unlicense"
] | null | null | null | room_location/Living/models/net.py | realcrane/floorplan | 5eef5914dd3ca4f8e2a6a88f4c26283ee81da7a0 | [
"Unlicense"
] | null | null | null | from torch.nn import functional as F
import torchvision.models as models
from .basic import BasicModule
import torch.nn as nn
import numpy as np
import torch as t
import math
def get_upsampling_weight(input_channel, output_channel, kernel_size):
"""Make a 2D bilinear kernel suitable for upsampling"""
factor = ... | 35.533981 | 115 | 0.597404 | from torch.nn import functional as F
import torchvision.models as models
from .basic import BasicModule
import torch.nn as nn
import numpy as np
import torch as t
import math
def get_upsampling_weight(input_channel, output_channel, kernel_size):
factor = (kernel_size + 1) // 2
if kernel_size % 2 == 1:
... | true | true |
1c085dc79ab3756704d75dba6eae20bcb315286f | 10,801 | py | Python | hgdemandimport/demandimportpy2.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | hgdemandimport/demandimportpy2.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | hgdemandimport/demandimportpy2.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | # demandimport.py - global demand-loading of modules for Mercurial
#
# Copyright 2006, 2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''
demandimport - automatic demandloading of modules
To e... | 35.413115 | 80 | 0.562911 |
import builtins as builtins
import contextlib
import sys
contextmanager = contextlib.contextmanager
_origimport = __import__
nothing = object()
def _hgextimport(importfunc, name, globals, *args, **kwargs):
try:
return importfunc(name, globals, *args, **kwargs)
except ImportError:
if not ... | true | true |
1c085ef1827b87ce795c8574162721bd9632ebab | 10,935 | py | Python | src/djangoreactredux/djrenv/lib/python3.5/site-packages/git/refs/log.py | m2jobe/c_x | ba914449a9a85d82703895fc884733ca20454034 | [
"MIT"
] | null | null | null | src/djangoreactredux/djrenv/lib/python3.5/site-packages/git/refs/log.py | m2jobe/c_x | ba914449a9a85d82703895fc884733ca20454034 | [
"MIT"
] | 1 | 2018-04-04T12:13:40.000Z | 2018-05-03T07:57:52.000Z | src/djangoreactredux/djrenv/lib/python3.5/site-packages/git/refs/log.py | m2jobe/c_x | ba914449a9a85d82703895fc884733ca20454034 | [
"MIT"
] | null | null | null | import re
import time
from git.compat import (
PY3,
xrange,
string_types,
defenc
)
from git.objects.util import (
parse_date,
Serializable,
altz_to_utctz_str,
)
from git.util import (
Actor,
LockedFD,
LockFile,
assure_directory_exists,
to_native_path,
bin_to_hex,
... | 34.386792 | 107 | 0.587563 | import re
import time
from git.compat import (
PY3,
xrange,
string_types,
defenc
)
from git.objects.util import (
parse_date,
Serializable,
altz_to_utctz_str,
)
from git.util import (
Actor,
LockedFD,
LockFile,
assure_directory_exists,
to_native_path,
bin_to_hex,
... | true | true |
1c085f7b7d6558c55efc5cf56952df0cf0f13481 | 7,074 | py | Python | python/generator.py | ardavast/ps2serkbd | 66a4da685499ffa4e22a289e64970cf8ed4562bf | [
"MIT"
] | null | null | null | python/generator.py | ardavast/ps2serkbd | 66a4da685499ffa4e22a289e64970cf8ed4562bf | [
"MIT"
] | null | null | null | python/generator.py | ardavast/ps2serkbd | 66a4da685499ffa4e22a289e64970cf8ed4562bf | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import urllib.request
from pathlib import Path
from jinja2 import Environment, FileSystemLoader
LINUX_VERSION = 'v5.12'
BASE_URL = f'https://raw.githubusercontent.com/torvalds/linux/{LINUX_VERSION}'
BASEPATH = Path(__file__).parent.absolute()
TEMPLATES_DIR = BA... | 34.009615 | 101 | 0.429177 |
import re
import urllib.request
from pathlib import Path
from jinja2 import Environment, FileSystemLoader
LINUX_VERSION = 'v5.12'
BASE_URL = f'https://raw.githubusercontent.com/torvalds/linux/{LINUX_VERSION}'
BASEPATH = Path(__file__).parent.absolute()
TEMPLATES_DIR = BASEPATH.joinpath('templates')
SRC_DIR = BASEPATH... | true | true |
1c085febb797b9277c02182c409a1083fae2e832 | 28,948 | py | Python | asset/views.py | VanWade/spinach | 1da5fe554e1572729c92fc6b0f39a50e286e50d2 | [
"Apache-2.0"
] | null | null | null | asset/views.py | VanWade/spinach | 1da5fe554e1572729c92fc6b0f39a50e286e50d2 | [
"Apache-2.0"
] | null | null | null | asset/views.py | VanWade/spinach | 1da5fe554e1572729c92fc6b0f39a50e286e50d2 | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render, redirect, HttpResponse, get_object_or_404
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from asset.models import asset, system_users, performance, web_history, data_centers
from .form import AssetForm, SystemUserFo... | 42.321637 | 194 | 0.577829 | from django.shortcuts import render, redirect, HttpResponse, get_object_or_404
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from asset.models import asset, system_users, performance, web_history, data_centers
from .form import AssetForm, SystemUserFo... | true | true |
1c08603909e69c1bd65b60818089529f57f91567 | 2,973 | py | Python | tests/settings.py | MiHiR151203/openwisp-utils | 8b199b9d3a5e998fc52d1f3b4a99538ccb3f2920 | [
"BSD-3-Clause"
] | null | null | null | tests/settings.py | MiHiR151203/openwisp-utils | 8b199b9d3a5e998fc52d1f3b4a99538ccb3f2920 | [
"BSD-3-Clause"
] | null | null | null | tests/settings.py | MiHiR151203/openwisp-utils | 8b199b9d3a5e998fc52d1f3b4a99538ccb3f2920 | [
"BSD-3-Clause"
] | null | null | null | import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '@s8$swhj9du^aglt5+@ut^)wepr+un1m7r*+ixcq(-5i^st=y^'
DEBUG = True
ALLOWED_HOSTS = []
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.mess... | 28.586538 | 85 | 0.691221 | import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '@s8$swhj9du^aglt5+@ut^)wepr+un1m7r*+ixcq(-5i^st=y^'
DEBUG = True
ALLOWED_HOSTS = []
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.mess... | true | true |
1c0861a1b93afa813fc23445d9e3aa504a8202a5 | 3,291 | py | Python | learning_log/settings.py | Raynor-X/Web-Application | 78dfb638e15ff13606dc51541bc5c96d9fdd35aa | [
"MIT"
] | null | null | null | learning_log/settings.py | Raynor-X/Web-Application | 78dfb638e15ff13606dc51541bc5c96d9fdd35aa | [
"MIT"
] | null | null | null | learning_log/settings.py | Raynor-X/Web-Application | 78dfb638e15ff13606dc51541bc5c96d9fdd35aa | [
"MIT"
] | null | null | null | """
Django settings for learning_log project.
Generated by 'django-admin startproject' using Django 3.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from path... | 25.511628 | 91 | 0.700395 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-&e)$+6#(izvjxk&8wjo%d1vb5o=+6^$@3a6bs@gz3xrqeh(xpj'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.co... | true | true |
1c0861af3a36295ca059721797a4bb5e278ab698 | 35,682 | py | Python | nanotune/classification/classifier.py | Ayushparikh-code/nanotune | 6d63adc64c89aa38592cf732345d38f7c18f05e1 | [
"MIT"
] | 1 | 2021-07-03T11:58:52.000Z | 2021-07-03T11:58:52.000Z | nanotune/classification/classifier.py | Ayushparikh-code/nanotune | 6d63adc64c89aa38592cf732345d38f7c18f05e1 | [
"MIT"
] | null | null | null | nanotune/classification/classifier.py | Ayushparikh-code/nanotune | 6d63adc64c89aa38592cf732345d38f7c18f05e1 | [
"MIT"
] | null | null | null | import json
import logging
import os
import time
from typing import Any, Dict, List, Optional, Tuple, Union
import matplotlib.pyplot as plt
import numpy as np
from prettytable import PrettyTable
from scipy import interp
from sklearn import svm
from sklearn.calibration import calibration_curve
from sklearn.decompositio... | 36.373089 | 88 | 0.559414 | import json
import logging
import os
import time
from typing import Any, Dict, List, Optional, Tuple, Union
import matplotlib.pyplot as plt
import numpy as np
from prettytable import PrettyTable
from scipy import interp
from sklearn import svm
from sklearn.calibration import calibration_curve
from sklearn.decompositio... | true | true |
1c08620738c6cae96e96b33568c7c47283d05c64 | 498 | py | Python | profiles_api/urls.py | shnadman/profiles-rest-api | 0063b910dce543d67cd0c3726bc2e3dcd6aae061 | [
"MIT"
] | null | null | null | profiles_api/urls.py | shnadman/profiles-rest-api | 0063b910dce543d67cd0c3726bc2e3dcd6aae061 | [
"MIT"
] | 3 | 2020-06-06T01:52:30.000Z | 2022-02-10T11:25:24.000Z | profiles_api/urls.py | shnadman/profiles-rest-api | 0063b910dce543d67cd0c3726bc2e3dcd6aae061 | [
"MIT"
] | null | null | null | from django.urls import path, include
from profiles_api import views
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register('hello-viewset', views.HelloViewSet, base_name='hello-viewset')
router.register('profile', views.UserProfileViewSet)
router.register('feed', views.UserProfi... | 26.210526 | 79 | 0.763052 | from django.urls import path, include
from profiles_api import views
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register('hello-viewset', views.HelloViewSet, base_name='hello-viewset')
router.register('profile', views.UserProfileViewSet)
router.register('feed', views.UserProfi... | true | true |
1c0862836237161b1e4278ba179fd36ba88e9aab | 8,898 | py | Python | tests/test_http.py | ross/python-asynchttp | 07f589c8386f51c646a218e2110755529c8d27cc | [
"BSD-3-Clause"
] | 13 | 2016-01-02T01:18:00.000Z | 2021-03-01T06:28:52.000Z | tests/test_http.py | ross/python-asynchttp | 07f589c8386f51c646a218e2110755529c8d27cc | [
"BSD-3-Clause"
] | null | null | null | tests/test_http.py | ross/python-asynchttp | 07f589c8386f51c646a218e2110755529c8d27cc | [
"BSD-3-Clause"
] | 3 | 2016-03-14T06:57:31.000Z | 2018-11-28T14:35:29.000Z | #
#
#
from __future__ import absolute_import
from asynchttp import Http, _Worker
from datetime import datetime, timedelta
from mockito import inorder, mock, verify, when
from mockito.invocation import AnswerSelector, CompositeAnswer, Return
from random import randrange
from threading import Thread
from time import sl... | 32.713235 | 79 | 0.561699 |
from __future__ import absolute_import
from asynchttp import Http, _Worker
from datetime import datetime, timedelta
from mockito import inorder, mock, verify, when
from mockito.invocation import AnswerSelector, CompositeAnswer, Return
from random import randrange
from threading import Thread
from time import sleep
fr... | true | true |
1c0862b16252dcaa4402b32756a45d679aebfb48 | 17,602 | py | Python | python/ccxt/btcbox.py | m-tools-apps/ccxt | 05cdd7352e1f96ec6e20c17faf9e4ff8a7807210 | [
"MIT"
] | 2 | 2022-02-09T11:06:30.000Z | 2022-02-09T11:06:34.000Z | python/ccxt/btcbox.py | m-tools-apps/ccxt | 05cdd7352e1f96ec6e20c17faf9e4ff8a7807210 | [
"MIT"
] | 2 | 2022-01-30T22:41:43.000Z | 2022-01-30T22:41:55.000Z | python/ccxt/btcbox.py | m-tools-apps/ccxt | 05cdd7352e1f96ec6e20c17faf9e4ff8a7807210 | [
"MIT"
] | 1 | 2022-03-15T22:47:05.000Z | 2022-03-15T22:47:05.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.base.exchange import Exchange
# -----------------------------------------------------------------------------
try:
basestri... | 38.432314 | 200 | 0.504943 |
from ccxt.base.exchange import Exchange
try:
basestring except NameError:
basestring = str import json
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import InsufficientFunds
from ccxt.base.err... | true | true |
1c0862cd093ffb84cee0e520248c7a2e1324de9c | 11,094 | py | Python | maskrcnn_benchmark/structures/bounding_box.py | thunlp/VisualDS | 855b5e0904b9bd6a8d6c30e4ea9156c5967e1143 | [
"MIT"
] | 16 | 2021-08-18T02:51:02.000Z | 2022-03-19T12:43:27.000Z | maskrcnn_benchmark/structures/bounding_box.py | thunlp/VisualDS | 855b5e0904b9bd6a8d6c30e4ea9156c5967e1143 | [
"MIT"
] | 4 | 2021-09-23T11:04:57.000Z | 2022-02-21T01:57:30.000Z | maskrcnn_benchmark/structures/bounding_box.py | thunlp/VisualDS | 855b5e0904b9bd6a8d6c30e4ea9156c5967e1143 | [
"MIT"
] | 1 | 2022-01-15T08:38:00.000Z | 2022-01-15T08:38:00.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import torch
# transpose
FLIP_LEFT_RIGHT = 0
FLIP_TOP_BOTTOM = 1
class BoxList(object):
"""
This class represents a set of bounding boxes.
The bounding boxes are represented as a Nx4 Tensor.
In order to uniquely determine the bou... | 37.47973 | 160 | 0.563548 | import torch
FLIP_LEFT_RIGHT = 0
FLIP_TOP_BOTTOM = 1
class BoxList(object):
def __init__(self, bbox, image_size, mode="xyxy"):
device = bbox.device if isinstance(bbox, torch.Tensor) else torch.device("cpu")
bbox = torch.as_tensor(bbox, dtype=torch.float32, device=device)
if bbox.ndimensi... | true | true |
1c08652dd48554a77c7ee05b229b9af3028520a7 | 1,789 | py | Python | main.py | christian-5-28/Monocular-image-depth-estimation | e31175afd34dc71d7a9f7769206d36aae0dcedd7 | [
"MIT"
] | 2 | 2018-10-25T09:07:26.000Z | 2018-12-21T07:55:38.000Z | main.py | christian-5-28/Monocular-image-depth-estimation | e31175afd34dc71d7a9f7769206d36aae0dcedd7 | [
"MIT"
] | null | null | null | main.py | christian-5-28/Monocular-image-depth-estimation | e31175afd34dc71d7a9f7769206d36aae0dcedd7 | [
"MIT"
] | null | null | null | import sys
import os
os.chdir(os.getcwd())
print(os.getcwd())
from models.DepthModel import DepthModel
from models.DS_net import DsNet
from models.depthModel_regularized import *
from models.trainer import Trainer
from utils.configuration import get_config
from utils.utils import prepare_dirs
from utils.dataset impor... | 26.701493 | 81 | 0.688094 | import sys
import os
os.chdir(os.getcwd())
print(os.getcwd())
from models.DepthModel import DepthModel
from models.DS_net import DsNet
from models.depthModel_regularized import *
from models.trainer import Trainer
from utils.configuration import get_config
from utils.utils import prepare_dirs
from utils.dataset impor... | true | true |
1c086532843fecd1d8ec55a2a4629430dd5edc3b | 37 | py | Python | tests/zest/modeling/test_utils.py | allenai/zest | 8a9658a0e9c8180a5465f161e4ed7b64b4b077c9 | [
"Apache-2.0"
] | 13 | 2020-11-17T03:04:29.000Z | 2021-11-08T08:47:40.000Z | tests/zest/modeling/test_utils.py | allenai/zest | 8a9658a0e9c8180a5465f161e4ed7b64b4b077c9 | [
"Apache-2.0"
] | 2 | 2021-03-03T10:38:07.000Z | 2021-03-15T19:11:51.000Z | tests/zest/modeling/test_utils.py | allenai/zest | 8a9658a0e9c8180a5465f161e4ed7b64b4b077c9 | [
"Apache-2.0"
] | 2 | 2021-02-13T22:48:03.000Z | 2021-10-18T19:52:44.000Z | """Tests for zest.modeling.utils."""
| 18.5 | 36 | 0.675676 | true | true | |
1c0867aac50e7a3b6ecb6f16f2280f8ec3ff3f5e | 10,315 | py | Python | opentaxii/utils.py | zentavr/OpenTAXII | 12acdfe3c3672ef603ab3e322cb152307aa2d00f | [
"BSD-Source-Code"
] | 1 | 2022-03-24T09:47:26.000Z | 2022-03-24T09:47:26.000Z | opentaxii/utils.py | zentavr/OpenTAXII | 12acdfe3c3672ef603ab3e322cb152307aa2d00f | [
"BSD-Source-Code"
] | 1 | 2019-04-12T08:48:38.000Z | 2019-04-12T08:48:38.000Z | opentaxii/utils.py | zentavr/OpenTAXII | 12acdfe3c3672ef603ab3e322cb152307aa2d00f | [
"BSD-Source-Code"
] | null | null | null | import sys
import logging
import structlog
import importlib
import base64
import binascii
from six.moves import urllib
from .entities import Account
from .taxii.entities import (
CollectionEntity, deserialize_content_bindings)
from .taxii.converters import dict_to_service_entity
from .exceptions import InvalidAut... | 33.167203 | 78 | 0.644014 | import sys
import logging
import structlog
import importlib
import base64
import binascii
from six.moves import urllib
from .entities import Account
from .taxii.entities import (
CollectionEntity, deserialize_content_bindings)
from .taxii.converters import dict_to_service_entity
from .exceptions import InvalidAut... | true | true |
1c0867bbab312011670ce1eefc49a15527c67474 | 13,737 | py | Python | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2021_05_01_preview/aio/operations/_diagnostic_settings_operations.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2021_05_01_preview/aio/operations/_diagnostic_settings_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2021_05_01_preview/aio/operations/_diagnostic_settings_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 47.044521 | 146 | 0.665939 | from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline ... | true | true |
1c0868e31104a67fcd2b5ad5e9cc686af5dac45e | 4,070 | py | Python | hiback/hiback.py | Kuro-Rui/Honkertonken-Cogs | eaad1c5be1b3f71a0da25af559edbf8d77b6c21d | [
"MIT"
] | 2 | 2022-01-07T04:21:09.000Z | 2022-01-26T22:41:26.000Z | hiback/hiback.py | Kuro-Rui/Honkertonken-Cogs | eaad1c5be1b3f71a0da25af559edbf8d77b6c21d | [
"MIT"
] | 10 | 2022-01-07T04:33:33.000Z | 2022-03-29T11:54:55.000Z | hiback/hiback.py | Honkertonken/Cogs-V3 | 1f4ad84475c43bb6e98b29afa59e534dbffb60e3 | [
"MIT"
] | 1 | 2022-01-28T02:35:17.000Z | 2022-01-28T02:35:17.000Z | import re
import discord
from redbot.core import commands
from redbot.core.config import Config
search = re.compile(
(r"(?<![a-z])i'?m ([^\.\?\!,\n\r]+)"),
flags=re.I,
)
class HiBack(commands.Cog):
"""
Replies to "I'm X" with "Hi, X".
"""
def __init__(self, bot):
self.bot = bot
... | 32.56 | 92 | 0.564865 | import re
import discord
from redbot.core import commands
from redbot.core.config import Config
search = re.compile(
(r"(?<![a-z])i'?m ([^\.\?\!,\n\r]+)"),
flags=re.I,
)
class HiBack(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.config = Config.get_conf(
self,
... | true | true |
1c086a23357bf399539dae88084f10a46449fbd8 | 950 | py | Python | src/sciview/render.py | sciview/sciview | 71a2c4d7445e75bbaa3276dfbb413b2671a1b463 | [
"MIT"
] | null | null | null | src/sciview/render.py | sciview/sciview | 71a2c4d7445e75bbaa3276dfbb413b2671a1b463 | [
"MIT"
] | null | null | null | src/sciview/render.py | sciview/sciview | 71a2c4d7445e75bbaa3276dfbb413b2671a1b463 | [
"MIT"
] | null | null | null | # SPDX-License-Identifier: GPL-3.0-or-later
# Copyright (c) 2020 Scipp contributors (https://github.com/scipp)
# @author Neil Vaytet
from . import config
import pythreejs as p3
def render(objects=None, camera=None, background="#DDDDDD", enableRotate=True,
width=0, height=0):
if isinstance(objects, l... | 32.758621 | 80 | 0.595789 |
from . import config
import pythreejs as p3
def render(objects=None, camera=None, background="#DDDDDD", enableRotate=True,
width=0, height=0):
if isinstance(objects, list):
children = objects + [camera]
else:
try:
_ = iter(objects)
children = list(objects)... | true | true |
1c086b10b3530e784d60d5861716f3882726c9e6 | 3,616 | py | Python | silx/image/_boundingbox.py | physwkim/silx | e3f39babad34c97db8ec5dfbb8e92287ce059f70 | [
"CC0-1.0",
"MIT"
] | 94 | 2016-03-04T17:25:53.000Z | 2022-03-18T18:05:23.000Z | silx/image/_boundingbox.py | physwkim/silx | e3f39babad34c97db8ec5dfbb8e92287ce059f70 | [
"CC0-1.0",
"MIT"
] | 2,841 | 2016-01-21T09:06:49.000Z | 2022-03-18T14:53:56.000Z | silx/image/_boundingbox.py | physwkim/silx | e3f39babad34c97db8ec5dfbb8e92287ce059f70 | [
"CC0-1.0",
"MIT"
] | 71 | 2015-09-30T08:35:35.000Z | 2022-03-16T07:16:28.000Z | # coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2018 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
#... | 35.80198 | 84 | 0.605088 |
__authors__ = ["H. Payno"]
__license__ = "MIT"
__date__ = "07/09/2019"
from silx.math.combo import min_max
import numpy
class _BoundingBox:
def __init__(self, bottom_left, top_right):
self.bottom_left = bottom_left
self.top_right = top_right
self.min_x = bottom_left[1]
self.min_y... | true | true |
1c086b6a40a19334e8c39539c3b04a5bd69b439d | 416 | py | Python | apps/events/migrations/0024_auto_20191010_2259.py | Nicolaad/onlineweb4 | 5942eaf907d6824d5384147627def9edefdb9946 | [
"MIT"
] | null | null | null | apps/events/migrations/0024_auto_20191010_2259.py | Nicolaad/onlineweb4 | 5942eaf907d6824d5384147627def9edefdb9946 | [
"MIT"
] | null | null | null | apps/events/migrations/0024_auto_20191010_2259.py | Nicolaad/onlineweb4 | 5942eaf907d6824d5384147627def9edefdb9946 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.11 on 2019-10-10 20:59
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('companyprofile', '0006_auto_20190506_1719'),
('events', '0023_auto_20190903_1411'),
]
operations = [
migrations.AlterUniqueTogether(
... | 21.894737 | 54 | 0.615385 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('companyprofile', '0006_auto_20190506_1719'),
('events', '0023_auto_20190903_1411'),
]
operations = [
migrations.AlterUniqueTogether(
name='companyevent',
unique_tog... | true | true |
1c086ca4acd8a9e707d629d0da2c53b6b96e229e | 1,407 | py | Python | get-attachments.py | neumanntamar/science-fair-site | d8a5e1d62a76911d2d5b918cb31e5094528e7813 | [
"MIT"
] | null | null | null | get-attachments.py | neumanntamar/science-fair-site | d8a5e1d62a76911d2d5b918cb31e5094528e7813 | [
"MIT"
] | null | null | null | get-attachments.py | neumanntamar/science-fair-site | d8a5e1d62a76911d2d5b918cb31e5094528e7813 | [
"MIT"
] | null | null | null | import mailparser
import eml_parser
import json
import ast
import pickle
import shutil
emlFilePath = 'submissions/Test Submission.eml'
attachmentsFilePath = 'attachments'
with open(emlFilePath, 'rb') as fhdl:
raw_email = fhdl.read()
parsed_eml = eml_parser.eml_parser.decode_email_b(raw_email, include_raw_body=Tr... | 37.026316 | 105 | 0.746269 | import mailparser
import eml_parser
import json
import ast
import pickle
import shutil
emlFilePath = 'submissions/Test Submission.eml'
attachmentsFilePath = 'attachments'
with open(emlFilePath, 'rb') as fhdl:
raw_email = fhdl.read()
parsed_eml = eml_parser.eml_parser.decode_email_b(raw_email, include_raw_body=Tr... | true | true |
1c086d2a0356a64bbffb268f1344090845fdb11e | 1,038 | py | Python | SBI/loan/forms.py | RoshaMahalle/sbi | 55e7887c880ab048499cf6a73604fd7df15d0180 | [
"MIT"
] | null | null | null | SBI/loan/forms.py | RoshaMahalle/sbi | 55e7887c880ab048499cf6a73604fd7df15d0180 | [
"MIT"
] | null | null | null | SBI/loan/forms.py | RoshaMahalle/sbi | 55e7887c880ab048499cf6a73604fd7df15d0180 | [
"MIT"
] | null | null | null | from django import forms
from .models import LoanApplication
from django.contrib.auth.models import User
class LoanApplicationForm(forms.ModelForm):
class Meta:
model = LoanApplication
fields ="__all__"
def clean_income(self):
inputincome = self.cleaned_data['income']
if inputinc... | 31.454545 | 88 | 0.659923 | from django import forms
from .models import LoanApplication
from django.contrib.auth.models import User
class LoanApplicationForm(forms.ModelForm):
class Meta:
model = LoanApplication
fields ="__all__"
def clean_income(self):
inputincome = self.cleaned_data['income']
if inputinc... | true | true |
1c08726f5cfe28d244efc0fd817c3d04231f19af | 11,963 | py | Python | code/python/TimeSeriesAPIforDigitalPortals/v2/fds/sdk/TimeSeriesAPIforDigitalPortals/model/cursor_based_pagination_output_object_without_total.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 6 | 2022-02-07T16:34:18.000Z | 2022-03-30T08:04:57.000Z | code/python/TimeSeriesAPIforDigitalPortals/v2/fds/sdk/TimeSeriesAPIforDigitalPortals/model/cursor_based_pagination_output_object_without_total.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 2 | 2022-02-07T05:25:57.000Z | 2022-03-07T14:18:04.000Z | code/python/TimeSeriesAPIforDigitalPortals/v2/fds/sdk/TimeSeriesAPIforDigitalPortals/model/cursor_based_pagination_output_object_without_total.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | null | null | null | """
Prime Developer Trial
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from fds.sdk.T... | 44.63806 | 153 | 0.581627 |
import re import sys
from fds.sdk.TimeSeriesAPIforDigitalPortals.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get... | true | true |
1c0872c69085a332d8bd41e725fac8d8d8d13276 | 482 | py | Python | cride/circles/admin.py | Audio10/Comparte-crite | e3500373ccb59a46aaad57b4549bcdcfd73cb19c | [
"MIT"
] | null | null | null | cride/circles/admin.py | Audio10/Comparte-crite | e3500373ccb59a46aaad57b4549bcdcfd73cb19c | [
"MIT"
] | 7 | 2020-06-05T23:41:37.000Z | 2022-03-12T00:02:07.000Z | cride/circles/admin.py | thmxluis/cride-app | 28b298f53aa937cf197a27a8f34ea826b660a4c7 | [
"MIT"
] | null | null | null | """Circles admin."""
# Django
from django.contrib import admin
# Model
from cride.circles.models import Circle
@admin.register(Circle)
class CircleAdmin(admin.ModelAdmin):
"""Circle admin."""
list_display = (
'slug_name',
'name',
'is_public',
'verified',
'is_limited'... | 17.214286 | 41 | 0.570539 |
from django.contrib import admin
from cride.circles.models import Circle
@admin.register(Circle)
class CircleAdmin(admin.ModelAdmin):
list_display = (
'slug_name',
'name',
'is_public',
'verified',
'is_limited',
'members_limit'
)
search_fields = ('slug_nam... | true | true |
1c0873dfaee5cf3dc8bb225405c53c6251768004 | 1,630 | py | Python | internal/notes/builtin-SAVE/packages/r-modeltools/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | 1 | 2019-01-17T20:07:19.000Z | 2019-01-17T20:07:19.000Z | internal/notes/builtin-SAVE/packages/r-modeltools/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | null | null | null | internal/notes/builtin-SAVE/packages/r-modeltools/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | 2 | 2019-08-06T18:13:57.000Z | 2021-11-05T18:19:49.000Z | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | 45.277778 | 80 | 0.680982 | from spack import *
class RModeltools(RPackage):
homepage = "https://cran.r-project.org/package=modeltools"
url = "https://cran.r-project.org/src/contrib/modeltools_0.2-21.tar.gz"
list_url = "https://cran.r-project.org/src/contrib/Archive/modeltools"
version('0.2-21', '3bf56b2e7bf78981444385d87... | true | true |
1c087414183cdc56bfb715c8b46701a71b5075ed | 3,612 | py | Python | Linear Regression and Scenario Generation/code/Linear Regression.py | ehgh/COVID-19-case-estimation-and-policy-effects | afc2001a0f29caf1e6e0ae9311983752ac7efff8 | [
"MIT"
] | 3 | 2020-06-04T23:56:08.000Z | 2020-07-25T11:34:59.000Z | Linear Regression and Scenario Generation/code/Linear Regression.py | ehgh/COVID-19-case-estimation-and-policy-effects | afc2001a0f29caf1e6e0ae9311983752ac7efff8 | [
"MIT"
] | null | null | null | Linear Regression and Scenario Generation/code/Linear Regression.py | ehgh/COVID-19-case-estimation-and-policy-effects | afc2001a0f29caf1e6e0ae9311983752ac7efff8 | [
"MIT"
] | 1 | 2020-12-21T12:50:09.000Z | 2020-12-21T12:50:09.000Z | # policy contains the information on which day the policy was introduced
# policy_lift contains information on which day the policy was relaxed
# 1000: the policy was not introduced (relaxed) in according to the file (policy/ policy_lift)
# we use data from February 18, 2020 to May 7, 2020 to estimate the coefficien... | 38.021053 | 131 | 0.599668 |
import pandas as pd
import numpy as np
from sklearn.linear_model import Lasso
from sklearn.model_selection import train_test_split
import scipy
from scipy.stats import iqr
def RegressionModels():
policy = pd.read_csv("./policy.csv")
policy_lift = pd.read_csv("./policy_lift.csv")
popu... | true | true |
1c0874ebe5c06da2934fe4c455805ddd90e16830 | 2,873 | py | Python | vendor/google_riscv-dv/scripts/ovpsim_log_to_trace_csv.py | rhthomas/ibex | 54fac2954a679339f4c9283c052123dd17fc5352 | [
"Apache-2.0"
] | null | null | null | vendor/google_riscv-dv/scripts/ovpsim_log_to_trace_csv.py | rhthomas/ibex | 54fac2954a679339f4c9283c052123dd17fc5352 | [
"Apache-2.0"
] | null | null | null | vendor/google_riscv-dv/scripts/ovpsim_log_to_trace_csv.py | rhthomas/ibex | 54fac2954a679339f4c9283c052123dd17fc5352 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2019 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
di... | 33.406977 | 81 | 0.658197 | import re
import os
import argparse
from riscv_trace_csv import *
def process_ovpsim_sim_log(ovpsim_log, csv):
print("Processing ovpsim log : %s" % ovpsim_log)
instr_cnt = 0
trace_instr = ""
trace_bin = ""
trace_addr = ""
cmd = ("sed -i '/Info 1:/,$!d' %s" % ovpsim_log)
os.system(cmd)
cmd = ("sed... | true | true |
1c08754c7a7d9b80fca7bd88d40d8c830360ba9b | 9,695 | py | Python | tools/sot_siamrpn_param_search.py | dzambrano/mmtracking | ec7a2e36fbf99effed4602a4df929f495efe73c5 | [
"Apache-2.0"
] | 1 | 2022-01-30T11:39:15.000Z | 2022-01-30T11:39:15.000Z | tools/sot_siamrpn_param_search.py | dzambrano/mmtracking | ec7a2e36fbf99effed4602a4df929f495efe73c5 | [
"Apache-2.0"
] | null | null | null | tools/sot_siamrpn_param_search.py | dzambrano/mmtracking | ec7a2e36fbf99effed4602a4df929f495efe73c5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
import argparse
import os
import numpy as np
import torch
from mmcv import Config, DictAction, get_logger, print_log
from mmcv.cnn import fuse_conv_bn
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmcv.runner import (get_dist_info, init_dist, l... | 38.625498 | 81 | 0.582053 | import argparse
import os
import numpy as np
import torch
from mmcv import Config, DictAction, get_logger, print_log
from mmcv.cnn import fuse_conv_bn
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmcv.runner import (get_dist_info, init_dist, load_checkpoint,
wrap_fp... | true | true |
1c0876ba07fb9fcd777e979e6d7f76bcf53842d8 | 5,349 | py | Python | pysnmp/ChrComPmSonetSNT-LFE-Current-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/ChrComPmSonetSNT-LFE-Current-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/ChrComPmSonetSNT-LFE-Current-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module ChrComPmSonetSNT-LFE-Current-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ChrComPmSonetSNT-LFE-Current-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:20:32 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Pyt... | 127.357143 | 688 | 0.795289 | Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint = mibBuilder.impo... | true | true |
1c0876cd7911e1ca298324fea10791052bcd2698 | 8,553 | py | Python | homeassistant/generated/ssdp.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 3 | 2021-11-22T22:37:43.000Z | 2022-03-17T00:55:28.000Z | homeassistant/generated/ssdp.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 25 | 2021-10-02T10:01:14.000Z | 2022-03-31T06:11:49.000Z | homeassistant/generated/ssdp.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 1 | 2021-12-10T10:33:28.000Z | 2021-12-10T10:33:28.000Z | """Automatically generated by hassfest.
To update, run python3 -m script.hassfest
"""
# fmt: off
SSDP = {
"arcam_fmj": [
{
"deviceType": "urn:schemas-upnp-org:device:MediaRenderer:1",
"manufacturer": "ARCAM"
}
],
"axis": [
{
"manufacturer": "AXI... | 26.64486 | 80 | 0.473869 |
SSDP = {
"arcam_fmj": [
{
"deviceType": "urn:schemas-upnp-org:device:MediaRenderer:1",
"manufacturer": "ARCAM"
}
],
"axis": [
{
"manufacturer": "AXIS"
}
],
"control4": [
{
"st": "c4:director"
}
],
... | true | true |
1c0877cd6ee17b0fb93fe1d8116a0a9f0f248d8f | 1,464 | py | Python | aligns.py | manideep2510/Lipreading-Keras | d5b41a62599a68e6506cbf8d25779f770505f6b7 | [
"Apache-2.0"
] | 6 | 2020-05-17T12:07:16.000Z | 2021-03-24T16:29:55.000Z | aligns.py | manideep2510/Lipreading-Keras | d5b41a62599a68e6506cbf8d25779f770505f6b7 | [
"Apache-2.0"
] | 12 | 2020-02-24T18:49:45.000Z | 2022-03-12T00:17:08.000Z | aligns.py | manideep2510/Lipreading-Keras | d5b41a62599a68e6506cbf8d25779f770505f6b7 | [
"Apache-2.0"
] | 3 | 2020-04-25T18:03:17.000Z | 2020-10-30T11:03:34.000Z | import numpy as np
class Align(object):
def __init__(self, absolute_max_string_len=128, label_func=None):
self.label_func = label_func
self.absolute_max_string_len = absolute_max_string_len
def from_file(self, path):
with open(path, 'r') as f:
lines = f.readlines()
... | 29.877551 | 111 | 0.623634 | import numpy as np
class Align(object):
def __init__(self, absolute_max_string_len=128, label_func=None):
self.label_func = label_func
self.absolute_max_string_len = absolute_max_string_len
def from_file(self, path):
with open(path, 'r') as f:
lines = f.readlines()
... | true | true |
1c08798e48de6da72fa24e6f3f36347e6a0a97c3 | 760 | py | Python | tests/test_cli.py | styczynski/octosql.py | 2180f28d7e8bf11ca09244b730dbf0bac9751649 | [
"MIT"
] | 2 | 2019-10-27T17:54:21.000Z | 2019-10-27T22:42:55.000Z | tests/test_cli.py | styczynski/octosql.py | 2180f28d7e8bf11ca09244b730dbf0bac9751649 | [
"MIT"
] | 1 | 2021-08-16T00:40:18.000Z | 2021-08-16T00:40:18.000Z | tests/test_cli.py | styczynski/octosql.py | 2180f28d7e8bf11ca09244b730dbf0bac9751649 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `octosql_py` package."""
import pytest
from click.testing import CliRunner
from octosql_py import octosql_py
from octosql_py import cli
from octosql_py.core.storage.json import OctoSQLSourceJSON
@pytest.fixture
def response():
"""Sample pytest fixture.... | 25.333333 | 70 | 0.705263 |
import pytest
from click.testing import CliRunner
from octosql_py import octosql_py
from octosql_py import cli
from octosql_py.core.storage.json import OctoSQLSourceJSON
@pytest.fixture
def response():
def test_command_line_interface():
runner = CliRunner()
result = runner.invoke(cli.main)
assert resu... | true | true |
1c087a5088be21aedd7f1f99b1b5aec3823379be | 155 | py | Python | Hackerrank/Subarray Division/Subarray Divison.py | rahil-1407/Data-Structure-and-Algorithms | ea3eb9849aeb2716ef5812a0b5621a28120b1880 | [
"MIT"
] | 51 | 2021-01-14T04:05:55.000Z | 2022-01-25T11:25:37.000Z | Hackerrank/Subarray Division/Subarray Divison.py | rahil-1407/Data-Structure-and-Algorithms | ea3eb9849aeb2716ef5812a0b5621a28120b1880 | [
"MIT"
] | 638 | 2020-12-27T18:49:53.000Z | 2021-11-21T05:22:52.000Z | Hackerrank/Subarray Division/Subarray Divison.py | rahil-1407/Data-Structure-and-Algorithms | ea3eb9849aeb2716ef5812a0b5621a28120b1880 | [
"MIT"
] | 124 | 2021-01-30T06:40:20.000Z | 2021-11-21T15:14:40.000Z | def getWays(squares, d, m):
tp = (len(squares)-m) + 1 #total number of pieces possible
return len([1 for i in range(tp) if sum(squares[i:i+m])==d]) | 51.666667 | 64 | 0.63871 | def getWays(squares, d, m):
tp = (len(squares)-m) + 1 return len([1 for i in range(tp) if sum(squares[i:i+m])==d]) | true | true |
1c087ac6a4407be9709408bc0e364a4f848f335f | 2,035 | py | Python | website/api/serializers.py | chitholian/CSE-616-Semester-Form-Fillup-System | 73e7611b10ac34ce7934fdb111520ff12858de2c | [
"Apache-2.0"
] | 2 | 2019-02-12T14:21:34.000Z | 2020-02-04T18:15:09.000Z | website/api/serializers.py | Muhtadir/CSE-616-Semester-Form-Fillup-System | 73e7611b10ac34ce7934fdb111520ff12858de2c | [
"Apache-2.0"
] | null | null | null | website/api/serializers.py | Muhtadir/CSE-616-Semester-Form-Fillup-System | 73e7611b10ac34ce7934fdb111520ff12858de2c | [
"Apache-2.0"
] | 1 | 2019-09-25T07:44:15.000Z | 2019-09-25T07:44:15.000Z | from rest_framework import serializers
from .models import *
class AdminUserSerializer(serializers.ModelSerializer):
class Meta:
model = AdminUser
fields = '__all__'
# fields = ('user', 'type')
class HallSerializer(serializers.ModelSerializer):
class Meta:
model = Hall
... | 25.123457 | 76 | 0.667813 | from rest_framework import serializers
from .models import *
class AdminUserSerializer(serializers.ModelSerializer):
class Meta:
model = AdminUser
fields = '__all__'
class HallSerializer(serializers.ModelSerializer):
class Meta:
model = Hall
fields = ('id', 'n... | true | true |
1c087bb9acdec022f58b097db85c281a4fb43208 | 2,972 | py | Python | torch_mlu/csrc/test/cnnl/gen_module.py | Cambricon/catch | 2625da389f25a67066d20fb6b0c38250ef98f8ab | [
"BSD-2-Clause"
] | 20 | 2022-03-01T11:40:51.000Z | 2022-03-30T08:17:47.000Z | torch_mlu/csrc/test/cnnl/gen_module.py | Cambricon/catch | 2625da389f25a67066d20fb6b0c38250ef98f8ab | [
"BSD-2-Clause"
] | null | null | null | torch_mlu/csrc/test/cnnl/gen_module.py | Cambricon/catch | 2625da389f25a67066d20fb6b0c38250ef98f8ab | [
"BSD-2-Clause"
] | null | null | null | import torch
from torch import nn, Tensor
import torch.nn.functional as F
class BasicConv2d(nn.Module):
def __init__(self, in_channels, out_channels, flag_bias, **kwargs):
super(BasicConv2d, self).__init__()
self.conv = nn.Conv2d(in_channels, out_channels, bias=flag_bias, **kwargs)
self.bn ... | 33.772727 | 86 | 0.675639 | import torch
from torch import nn, Tensor
import torch.nn.functional as F
class BasicConv2d(nn.Module):
def __init__(self, in_channels, out_channels, flag_bias, **kwargs):
super(BasicConv2d, self).__init__()
self.conv = nn.Conv2d(in_channels, out_channels, bias=flag_bias, **kwargs)
self.bn ... | true | true |
1c087c0bad5fa2b84b302fa195c9af5aa62da2b8 | 211 | py | Python | maxprod.py | malai001/codebank | 6834107ab683a38a8799102278369a66b1c1b336 | [
"bzip2-1.0.6"
] | 1 | 2017-07-11T05:02:12.000Z | 2017-07-11T05:02:12.000Z | maxprod.py | malai001/codebank | 6834107ab683a38a8799102278369a66b1c1b336 | [
"bzip2-1.0.6"
] | null | null | null | maxprod.py | malai001/codebank | 6834107ab683a38a8799102278369a66b1c1b336 | [
"bzip2-1.0.6"
] | null | null | null | #code
t = input()
while(t>0):
a=[]
temp = []
n = input()
a = raw_input().split(' ')
for i in range(0,n):
a[i] = int(a[i])
a.sort()
print (a[n-1]*a[n-2])
t -= 1 | 17.583333 | 31 | 0.383886 | t = input()
while(t>0):
a=[]
temp = []
n = input()
a = raw_input().split(' ')
for i in range(0,n):
a[i] = int(a[i])
a.sort()
print (a[n-1]*a[n-2])
t -= 1 | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.