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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f774ed4b2e1cb8beabee36a5e4532856bb904502 | 1,517 | py | Python | flipper/kernel/error.py | MarkCBell/flipper | 66965f89e9754c3c340932f657b4c99261c1cd18 | [
"MIT"
] | 3 | 2019-11-06T18:15:27.000Z | 2020-08-05T21:53:03.000Z | flipper/kernel/error.py | MarkCBell/flipper | 66965f89e9754c3c340932f657b4c99261c1cd18 | [
"MIT"
] | 6 | 2019-06-23T13:14:51.000Z | 2022-02-15T04:07:51.000Z | flipper/kernel/error.py | MarkCBell/flipper | 66965f89e9754c3c340932f657b4c99261c1cd18 | [
"MIT"
] | 2 | 2019-12-17T23:34:41.000Z | 2020-06-16T18:09:55.000Z |
''' A module for the various different errors that can be raised. '''
class AbortError(Exception):
''' An exception for aborting computations with.
This is thrown by clicking 'cancel' on a progress box. '''
def __init__(self, message=None):
super().__init__()
self.message = messa... | 28.622642 | 88 | 0.649308 |
class AbortError(Exception):
def __init__(self, message=None):
super().__init__()
self.message = message
def __str__(self):
return str(self.message)
class ComputationError(Exception):
def __init__(self, message=None):
super().__init__()
self.message = mes... | true | true |
f774ee151b742bbee1add640e3136c94478d1ea5 | 8,688 | py | Python | tools.py | tjake/cassandra-dtest | df49e4f16b2ed8b9c38f767fffd796ae3d9cc6f3 | [
"Apache-2.0"
] | null | null | null | tools.py | tjake/cassandra-dtest | df49e4f16b2ed8b9c38f767fffd796ae3d9cc6f3 | [
"Apache-2.0"
] | null | null | null | tools.py | tjake/cassandra-dtest | df49e4f16b2ed8b9c38f767fffd796ae3d9cc6f3 | [
"Apache-2.0"
] | null | null | null | from ccmlib.node import Node
from decorator import decorator
from distutils.version import LooseVersion
from threading import Thread
import re, os, sys, fileinput, time, unittest, functools
from cassandra import ConsistencyLevel
from cassandra.query import SimpleStatement
from dtest import Tester, DISABLE_VNODES
de... | 39.671233 | 177 | 0.633172 | from ccmlib.node import Node
from decorator import decorator
from distutils.version import LooseVersion
from threading import Thread
import re, os, sys, fileinput, time, unittest, functools
from cassandra import ConsistencyLevel
from cassandra.query import SimpleStatement
from dtest import Tester, DISABLE_VNODES
de... | true | true |
f774eed464d7632cb52c00823a981d10908684ca | 14,938 | py | Python | skimage/restoration/deconvolution.py | thewtex/scikit-image | 22bb6b94698b8889cbdf26b25d9e4fdb8b968d97 | [
"BSD-3-Clause"
] | 1 | 2022-01-29T23:04:13.000Z | 2022-01-29T23:04:13.000Z | skimage/restoration/deconvolution.py | thewtex/scikit-image | 22bb6b94698b8889cbdf26b25d9e4fdb8b968d97 | [
"BSD-3-Clause"
] | null | null | null | skimage/restoration/deconvolution.py | thewtex/scikit-image | 22bb6b94698b8889cbdf26b25d9e4fdb8b968d97 | [
"BSD-3-Clause"
] | null | null | null | """Implementations restoration functions"""
import numpy as np
import numpy.random as npr
from scipy.signal import fftconvolve, convolve
from . import uft
__keywords__ = "restoration, image, deconvolution"
def wiener(image, psf, balance, reg=None, is_real=True, clip=True):
"""Wiener-Hunt deconvolution
Re... | 38.010178 | 80 | 0.641786 |
import numpy as np
import numpy.random as npr
from scipy.signal import fftconvolve, convolve
from . import uft
__keywords__ = "restoration, image, deconvolution"
def wiener(image, psf, balance, reg=None, is_real=True, clip=True):
if reg is None:
reg, _ = uft.laplacian(image.ndim, image.shape, is_real=... | true | true |
f774eef6d2387d9e18f745ef42e784ed92880a1a | 2,058 | py | Python | fuzzykeepass.d/main.py | Kafito/lacl | 034ef61e1da78548376d7422a9416871eac8c128 | [
"MIT"
] | 1 | 2020-08-07T16:22:12.000Z | 2020-08-07T16:22:12.000Z | fuzzykeepass.d/main.py | Kafito/lacl | 034ef61e1da78548376d7422a9416871eac8c128 | [
"MIT"
] | null | null | null | fuzzykeepass.d/main.py | Kafito/lacl | 034ef61e1da78548376d7422a9416871eac8c128 | [
"MIT"
] | null | null | null | # system modules
from pykeepass import PyKeePass
import string
import getpass
import sys
# own modules
import getch
import fuzzy
def clearScreen():
print(chr(27) + "[2J" + chr(27) + "[H", end='')
def resetColor():
print(chr(27) + "[0m", end='')
def grayScale(level):
cmap = ["37;1", "37"]
if level > ... | 23.655172 | 99 | 0.578231 | from pykeepass import PyKeePass
import string
import getpass
import sys
import getch
import fuzzy
def clearScreen():
print(chr(27) + "[2J" + chr(27) + "[H", end='')
def resetColor():
print(chr(27) + "[0m", end='')
def grayScale(level):
cmap = ["37;1", "37"]
if level > 1:
level = 1
resetC... | true | true |
f774ef14b7babdef0a57e21ea600a570d023b8d8 | 10,699 | py | Python | data/DataLoader.py | BhujayKumarBhatta/PLELog | 11f18c28d0d71a8882503ffaa377e0fffc1d6e2e | [
"Apache-2.0"
] | 23 | 2021-03-18T06:53:35.000Z | 2022-03-27T13:20:34.000Z | data/DataLoader.py | BhujayKumarBhatta/PLELog | 11f18c28d0d71a8882503ffaa377e0fffc1d6e2e | [
"Apache-2.0"
] | 8 | 2021-09-09T03:21:25.000Z | 2022-02-11T14:05:23.000Z | data/DataLoader.py | BhujayKumarBhatta/PLELog | 11f18c28d0d71a8882503ffaa377e0fffc1d6e2e | [
"Apache-2.0"
] | 11 | 2021-05-17T08:37:54.000Z | 2022-03-09T07:50:44.000Z | import datetime
import os
import re
import time
from data.Instance import *
from data.TensorInstances import *
from data.Vocab import *
rex = ['blk_(|-)[0-9]+', '(/|)([0-9]+\.){3}[0-9]+(:[0-9]+|)(:|)']
def creatVocab(alldatas):
'''
All instances for vocab generation
:param alldatas: ALL instances list
... | 34.624595 | 103 | 0.542107 | import datetime
import os
import re
import time
from data.Instance import *
from data.TensorInstances import *
from data.Vocab import *
rex = ['blk_(|-)[0-9]+', '(/|)([0-9]+\.){3}[0-9]+(:[0-9]+|)(:|)']
def creatVocab(alldatas):
tag_counter = Counter()
for inst in alldatas:
tag_counter[inst.tag] += 1... | true | true |
f774ef262d47fdbdccc0282ea7c78e25585b7541 | 2,203 | py | Python | Learning/11.1-inheritance_Types.py | DishantIsrani/Python-Learning | f810fd64adeecd34fd2d95182f6be2bdfb4f9ac6 | [
"MIT"
] | null | null | null | Learning/11.1-inheritance_Types.py | DishantIsrani/Python-Learning | f810fd64adeecd34fd2d95182f6be2bdfb4f9ac6 | [
"MIT"
] | null | null | null | Learning/11.1-inheritance_Types.py | DishantIsrani/Python-Learning | f810fd64adeecd34fd2d95182f6be2bdfb4f9ac6 | [
"MIT"
] | null | null | null | # # single inheritance
# class Employee:
# company = 'Google'
# def showDetails(self):
# print("This is an employee")
# class Programmer(Employee):
# language = "Python"
# def getLang(self):
# print(f"the language is {self.language}")
# #if there are two same method in base and ... | 17.484127 | 156 | 0.603722 | true | true | |
f774ef833836f06b344784cc84cb76ba7bb62ae7 | 364 | py | Python | 30-days-of-code-python/day_17.py | Dementophobia/hackerrank-solutions | c2448d5124641462bb85aabf2d39922a0179e590 | [
"MIT"
] | 1 | 2021-05-16T17:34:20.000Z | 2021-05-16T17:34:20.000Z | 30-days-of-code-python/day_17.py | Dementophobia/hackerrank-solutions | c2448d5124641462bb85aabf2d39922a0179e590 | [
"MIT"
] | null | null | null | 30-days-of-code-python/day_17.py | Dementophobia/hackerrank-solutions | c2448d5124641462bb85aabf2d39922a0179e590 | [
"MIT"
] | 1 | 2020-10-03T09:36:08.000Z | 2020-10-03T09:36:08.000Z | class Calculator():
def power(self, n, p):
if n >= 0 and p >= 0:
return n**p
raise Exception("n and p should be non-negative")
myCalculator=Calculator()
T=int(input())
for i in range(T):
n,p = map(int, input().split())
try:
ans=myCalculator.power(n,p)
print(ans)... | 22.75 | 57 | 0.554945 | class Calculator():
def power(self, n, p):
if n >= 0 and p >= 0:
return n**p
raise Exception("n and p should be non-negative")
myCalculator=Calculator()
T=int(input())
for i in range(T):
n,p = map(int, input().split())
try:
ans=myCalculator.power(n,p)
print(ans)... | true | true |
f774efdee0340c6534232b1b875d84e039ff09c6 | 106 | py | Python | Plotting/Utils/Colorize DataFrame.py | fraunhofer-iais/IAIS-Python-Snippets | a3ee610d6270cda2c891688851696c34831ffa2b | [
"MIT"
] | null | null | null | Plotting/Utils/Colorize DataFrame.py | fraunhofer-iais/IAIS-Python-Snippets | a3ee610d6270cda2c891688851696c34831ffa2b | [
"MIT"
] | null | null | null | Plotting/Utils/Colorize DataFrame.py | fraunhofer-iais/IAIS-Python-Snippets | a3ee610d6270cda2c891688851696c34831ffa2b | [
"MIT"
] | null | null | null | # a colorful dataframe =)
data.corr().style.background_gradient(cmap='RdYlGn', low=0.2, high=0.2, axis=0) | 35.333333 | 79 | 0.716981 |
data.corr().style.background_gradient(cmap='RdYlGn', low=0.2, high=0.2, axis=0) | true | true |
f774efdf546a071da141fae76d5e70f856e73ac7 | 3,080 | py | Python | tests/routers/test_codejams.py | python-discord/code-jam-management | b6b91357f0afa69f875336917a72ea771eb13556 | [
"MIT"
] | 6 | 2021-06-07T17:29:23.000Z | 2022-02-25T23:36:16.000Z | tests/routers/test_codejams.py | python-discord/code-jam-management | b6b91357f0afa69f875336917a72ea771eb13556 | [
"MIT"
] | 4 | 2021-09-04T13:53:40.000Z | 2021-12-30T23:13:59.000Z | tests/routers/test_codejams.py | python-discord/code-jam-management | b6b91357f0afa69f875336917a72ea771eb13556 | [
"MIT"
] | 2 | 2021-06-07T17:18:15.000Z | 2021-06-14T19:32:33.000Z | """Tests for the codejams router."""
import pytest
from fastapi import FastAPI
from httpx import AsyncClient
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.future import select
from api import models
from api.database import User
pytestmark = pytest.mark.asyncio
# This test fails when the database ... | 37.560976 | 101 | 0.718506 | import pytest
from fastapi import FastAPI
from httpx import AsyncClient
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.future import select
from api import models
from api.database import User
pytestmark = pytest.mark.asyncio
async def test_list_codejams_without_db_entries(client: AsyncClient, app:... | true | true |
f774f12fb08626d573c91802fd8daa4618314b5c | 1,847 | py | Python | q_learning/utils/schedule.py | DarseZ/DL_hw5 | 6229ef6493e92b93e67e71058f90bc4a6b537796 | [
"MIT"
] | null | null | null | q_learning/utils/schedule.py | DarseZ/DL_hw5 | 6229ef6493e92b93e67e71058f90bc4a6b537796 | [
"MIT"
] | null | null | null | q_learning/utils/schedule.py | DarseZ/DL_hw5 | 6229ef6493e92b93e67e71058f90bc4a6b537796 | [
"MIT"
] | null | null | null | import numpy as np
from utils.test_env import EnvTest
class LinearSchedule(object):
def __init__(self, eps_begin, eps_end, nsteps):
"""
Args:
eps_begin: initial exploration
eps_end: end exploration
nsteps: number of steps between the two values of eps
""... | 27.984848 | 84 | 0.517596 | import numpy as np
from utils.test_env import EnvTest
class LinearSchedule(object):
def __init__(self, eps_begin, eps_end, nsteps):
self.epsilon = eps_begin
self.eps_begin = eps_begin
self.eps_end = eps_end
self.nsteps = nsteps
def update(self, t):
... | true | true |
f774f239c3234126c98b702a4785016056c1b6d4 | 8,888 | py | Python | app/api/v1/openvpn.py | zpcocoa/openvpn-cms-flask | 92d6762eb460a0520bf6472c5a53b36eac86c67c | [
"Apache-2.0"
] | 2 | 2021-05-27T14:10:56.000Z | 2021-07-11T05:47:39.000Z | app/api/v1/openvpn.py | cnsmc/openvpn-cms-flask | b4636e609ff06bf3d7bf792a9bf210a2fc4a1cba | [
"Apache-2.0"
] | null | null | null | app/api/v1/openvpn.py | cnsmc/openvpn-cms-flask | b4636e609ff06bf3d7bf792a9bf210a2fc4a1cba | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020/2/14 10:41 上午
# @Author : Browser
# @File : openvpn.py
# @Software: PyCharm
# @contact : browser_hot@163.com
import math
import os
import re
from flask import jsonify, send_from_directory, make_response, request
from lin import route_meta, group_requ... | 33.666667 | 119 | 0.707583 |
import math
import os
import re
from flask import jsonify, send_from_directory, make_response, request
from lin import route_meta, group_required, login_required
from lin.exception import Success, ParameterException, NotFound
from lin.redprint import Redprint
from sqlalchemy import text
from app.libs.shell import Re... | true | true |
f774f36d79836a27aa2633df5ae6fb37f99b80aa | 1,008 | py | Python | list_trello_boards.py | cl0ne/trello-to-kanboard-migrate | 6ba5f6446eb42d9353badebc2a7c1a8f0309ceea | [
"MIT"
] | null | null | null | list_trello_boards.py | cl0ne/trello-to-kanboard-migrate | 6ba5f6446eb42d9353badebc2a7c1a8f0309ceea | [
"MIT"
] | null | null | null | list_trello_boards.py | cl0ne/trello-to-kanboard-migrate | 6ba5f6446eb42d9353badebc2a7c1a8f0309ceea | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import sys
from trello import TrelloClient, ResourceUnavailable
def usage():
print("""Usage: list_trello_boards show
Shows ids and names of Trello boards that the user specified with
TRELLO_API_KEY, TRELLO_API_SECRET, TRELLO_TOKEN and TRELLO_TOKEN_SECRET
environment ... | 24.585366 | 75 | 0.661706 | import os
import sys
from trello import TrelloClient, ResourceUnavailable
def usage():
print("""Usage: list_trello_boards show
Shows ids and names of Trello boards that the user specified with
TRELLO_API_KEY, TRELLO_API_SECRET, TRELLO_TOKEN and TRELLO_TOKEN_SECRET
environment variables is a member o... | true | true |
f774f52290b0a33f2f88ea2a3de1b36241de431d | 182 | py | Python | basics/ch2__VARIABLES_AND_SIMPLE_DATA_TYPES/7_comments_constants.py | bedoyama/python-crash-course | 39101237c478cd9c97f1a47f866408d2754c849f | [
"Apache-2.0"
] | null | null | null | basics/ch2__VARIABLES_AND_SIMPLE_DATA_TYPES/7_comments_constants.py | bedoyama/python-crash-course | 39101237c478cd9c97f1a47f866408d2754c849f | [
"Apache-2.0"
] | null | null | null | basics/ch2__VARIABLES_AND_SIMPLE_DATA_TYPES/7_comments_constants.py | bedoyama/python-crash-course | 39101237c478cd9c97f1a47f866408d2754c849f | [
"Apache-2.0"
] | null | null | null | # Python does not have constants, but as a convention variables defined in ALL CAPS are considered constants
# This is a comment
MAX_VALUE = 123_456_789_987_654_321
print (MAX_VALUE) | 45.5 | 108 | 0.818681 | MAX_VALUE = 123_456_789_987_654_321
print (MAX_VALUE) | true | true |
f774f6266ca20ef5822a8daf28caa1bf522c1359 | 1,244 | py | Python | src/hmm/checks/huawei_hmm_mezz16_check.py | Huawei/Server_Management_Plugin_Check_MK | 88398c7c8affe0b2064f418de931d69e36afde67 | [
"MIT"
] | null | null | null | src/hmm/checks/huawei_hmm_mezz16_check.py | Huawei/Server_Management_Plugin_Check_MK | 88398c7c8affe0b2064f418de931d69e36afde67 | [
"MIT"
] | 2 | 2020-04-24T12:21:10.000Z | 2021-01-18T08:37:50.000Z | src/hmm/checks/huawei_hmm_mezz16_check.py | Huawei/Server_Management_Plugin_Check_MK | 88398c7c8affe0b2064f418de931d69e36afde67 | [
"MIT"
] | 3 | 2018-01-31T04:11:10.000Z | 2021-02-01T08:09:14.000Z | #!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# check_mk is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation in version 2. check_mk is distributed
# in the hope that it will be useful, but... | 38.875 | 80 | 0.697749 |
def inventory_huawei_mezz_health(info):
return [("blade 16 mezz status", None)]
def scan(oid):
return (oid(".1.3.6.1.4.1.2011.2.82.1.82.4.16.6.0") == '1')
check_info["huawei_hmm_mezz16_check"] = {
"inventory_function": inventory_huawei_mezz_health,
"check_function": check_huawei_mezz_health,
... | true | true |
f774f80d8c1581fe14f25427d6709329a4565a74 | 5,140 | py | Python | fixture_generator/management/commands/generate_fixture.py | uTest/django-fixture-generator | 82ae6ccfaa292728b279928cc40a0cb8f3deb4da | [
"BSD-3-Clause"
] | null | null | null | fixture_generator/management/commands/generate_fixture.py | uTest/django-fixture-generator | 82ae6ccfaa292728b279928cc40a0cb8f3deb4da | [
"BSD-3-Clause"
] | null | null | null | fixture_generator/management/commands/generate_fixture.py | uTest/django-fixture-generator | 82ae6ccfaa292728b279928cc40a0cb8f3deb4da | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
import logging
import importlib
from optparse import make_option
from django.core.management import BaseCommand, call_command
from django.conf import settings
from fixture_generator.signals import data_dumped
from django.test.runner import DiscoverRunner
from django.test.utils import get_runner
... | 36.978417 | 134 | 0.652529 | import os
import sys
import logging
import importlib
from optparse import make_option
from django.core.management import BaseCommand, call_command
from django.conf import settings
from fixture_generator.signals import data_dumped
from django.test.runner import DiscoverRunner
from django.test.utils import get_runner
... | false | true |
f774f98ad215604653ed5d932ae6dd61a6590bea | 5,958 | py | Python | streamer/autodetect.py | meryacine/shaka-streamer | 7b7e90143f531c52d96c162cc7393862db0830b7 | [
"Apache-2.0"
] | 154 | 2019-08-29T16:53:24.000Z | 2022-02-25T00:29:56.000Z | streamer/autodetect.py | meryacine/shaka-streamer | 7b7e90143f531c52d96c162cc7393862db0830b7 | [
"Apache-2.0"
] | 101 | 2019-08-30T17:34:51.000Z | 2022-03-02T18:46:22.000Z | streamer/autodetect.py | meryacine/shaka-streamer | 7b7e90143f531c52d96c162cc7393862db0830b7 | [
"Apache-2.0"
] | 56 | 2019-09-08T17:47:22.000Z | 2022-02-23T17:35:11.000Z | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 35.047059 | 87 | 0.721383 |
import shlex
import subprocess
import time
from streamer.bitrate_configuration import (AudioChannelLayout, AudioChannelLayoutName,
VideoResolution, VideoResolutionName)
from streamer.input_configuration import Input, InputType
from typing import Optional, List
TYPES_WE_CA... | true | true |
f774f9e501404155b482bb18cf92ae1a74f352b9 | 9,962 | py | Python | python/ray/tune/tests/test_trial_runner_callbacks.py | benblack769/ray | def97a4c53772701fa3fe4b4f8512509672ecb84 | [
"Apache-2.0"
] | null | null | null | python/ray/tune/tests/test_trial_runner_callbacks.py | benblack769/ray | def97a4c53772701fa3fe4b4f8512509672ecb84 | [
"Apache-2.0"
] | null | null | null | python/ray/tune/tests/test_trial_runner_callbacks.py | benblack769/ray | def97a4c53772701fa3fe4b4f8512509672ecb84 | [
"Apache-2.0"
] | null | null | null | import os
import shutil
import sys
import tempfile
import time
import unittest
import ray
from ray import tune
from ray.rllib import _register_all
from ray.tune.checkpoint_manager import Checkpoint
from ray.tune.logger import DEFAULT_LOGGERS, ExperimentLogger, \
LegacyExperimentLogger
from ray.tune.ray_trial_execu... | 37.171642 | 79 | 0.621261 | import os
import shutil
import sys
import tempfile
import time
import unittest
import ray
from ray import tune
from ray.rllib import _register_all
from ray.tune.checkpoint_manager import Checkpoint
from ray.tune.logger import DEFAULT_LOGGERS, ExperimentLogger, \
LegacyExperimentLogger
from ray.tune.ray_trial_execu... | true | true |
f774fa2cdae4e722b1e8733204ea748fb1072fa5 | 3,057 | py | Python | scripts/tx-viewer.py | ManazRT/Dragonchain | d119b23366b329bab0637e3d1979a665f07bb109 | [
"Apache-2.0"
] | null | null | null | scripts/tx-viewer.py | ManazRT/Dragonchain | d119b23366b329bab0637e3d1979a665f07bb109 | [
"Apache-2.0"
] | null | null | null | scripts/tx-viewer.py | ManazRT/Dragonchain | d119b23366b329bab0637e3d1979a665f07bb109 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
"""
Copyright 2016 Disney Connected and Advanced Technologies
Licensed under the Apache License, Version 2.0 (the "Apache License")
with the following modification; you may not use this file except in
compliance with the Apache License and the following modification to it:
Section 6. Trademark... | 32.521277 | 144 | 0.692182 |
"""
Copyright 2016 Disney Connected and Advanced Technologies
Licensed under the Apache License, Version 2.0 (the "Apache License")
with the following modification; you may not use this file except in
compliance with the Apache License and the following modification to it:
Section 6. Trademarks. is deleted and replac... | false | true |
f774fa2f028690734a3526ed242ecd682d955788 | 88 | py | Python | dtale_desktop/default_sources/dft_csv/get_data.py | dennislwm/dtale-desktop | 1a034d505f6b45c1ece4c18b83af6ae367d16824 | [
"MIT"
] | 154 | 2020-10-27T00:33:51.000Z | 2022-02-19T13:16:36.000Z | dtale_desktop/default_sources/dft_csv/get_data.py | dennislwm/dtale-desktop | 1a034d505f6b45c1ece4c18b83af6ae367d16824 | [
"MIT"
] | 9 | 2020-10-26T23:48:38.000Z | 2021-02-18T04:13:42.000Z | dtale_desktop/default_sources/dft_csv/get_data.py | dennislwm/dtale-desktop | 1a034d505f6b45c1ece4c18b83af6ae367d16824 | [
"MIT"
] | 15 | 2021-01-31T01:11:20.000Z | 2022-02-17T11:41:27.000Z | import pandas as pd
def main(path: str) -> pd.DataFrame:
return pd.read_csv(path)
| 14.666667 | 36 | 0.693182 | import pandas as pd
def main(path: str) -> pd.DataFrame:
return pd.read_csv(path)
| true | true |
f774fa696311398e0942fad8805f977b7e0d2811 | 2,907 | py | Python | best_air/bin/extract_EPA_monitor_data_88101_2000_2017.py | rjplevin/BEST-AIR | 40f4bb74f4a8a98b66a452f58596f4c425c9a51b | [
"MIT"
] | null | null | null | best_air/bin/extract_EPA_monitor_data_88101_2000_2017.py | rjplevin/BEST-AIR | 40f4bb74f4a8a98b66a452f58596f4c425c9a51b | [
"MIT"
] | null | null | null | best_air/bin/extract_EPA_monitor_data_88101_2000_2017.py | rjplevin/BEST-AIR | 40f4bb74f4a8a98b66a452f58596f4c425c9a51b | [
"MIT"
] | null | null | null | import csv
import pandas as pd
CALIFORNIA = 6 # State Code to keep
data_dir = '/Volumes/T7/Box Sync/BEST-AIR/Data/AQ Monitoring/EPA Criteria Pollutants/PM Daily Data/'
pathname = data_dir + '2017/daily_88101_2017.csv'
# Create 'Monitor ID' = State Code + County Code + Site Num + Parameter Code
# Drop rows with 'Sa... | 35.024096 | 143 | 0.632955 | import csv
import pandas as pd
CALIFORNIA = 6
data_dir = '/Volumes/T7/Box Sync/BEST-AIR/Data/AQ Monitoring/EPA Criteria Pollutants/PM Daily Data/'
pathname = data_dir + '2017/daily_88101_2017.csv'
cols_to_keep = [
'State Code',
'County Code',
'Site Num',
'Parameter Code',
'POC',
'Latitude',... | true | true |
f774faefb6fe30a34e544158f529d4c0556aac7f | 2,647 | py | Python | fastlane/target/impl/target_influx.py | dgkatz/fastlane | 1cfe630651c955434f8019a17be0c4ff1fe42c31 | [
"MIT"
] | 4 | 2021-12-10T20:30:22.000Z | 2022-01-06T17:08:20.000Z | fastlane/target/impl/target_influx.py | dgkatz/fastlane | 1cfe630651c955434f8019a17be0c4ff1fe42c31 | [
"MIT"
] | null | null | null | fastlane/target/impl/target_influx.py | dgkatz/fastlane | 1cfe630651c955434f8019a17be0c4ff1fe42c31 | [
"MIT"
] | null | null | null | import logging
from datetime import datetime
from fastlane.target import Target, TargetConfigSchema
import fastlane.utils as utils
from marshmallow import fields
import influxdb
import pandas as pd
LOGGER = logging.getLogger(__name__)
class TargetInfluxDB(Target):
def __init__(self, **kwargs):
super().... | 35.293333 | 108 | 0.700038 | import logging
from datetime import datetime
from fastlane.target import Target, TargetConfigSchema
import fastlane.utils as utils
from marshmallow import fields
import influxdb
import pandas as pd
LOGGER = logging.getLogger(__name__)
class TargetInfluxDB(Target):
def __init__(self, **kwargs):
super().... | true | true |
f774fb4aef50651009ea47e2785df2de1303807e | 29,624 | py | Python | buildh/core.py | pierrepo/buildH | 4870ffc4fb41deec2c8af5ba5b589795bbb99563 | [
"BSD-3-Clause"
] | null | null | null | buildh/core.py | pierrepo/buildH | 4870ffc4fb41deec2c8af5ba5b589795bbb99563 | [
"BSD-3-Clause"
] | null | null | null | buildh/core.py | pierrepo/buildH | 4870ffc4fb41deec2c8af5ba5b589795bbb99563 | [
"BSD-3-Clause"
] | null | null | null | """Module holding the core functions."""
import pandas as pd
import MDAnalysis as mda
import MDAnalysis.coordinates.XTC as XTC
from . import hydrogens
from . import geometry as geo
from . import writers
# For debugging.
# TODO: Remove it after implement logging feature
DEBUG=False
def buildHs_on_1C(atom, H_type, ... | 45.786708 | 121 | 0.607379 |
import pandas as pd
import MDAnalysis as mda
import MDAnalysis.coordinates.XTC as XTC
from . import hydrogens
from . import geometry as geo
from . import writers
DEBUG=False
def buildHs_on_1C(atom, H_type, helper1, helper2, helper3=None):
if H_type == "CH2":
H1_coor, H2_coor = hydrogens.get_CH2(atom, ... | true | true |
f774fbea95d1001b1479832936f55157fdef036a | 2,175 | py | Python | lib/jnpr/junos/factory/viewfields.py | kimcharli/py-junos-eznc | 2358a3b73a3951a47b483d14a063f938b2441082 | [
"Apache-2.0",
"BSD-3-Clause"
] | 576 | 2015-01-03T09:03:00.000Z | 2022-03-24T23:11:54.000Z | lib/jnpr/junos/factory/viewfields.py | kimcharli/py-junos-eznc | 2358a3b73a3951a47b483d14a063f938b2441082 | [
"Apache-2.0",
"BSD-3-Clause"
] | 777 | 2015-01-02T14:18:36.000Z | 2022-03-22T12:00:49.000Z | lib/jnpr/junos/factory/viewfields.py | kimcharli/py-junos-eznc | 2358a3b73a3951a47b483d14a063f938b2441082 | [
"Apache-2.0",
"BSD-3-Clause"
] | 353 | 2015-01-06T07:47:02.000Z | 2022-03-31T23:10:46.000Z | class ViewFields(object):
"""
Used to dynamically create a field dictionary used with the
RunstatView class
"""
def __init__(self):
self._fields = dict()
def _prockvargs(self, field, name, **kvargs):
if not len(kvargs):
return
field[name].update(kvargs)
... | 30.633803 | 77 | 0.58069 | class ViewFields(object):
def __init__(self):
self._fields = dict()
def _prockvargs(self, field, name, **kvargs):
if not len(kvargs):
return
field[name].update(kvargs)
@property
def end(self):
return self._fields
def str(self, name, xpath=None, **kvar... | true | true |
f774fc6a6ca6eca02b5795c3cb75e1f495066375 | 676 | py | Python | send_snapshot.py | hebaishi/pb_monitor | 55426c73a4b06187d4979e5665996d23a9800624 | [
"MIT"
] | null | null | null | send_snapshot.py | hebaishi/pb_monitor | 55426c73a4b06187d4979e5665996d23a9800624 | [
"MIT"
] | null | null | null | send_snapshot.py | hebaishi/pb_monitor | 55426c73a4b06187d4979e5665996d23a9800624 | [
"MIT"
] | null | null | null | #!/usr/bin/python
from optparse import OptionParser
import pybullet
import json
if __name__ == "__main__":
parser = OptionParser()
parser.add_option("-c", "--config-file", dest="config_filename",
help="Path to configuration JSON file", type="string")
parser.add_option("-f", "--filenam... | 29.391304 | 76 | 0.618343 | from optparse import OptionParser
import pybullet
import json
if __name__ == "__main__":
parser = OptionParser()
parser.add_option("-c", "--config-file", dest="config_filename",
help="Path to configuration JSON file", type="string")
parser.add_option("-f", "--filename", dest="filename... | true | true |
f774ffb6ddc02d40b40d19e33af8526698aebb1e | 388 | py | Python | euctr/euctr/wsgi.py | jeekim/euctr-tracker-code | 5a041bcd188ec089cfadf3e97b64013408177033 | [
"MIT"
] | 3 | 2018-09-11T11:35:48.000Z | 2020-09-10T10:39:23.000Z | euctr/euctr/wsgi.py | jeekim/euctr-tracker-code | 5a041bcd188ec089cfadf3e97b64013408177033 | [
"MIT"
] | 61 | 2018-08-06T14:03:16.000Z | 2022-03-17T12:30:42.000Z | euctr/euctr/wsgi.py | jeekim/euctr-tracker-code | 5a041bcd188ec089cfadf3e97b64013408177033 | [
"MIT"
] | 4 | 2018-09-11T11:35:53.000Z | 2020-12-18T14:21:15.000Z | """
WSGI config for euctr project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTIN... | 22.823529 | 78 | 0.783505 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "euctr.settings")
application = get_wsgi_application()
| true | true |
f774ffd86fea9e855d0bede0de85e1568b4cffb4 | 8,709 | py | Python | lambo/models/mlm.py | samuelstanton/lambo | 7b67684b884f75f7007501978c5299514d0efb75 | [
"Apache-2.0"
] | 10 | 2022-03-25T09:05:33.000Z | 2022-03-29T17:02:03.000Z | lambo/models/mlm.py | samuelstanton/lambo | 7b67684b884f75f7007501978c5299514d0efb75 | [
"Apache-2.0"
] | null | null | null | lambo/models/mlm.py | samuelstanton/lambo | 7b67684b884f75f7007501978c5299514d0efb75 | [
"Apache-2.0"
] | 1 | 2022-03-26T16:38:44.000Z | 2022-03-26T16:38:44.000Z | import math
import numpy as np
import torch
import torchvision
import wandb
from torch.nn import functional as F
from torch import LongTensor
from lambo import transforms as gfp_transforms, dataset as gfp_dataset
from lambo.models.shared_elements import check_early_stopping
from lambo.utils import str_to_tokens
de... | 33.240458 | 109 | 0.747962 | import math
import numpy as np
import torch
import torchvision
import wandb
from torch.nn import functional as F
from torch import LongTensor
from lambo import transforms as gfp_transforms, dataset as gfp_dataset
from lambo.models.shared_elements import check_early_stopping
from lambo.utils import str_to_tokens
de... | true | true |
f77501d95d1379aee7d920f3ea0b669487ec5ae5 | 1,377 | py | Python | nova/tests/functional/api_sample_tests/test_fping.py | zjzh/nova | 7bb21723171c59b93e28f5d508c2b6df39220f13 | [
"Apache-2.0"
] | 1,874 | 2015-01-04T05:18:34.000Z | 2022-03-31T03:30:28.000Z | nova/tests/functional/api_sample_tests/test_fping.py | woraser/nova | fc3890667e4971e3f0f35ac921c2a6c25f72adec | [
"Apache-2.0"
] | 132 | 2017-03-27T11:31:52.000Z | 2022-03-30T08:45:02.000Z | nova/tests/functional/api_sample_tests/test_fping.py | woraser/nova | fc3890667e4971e3f0f35ac921c2a6c25f72adec | [
"Apache-2.0"
] | 1,996 | 2015-01-04T15:11:51.000Z | 2022-03-31T11:03:13.000Z | # Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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... | 39.342857 | 78 | 0.697168 |
from oslo_utils import uuidutils
from nova.tests.functional.api import client as api_client
from nova.tests.functional import api_samples_test_base
class FpingSampleJsonTests(api_samples_test_base.ApiSampleTestBase):
api_major_version = 'v2'
def test_get_fping(self):
ex = self.assertRaises(api_clie... | true | true |
f7750254e149ed6d82d5e1cae0b2040f378b4469 | 2,302 | py | Python | bank2ynab/plugins/null.py | ThomDietrich/bank2ynab | 9ed634ae474e076239532748193999ed5544d0a7 | [
"MIT"
] | 129 | 2018-11-18T19:18:34.000Z | 2022-03-29T11:21:00.000Z | bank2ynab/plugins/null.py | ThomDietrich/bank2ynab | 9ed634ae474e076239532748193999ed5544d0a7 | [
"MIT"
] | 197 | 2018-10-12T11:50:12.000Z | 2022-01-25T22:28:01.000Z | bank2ynab/plugins/null.py | ThomDietrich/bank2ynab | 9ed634ae474e076239532748193999ed5544d0a7 | [
"MIT"
] | 60 | 2018-11-20T03:02:25.000Z | 2022-01-25T23:23:13.000Z | # This is a "null" plugin showing how to write your own.
# The procedure is as follows:
# 1 - Subclass B2YBank overriding the methods you need - typically just
# read_data(path_to_file). See docstrings below for explanations.
# 2 - provide build_bank(config_dict_bool) which should return an
# instance of yo... | 37.129032 | 78 | 0.674631 |
from bank_process import B2YBank
class NullBank(B2YBank):
def __init__(self, config_object):
super(NullBank, self).__init__(config_object)
self.name = "NullBank"
def read_data(self, file_path):
return [
]
def get_files(self):
return []
... | true | true |
f77502a15958ac6ea5da842f6d0b2d453c856b64 | 227 | py | Python | faketests/animals/test_one_failing_test.py | Djailla/pytest-sugar | 6ac4a1fa18a51e67c7a759bc11a9264cb78619e4 | [
"BSD-3-Clause"
] | 418 | 2019-08-30T00:41:51.000Z | 2022-03-21T09:31:54.000Z | faketests/animals/test_one_failing_test.py | Djailla/pytest-sugar | 6ac4a1fa18a51e67c7a759bc11a9264cb78619e4 | [
"BSD-3-Clause"
] | 62 | 2019-08-27T16:50:36.000Z | 2022-03-11T07:03:32.000Z | faketests/animals/test_one_failing_test.py | Djailla/pytest-sugar | 6ac4a1fa18a51e67c7a759bc11a9264cb78619e4 | [
"BSD-3-Clause"
] | 25 | 2019-11-27T15:58:16.000Z | 2022-03-21T09:31:56.000Z | import pytest
def test_dog1():
assert True
def test_dog2():
assert True
def test_dog3():
assert True
def test_dog4():
assert True
def test_dog5_failing():
assert False
def test_dog6():
assert True
| 11.35 | 24 | 0.674009 | import pytest
def test_dog1():
assert True
def test_dog2():
assert True
def test_dog3():
assert True
def test_dog4():
assert True
def test_dog5_failing():
assert False
def test_dog6():
assert True
| true | true |
f77502a31a74195559a93df2c3d5316fc93096b0 | 4,506 | py | Python | chainer/utils/conv_nd.py | LuoYuanke/PrivChainer | 758d765c7903f6913cfd58c21db069d5f2a12203 | [
"MIT"
] | null | null | null | chainer/utils/conv_nd.py | LuoYuanke/PrivChainer | 758d765c7903f6913cfd58c21db069d5f2a12203 | [
"MIT"
] | null | null | null | chainer/utils/conv_nd.py | LuoYuanke/PrivChainer | 758d765c7903f6913cfd58c21db069d5f2a12203 | [
"MIT"
] | 1 | 2022-02-20T10:32:59.000Z | 2022-02-20T10:32:59.000Z | import itertools
import numpy
import six
from chainer.backends import cuda
from chainer.utils.conv import get_conv_outsize
from chainer.utils import conv_nd_kernel
def as_tuple(x, n):
if hasattr(x, '__getitem__'):
assert len(x) == n
return tuple(x)
return (x,) * n
def im2col_nd_cpu(img, ksi... | 37.239669 | 77 | 0.562139 | import itertools
import numpy
import six
from chainer.backends import cuda
from chainer.utils.conv import get_conv_outsize
from chainer.utils import conv_nd_kernel
def as_tuple(x, n):
if hasattr(x, '__getitem__'):
assert len(x) == n
return tuple(x)
return (x,) * n
def im2col_nd_cpu(img, ksi... | true | true |
f77502d772a610c7efb34d49c7610aa20643a428 | 1,284 | py | Python | manilaclient/v1/share_type_access.py | Murray-LIANG/python-manilaclient | e3652b9c1c36c825d07dce741802930ad0ec1a12 | [
"CNRI-Python",
"Apache-1.1"
] | null | null | null | manilaclient/v1/share_type_access.py | Murray-LIANG/python-manilaclient | e3652b9c1c36c825d07dce741802930ad0ec1a12 | [
"CNRI-Python",
"Apache-1.1"
] | null | null | null | manilaclient/v1/share_type_access.py | Murray-LIANG/python-manilaclient | e3652b9c1c36c825d07dce741802930ad0ec1a12 | [
"CNRI-Python",
"Apache-1.1"
] | null | null | null | # Copyright 2014 OpenStack Foundation
# Copyright 2015 Chuck Fouts
# 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/L... | 34.702703 | 78 | 0.722741 |
import sys
import warnings
from manilaclient.v2 import share_type_access
warnings.warn("Module manilaclient.v1.share_type_access is deprecated (taken "
"as a basis for manilaclient.v2.share_type_access). "
"The preferable way to get a client class or object is to use "
"the ... | true | true |
f77503353ccfd1a1d00d0f0f2ebfbb63f5bb0052 | 45,579 | py | Python | My files/mastah_zeen/list.py | Alpha-Demon404/RE-14 | b5b46a9f0eee218f2a642b615c77135c33c6f4ad | [
"MIT"
] | 39 | 2020-02-26T09:44:36.000Z | 2022-03-23T00:18:25.000Z | My files/mastah_zeen/list.py | B4BY-DG/reverse-enginnering | b5b46a9f0eee218f2a642b615c77135c33c6f4ad | [
"MIT"
] | 15 | 2020-05-14T10:07:26.000Z | 2022-01-06T02:55:32.000Z | My files/mastah_zeen/list.py | B4BY-DG/reverse-enginnering | b5b46a9f0eee218f2a642b615c77135c33c6f4ad | [
"MIT"
] | 41 | 2020-03-16T22:36:38.000Z | 2022-03-17T14:47:19.000Z | # Filename : ooo.py
# Python Bytecode : 2.7
# Time Succses Decompiled : Sun Aug 16 17:06:48 2020
# Timestamp In Code : 2020-06-10 22:04:47
dat = []
k = [(([] < ()) + ([] < ()) + ([] >= {}) << ([] != ()) + ([] <= []) + ([] > {}) + (([] > {}) + ([] == []) + (() >= []))) + (([] < ()) + (() == []) << ([] != {}) + ({} == {... | 3,506.076923 | 44,185 | 0.017749 |
dat = []
k = [(([] < ()) + ([] < ()) + ([] >= {}) << ([] != ()) + ([] <= []) + ([] > {}) + (([] > {}) + ([] == []) + (() >= []))) + (([] < ()) + (() == []) << ([] != {}) + ({} == {})), ((({} <= {}) + ({} >= []) << ([] <= []) + ({} < []) + (() >= [])) + ({} <= {}) * ({} >= {}) << (() != []) + (() != {})) - (({} < []) +... | true | true |
f77504bca72b66019e94f9cc66c171f487d4eb73 | 5,481 | py | Python | kubernetes_asyncio/client/models/extensions_v1beta1_ingress_backend.py | lsst-sqre/kubernetes_asyncio | f028cc793e3a2c519be6a52a49fb77ff0b014c9b | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/extensions_v1beta1_ingress_backend.py | lsst-sqre/kubernetes_asyncio | f028cc793e3a2c519be6a52a49fb77ff0b014c9b | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/extensions_v1beta1_ingress_backend.py | lsst-sqre/kubernetes_asyncio | f028cc793e3a2c519be6a52a49fb77ff0b014c9b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.19.15
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
f... | 30.966102 | 124 | 0.624339 |
import pprint
import re
import six
from kubernetes_asyncio.client.configuration import Configuration
class ExtensionsV1beta1IngressBackend(object):
openapi_types = {
'resource': 'V1TypedLocalObjectReference',
'service_name': 'str',
'service_port': 'object'
}
attribute_map =... | true | true |
f77505bf7fa63d57b0d04a1cd0d87183b489b5be | 20,340 | py | Python | src/foremast/runner.py | waynetaylor/foremast | 8bda62501e13a9c09b66c46ca722bd280dc7a65d | [
"Apache-2.0"
] | 1 | 2019-09-11T18:16:41.000Z | 2019-09-11T18:16:41.000Z | src/foremast/runner.py | waynetaylor/foremast | 8bda62501e13a9c09b66c46ca722bd280dc7a65d | [
"Apache-2.0"
] | null | null | null | src/foremast/runner.py | waynetaylor/foremast | 8bda62501e13a9c09b66c46ca722bd280dc7a65d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Foremast - Pipeline Tooling
#
# Copyright 2018 Gogo, 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... | 37.389706 | 120 | 0.659538 | import argparse
import logging
import os
import gogoutils
from . import (autoscaling_policy, awslambda, configs, consts, datapipeline, dns, elb, iam, pipeline, s3,
scheduled_actions, securitygroup, slacknotify, stepfunction, utils)
from .gcp_iam import GcpIamResourceClient
from .app import SpinnakerApp... | true | true |
f77506727ee07fa15026f9de9fd2dab7e125a4ec | 981 | py | Python | plugins/help_text.py | ilhamr0f11/Sub-Mux-IR-Bot | 6cba0e94d61f399fe5ac9e1ec1dcd72a33037785 | [
"MIT"
] | 1 | 2021-10-22T01:20:03.000Z | 2021-10-22T01:20:03.000Z | plugins/help_text.py | ilhamr0f11/Sub-Mux-IR-Bot | 6cba0e94d61f399fe5ac9e1ec1dcd72a33037785 | [
"MIT"
] | null | null | null | plugins/help_text.py | ilhamr0f11/Sub-Mux-IR-Bot | 6cba0e94d61f399fe5ac9e1ec1dcd72a33037785 | [
"MIT"
] | null | null | null |
#Logging
import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
import os
import pyrogram
from chat import Chat
from config import Config
logging.getLogger('pyrogram').setLevel(logging.WARNING)
... | 25.815789 | 82 | 0.649337 |
import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
import os
import pyrogram
from chat import Chat
from config import Config
logging.getLogger('pyrogram').setLevel(logging.WARNING)
@pyrogra... | true | true |
f77506825d0d5080bdbc8ff2ca0dcbdad87b309e | 1,494 | py | Python | notes/algo-ds-practice/problems/graph/standard/bellman_ford/bellman_ford.py | Anmol-Singh-Jaggi/interview-notes | 65af75e2b5725894fa5e13bb5cd9ecf152a0d652 | [
"MIT"
] | 6 | 2020-07-05T05:15:19.000Z | 2021-01-24T20:17:14.000Z | notes/algo-ds-practice/problems/graph/standard/bellman_ford/bellman_ford.py | Anmol-Singh-Jaggi/interview-notes | 65af75e2b5725894fa5e13bb5cd9ecf152a0d652 | [
"MIT"
] | null | null | null | notes/algo-ds-practice/problems/graph/standard/bellman_ford/bellman_ford.py | Anmol-Singh-Jaggi/interview-notes | 65af75e2b5725894fa5e13bb5cd9ecf152a0d652 | [
"MIT"
] | 2 | 2020-09-14T06:46:37.000Z | 2021-06-15T09:17:21.000Z | import math
from ds.graph.graph_core import GraphCore
def bellman_ford(graph, src):
"""
Complexity = O(EV)
Works for negative edges unlike Dijkstra.
"""
distances = {}
for vertex in graph.vertices:
distances[vertex] = math.inf
distances[src] = 0
for _ in range(len(graph.vertic... | 29.294118 | 77 | 0.599732 | import math
from ds.graph.graph_core import GraphCore
def bellman_ford(graph, src):
distances = {}
for vertex in graph.vertices:
distances[vertex] = math.inf
distances[src] = 0
for _ in range(len(graph.vertices)):
for src, edges in graph.get_all_edges().items():
for neigh,... | true | true |
f775078bb5b1e425caf38b21210bb1056eabfec8 | 1,574 | py | Python | tests/questions/test_median_stream.py | owejow/algorithms | 756095671326512cc72b817f1a6fe35e8b9ac71d | [
"Apache-2.0"
] | null | null | null | tests/questions/test_median_stream.py | owejow/algorithms | 756095671326512cc72b817f1a6fe35e8b9ac71d | [
"Apache-2.0"
] | null | null | null | tests/questions/test_median_stream.py | owejow/algorithms | 756095671326512cc72b817f1a6fe35e8b9ac71d | [
"Apache-2.0"
] | null | null | null | import slcrmit.questions.median_stream as subject
class TestMedianStream(object):
def test_median_stream(self):
ary = [1,2,3,4,5]
expected = [1,1.5,2,2.5,3]
median = subject.median_stream_brute_force(ary)
assert median == expected
def test_median_stream_complex(self):
... | 31.48 | 55 | 0.611817 | import slcrmit.questions.median_stream as subject
class TestMedianStream(object):
def test_median_stream(self):
ary = [1,2,3,4,5]
expected = [1,1.5,2,2.5,3]
median = subject.median_stream_brute_force(ary)
assert median == expected
def test_median_stream_complex(self):
... | true | true |
f7750810feaf033105d0915a5123ae256ac7cd52 | 484 | py | Python | SMS_18/main/migrations/0017_auto_20180216_1355.py | bitsacm/SMS-18 | 7284e657f9b21e7604fe79c7a4c42e599cf0f92b | [
"MIT"
] | 8 | 2018-02-24T22:32:39.000Z | 2022-03-18T18:28:41.000Z | SMS_18/main/migrations/0017_auto_20180216_1355.py | bitsacm/SMS-18 | 7284e657f9b21e7604fe79c7a4c42e599cf0f92b | [
"MIT"
] | 3 | 2020-06-06T00:41:08.000Z | 2021-06-10T22:34:45.000Z | SMS_18/main/migrations/0017_auto_20180216_1355.py | vishal-deoleya/SMS-18 | 3a6caa1602e8aac3213adafa3052d228c0e4c3df | [
"MIT"
] | 3 | 2019-01-16T09:20:44.000Z | 2019-01-22T07:05:38.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import datetime
class Migration(migrations.Migration):
dependencies = [
('main', '0016_auto_20180216_1820'),
]
operations = [
migrations.AlterField(
model_name='newspost'... | 23.047619 | 111 | 0.630165 | from __future__ import unicode_literals
from django.db import migrations, models
import datetime
class Migration(migrations.Migration):
dependencies = [
('main', '0016_auto_20180216_1820'),
]
operations = [
migrations.AlterField(
model_name='newspost',
name='time... | true | true |
f775084023227ededad65f1b869aa990af63a855 | 3,066 | py | Python | scalabel/tools/edit_labels.py | Anthuang/scalabel | 9f33b966079793f159f4311e3817b95be44ffab8 | [
"Apache-2.0"
] | 279 | 2019-11-18T01:48:39.000Z | 2022-03-30T00:16:43.000Z | scalabel/tools/edit_labels.py | Anthuang/scalabel | 9f33b966079793f159f4311e3817b95be44ffab8 | [
"Apache-2.0"
] | 141 | 2019-11-20T02:36:11.000Z | 2022-03-29T15:17:46.000Z | scalabel/tools/edit_labels.py | Anthuang/scalabel | 9f33b966079793f159f4311e3817b95be44ffab8 | [
"Apache-2.0"
] | 85 | 2019-11-18T06:10:12.000Z | 2022-03-27T12:32:55.000Z | """Edit the label and image list files in BDD100K format."""
import argparse
import json
from os.path import basename, join, splitext
from typing import Any, Callable, Dict, List
import yaml
from ..common.io import open_read_text, open_write_text
from ..common.logger import logger
LabelObject = Dict[str, Any] # ty... | 27.375 | 78 | 0.61122 |
import argparse
import json
from os.path import basename, join, splitext
from typing import Any, Callable, Dict, List
import yaml
from ..common.io import open_read_text, open_write_text
from ..common.logger import logger
LabelObject = Dict[str, Any]
def parse_arguments() -> argparse.Namespace:
parser = argpa... | true | true |
f7750870c844672a148fc5b27d4f8611dd1e2c52 | 1,340 | py | Python | data_loader/baseline_generator.py | mmr12/DeepLearning18 | 3e683c570ea8f5e224767a41a0e152267cfd08e7 | [
"Apache-2.0"
] | null | null | null | data_loader/baseline_generator.py | mmr12/DeepLearning18 | 3e683c570ea8f5e224767a41a0e152267cfd08e7 | [
"Apache-2.0"
] | 5 | 2018-12-21T09:58:40.000Z | 2019-01-19T19:34:40.000Z | data_loader/baseline_generator.py | mmr12/DeepLearning18 | 3e683c570ea8f5e224767a41a0e152267cfd08e7 | [
"Apache-2.0"
] | 1 | 2019-02-28T09:18:50.000Z | 2019-02-28T09:18:50.000Z | import numpy as np
import os
import sys
# To import from sibling directory ../utils
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/..")
from data_loader.load_utils import load_obj
from data_loader.load_utils import try_to_load_as_pickled_object
from sklearn.model_selection import train_test_split
from d... | 40.606061 | 106 | 0.638806 | import numpy as np
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/..")
from data_loader.load_utils import load_obj
from data_loader.load_utils import try_to_load_as_pickled_object
from sklearn.model_selection import train_test_split
from data_loader.process_files import process_all_... | true | true |
f77508f5ffcdc43c7180dfc7e5e4f23942f000da | 12,445 | py | Python | pyaoscx/ospf_router.py | aopdal/pyaoscx | b21adba63ace0b9e2a54f65e82b284a6d023791c | [
"Apache-2.0"
] | null | null | null | pyaoscx/ospf_router.py | aopdal/pyaoscx | b21adba63ace0b9e2a54f65e82b284a6d023791c | [
"Apache-2.0"
] | null | null | null | pyaoscx/ospf_router.py | aopdal/pyaoscx | b21adba63ace0b9e2a54f65e82b284a6d023791c | [
"Apache-2.0"
] | null | null | null | # (C) Copyright 2019-2022 Hewlett Packard Enterprise Development LP.
# Apache License 2.0
import json
import logging
from pyaoscx.exceptions.generic_op_error import GenericOperationError
from pyaoscx.exceptions.response_error import ResponseError
from pyaoscx.exceptions.verification_error import VerificationError
fr... | 37.942073 | 79 | 0.628284 |
import json
import logging
from pyaoscx.exceptions.generic_op_error import GenericOperationError
from pyaoscx.exceptions.response_error import ResponseError
from pyaoscx.exceptions.verification_error import VerificationError
from pyaoscx.utils import util as utils
from pyaoscx.utils.list_attributes import ListDescri... | true | true |
f77508f88b5dc173f2259bdb9e343010e3b7d8d3 | 5,364 | py | Python | ch08/just_to_write_code.py | ryosuke071111/deep-learning-from-scratch | f1e7e922f2e0e1aebf5bdd92ee630b3b654cb919 | [
"MIT"
] | null | null | null | ch08/just_to_write_code.py | ryosuke071111/deep-learning-from-scratch | f1e7e922f2e0e1aebf5bdd92ee630b3b654cb919 | [
"MIT"
] | null | null | null | ch08/just_to_write_code.py | ryosuke071111/deep-learning-from-scratch | f1e7e922f2e0e1aebf5bdd92ee630b3b654cb919 | [
"MIT"
] | null | null | null | import sys, os
sys,path.append(os,pardir)
import pickle
import numpy as np
from collections import OrderdDict
from common.layers import *
class DeepConNet:
def __init__(self, input_dim=(1, 28, 28),
conv_param_1 = {'filter_num':16, 'filter_size':3, 'pad':1, 'stride':1},
conv_param_... | 32.509091 | 125 | 0.564318 | import sys, os
sys,path.append(os,pardir)
import pickle
import numpy as np
from collections import OrderdDict
from common.layers import *
class DeepConNet:
def __init__(self, input_dim=(1, 28, 28),
conv_param_1 = {'filter_num':16, 'filter_size':3, 'pad':1, 'stride':1},
conv_param_... | false | true |
f77509a6ac3ebd415890f0d2ad2176534a6a1e5f | 1,625 | py | Python | model/model_utils.py | joycenerd/AICUP_MangoClassification | bfff64745c17724e90e17e2d19cc72ebc318722b | [
"MIT"
] | null | null | null | model/model_utils.py | joycenerd/AICUP_MangoClassification | bfff64745c17724e90e17e2d19cc72ebc318722b | [
"MIT"
] | null | null | null | model/model_utils.py | joycenerd/AICUP_MangoClassification | bfff64745c17724e90e17e2d19cc72ebc318722b | [
"MIT"
] | null | null | null | from .resnest.restnest import get_model
from efficientnet_pytorch import EfficientNet
from options import opt
from .lambdaresnet import LambdaResNet50, LambdaResNet101, LambdaResNet152, LambdaResNet200, LambdaResNet270, LambdaResNet350, LambdaResNet420
def get_net(model):
if model[0:8]=='resnest':
get_mode... | 47.794118 | 142 | 0.718769 | from .resnest.restnest import get_model
from efficientnet_pytorch import EfficientNet
from options import opt
from .lambdaresnet import LambdaResNet50, LambdaResNet101, LambdaResNet152, LambdaResNet200, LambdaResNet270, LambdaResNet350, LambdaResNet420
def get_net(model):
if model[0:8]=='resnest':
get_mode... | true | true |
f77509da7ffe1913d634457828d0a301d308db17 | 4,805 | py | Python | signals.py | razo559/rh-trading-bot | 80ca0dd92d2c3435aafc3a9eaddb021a5b05cac3 | [
"MIT"
] | null | null | null | signals.py | razo559/rh-trading-bot | 80ca0dd92d2c3435aafc3a9eaddb021a5b05cac3 | [
"MIT"
] | null | null | null | signals.py | razo559/rh-trading-bot | 80ca0dd92d2c3435aafc3a9eaddb021a5b05cac3 | [
"MIT"
] | null | null | null | from config import config
from math import isnan
# Signals are defined in alphabetical order
class signals:
def buy_sma_crossover_rsi( self, ticker, data ):
# Moving Average Crossover with RSI Filter
# Credits: https://trader.autochartist.com/moving-average-crossover-with-rsi-filter/
# Buy ... | 53.988764 | 180 | 0.534235 | from config import config
from math import isnan
class signals:
def buy_sma_crossover_rsi( self, ticker, data ):
return(
not isnan( data.iloc[ -1 ][ ticker + '_SMA_F' ] ) and
not isnan( data.iloc[ -2 ][ ticker + '_SMA_F' ] ) and
... | true | true |
f77509dba7974a2b8af8189c37113b5c27a7d240 | 8,124 | py | Python | tensorflow/SAM Model - Petastorm.py | Data-drone/scaling_deep_learning | 476346179c4575ad6aeecc8c6a1b427d00abde5a | [
"MIT"
] | null | null | null | tensorflow/SAM Model - Petastorm.py | Data-drone/scaling_deep_learning | 476346179c4575ad6aeecc8c6a1b427d00abde5a | [
"MIT"
] | null | null | null | tensorflow/SAM Model - Petastorm.py | Data-drone/scaling_deep_learning | 476346179c4575ad6aeecc8c6a1b427d00abde5a | [
"MIT"
] | null | null | null | # Databricks notebook source
# MAGIC %md
# MAGIC
# MAGIC ## Training and packaging a Tensorflow 2.x model with Model Hub
# MAGIC
# MAGIC - based on: https://www.tensorflow.org/text/tutorials/classify_text_with_bert
# MAGIC - Sentiment Analysis Model
# COMMAND ----------
# MAGIC %md
# MAGIC
# MAGIC #### Extra libra... | 25.3875 | 117 | 0.661743 |
import os
import tensorflow as tf
import tensorflow_hub as hub
import tensorflow_text as text
from official.nlp import optimization
import matplotlib.pyplot as plt
tf.get_logger().setLevel('DEBUG')
log_dir = '/dbfs/Users/brian.law@databricks.com/tf_log_dirs'
dataset_dir = '/dbfs/user/brian.law/data/'
cache... | true | true |
f7750a8db2507e1c7c15dd9c5bfbe0bd44e7f645 | 7,242 | py | Python | enthought/pyface/ui/pyjd/action/menu_manager.py | rwl/traitsbackendpyjamas | bd5ec340be2b58decf36e28b9a396d77919fefc0 | [
"MIT"
] | 1 | 2016-05-08T23:25:28.000Z | 2016-05-08T23:25:28.000Z | enthought/pyface/ui/pyjd/action/menu_manager.py | rwl/traitsbackendpyjamas | bd5ec340be2b58decf36e28b9a396d77919fefc0 | [
"MIT"
] | null | null | null | enthought/pyface/ui/pyjd/action/menu_manager.py | rwl/traitsbackendpyjamas | bd5ec340be2b58decf36e28b9a396d77919fefc0 | [
"MIT"
] | null | null | null | #------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# Copyright (c) 2009, Richard Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# d... | 33.683721 | 79 | 0.535073 |
from enthought.traits.api import Unicode
from enthought.pyface.action.action_manager import ActionManager
from enthought.pyface.action.action_manager_item import ActionManagerItem
from enthought.pyface.action.group import Group
class MenuManager(ActionManager, ActionManagerItem):
# label will be).
... | true | true |
f7750af7a8bf1be04c77a5eecaa0ea35d3b765ec | 5,645 | py | Python | release/scripts/addons/io_blend_utils/bl_utils/subprocess_helper.py | noorbeast/BlenderSource | 65ebecc5108388965678b04b43463b85f6c69c1d | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 3 | 2019-09-16T10:29:19.000Z | 2022-02-11T14:43:18.000Z | engine/2.80/scripts/addons/io_blend_utils/bl_utils/subprocess_helper.py | byteinc/Phasor | f7d23a489c2b4bcc3c1961ac955926484ff8b8d9 | [
"Unlicense"
] | null | null | null | engine/2.80/scripts/addons/io_blend_utils/bl_utils/subprocess_helper.py | byteinc/Phasor | f7d23a489c2b4bcc3c1961ac955926484ff8b8d9 | [
"Unlicense"
] | null | null | null | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 29.867725 | 97 | 0.568645 |
class SubprocessHelper:
environ = {}
command = ()
@staticmethod
def _non_blocking_readlines(f, chunk=64):
import os
from .pipe_non_blocking import (
pipe_non_blocking_set,
pipe_non_blocking_is_error_blocking,
PortableBlockingIOError,... | true | true |
f7750b07d3aef4a1a4f8c6eb98fb13f23cfcc640 | 9,834 | py | Python | rtlib/setting.py | waki285/rt-bot | 1b264d7d9fe75526766b56547cea801619d13051 | [
"BSD-4-Clause"
] | null | null | null | rtlib/setting.py | waki285/rt-bot | 1b264d7d9fe75526766b56547cea801619d13051 | [
"BSD-4-Clause"
] | null | null | null | rtlib/setting.py | waki285/rt-bot | 1b264d7d9fe75526766b56547cea801619d13051 | [
"BSD-4-Clause"
] | null | null | null | # RT Lib - Setting
from typing import (
TYPE_CHECKING, TypedDict, Optional, Union, Literal, Dict, Tuple, List,
overload, get_origin, get_args
)
from discord.ext import commands
import discord
from collections import defaultdict
from aiohttp import ClientSession
from functools import partial
from datetime imp... | 34.996441 | 92 | 0.573724 |
from typing import (
TYPE_CHECKING, TypedDict, Optional, Union, Literal, Dict, Tuple, List,
overload, get_origin, get_args
)
from discord.ext import commands
import discord
from collections import defaultdict
from aiohttp import ClientSession
from functools import partial
from datetime import datetime
from u... | true | true |
f7750b856d70414fdbec9c15bb3621133fd7810f | 2,994 | py | Python | Basic Math.py | manzoo16/Calculate | cf112b42fcda961626e731a6d6addaff4544dfd0 | [
"Apache-2.0"
] | null | null | null | Basic Math.py | manzoo16/Calculate | cf112b42fcda961626e731a6d6addaff4544dfd0 | [
"Apache-2.0"
] | 1 | 2020-10-03T13:05:23.000Z | 2020-10-03T13:05:23.000Z | Basic Math.py | manzoo16/Calculate | cf112b42fcda961626e731a6d6addaff4544dfd0 | [
"Apache-2.0"
] | 1 | 2020-09-30T18:12:12.000Z | 2020-09-30T18:12:12.000Z | import os
def main():
print ('\033[31m============================================\033[1;m\n')
print('''\033[1;34m## ## ## ## ## ####### #####\033[1;m''')
print('''\033[1;34m#### #### ## ## #### ## ### # #\033[1;m''')
print('''\033[1;34m## ## ## ####### ## #### ### ... | 36.072289 | 100 | 0.39646 | import os
def main():
print ('\033[31m============================================\033[1;m\n')
print('''\033[1;34m## ## ## ## ## ####### #####\033[1;m''')
print('''\033[1;34m#### #### ## ## #### ## ### # #\033[1;m''')
print('''\033[1;34m## ## ## ####### ## #### ### ... | true | true |
f7750e009ef6c40a2a5f300c8229d0008734adb4 | 10,459 | py | Python | PCRF_sim/tests_CCR-I-U-T.py | fertiland/pyprotosim | b329c060f1cd521e264da8416249a02429f432f3 | [
"BSD-2-Clause"
] | 12 | 2017-11-07T12:45:43.000Z | 2022-02-10T12:36:49.000Z | PCRF_sim/tests_CCR-I-U-T.py | fertiland/pyprotosim | b329c060f1cd521e264da8416249a02429f432f3 | [
"BSD-2-Clause"
] | 1 | 2019-02-12T09:25:55.000Z | 2019-02-12T09:25:55.000Z | PCRF_sim/tests_CCR-I-U-T.py | fertiland/pyprotosim | b329c060f1cd521e264da8416249a02429f432f3 | [
"BSD-2-Clause"
] | 5 | 2018-09-19T09:46:50.000Z | 2020-08-20T09:46:53.000Z | #!/usr/bin/python
##################################################################
# Copyright (c) 2012, Sergej Srepfler <sergej.srepfler@gmail.com>
# Test client added by L.Belov <lavrbel@gmail.com>
# February 2012 - March 2014
# Version 0.1.1, Last change on Mar 11, 2014
# This software is distributed under the te... | 34.179739 | 138 | 0.734965 |
import sys
import socket
sys.path.append("..")
from libDiameter import *
if __name__ == '__main__':
HOST='127.0.0.1'
PORT=3868
Conn=Connect(HOST,PORT)
LoadDictionary("../dictDiameter.xml")
print "TEST 1 -- SEND CCR-I TO PCRF with IDENTITY(MSISDN) WHICH IS FOUND in SPR LDAP database"
CCR_avps=[ ]
... | false | true |
f7750f088d037818f1a1c2c1cd3222a9933e2590 | 6,436 | py | Python | tests/test_parameter.py | TRI-AMDD/paretl | 7244407e5d92a2fd65d70899516b026677f4b58c | [
"Apache-2.0"
] | null | null | null | tests/test_parameter.py | TRI-AMDD/paretl | 7244407e5d92a2fd65d70899516b026677f4b58c | [
"Apache-2.0"
] | null | null | null | tests/test_parameter.py | TRI-AMDD/paretl | 7244407e5d92a2fd65d70899516b026677f4b58c | [
"Apache-2.0"
] | 1 | 2021-07-01T15:40:38.000Z | 2021-07-01T15:40:38.000Z | import pytest
import json
from paretl import ParameterizingOut, Parameter, JSONType, Parameterized, ETL, In, Out, timeit, tim, Sweep
@pytest.fixture()
def par():
return Parameter('name', default="foo")
@pytest.fixture()
def par2():
return Parameter('size', default="bar", custom=[20])
@pytest.fixture()
def... | 25.539683 | 106 | 0.626631 | import pytest
import json
from paretl import ParameterizingOut, Parameter, JSONType, Parameterized, ETL, In, Out, timeit, tim, Sweep
@pytest.fixture()
def par():
return Parameter('name', default="foo")
@pytest.fixture()
def par2():
return Parameter('size', default="bar", custom=[20])
@pytest.fixture()
def... | true | true |
f7750f1b9681020602663f845fa7d3718b80bf8e | 5,498 | py | Python | albu_scheduler/schedulers.py | KiriLev/albu_scheduler | edb70f3d9c90761570744f35aed61c35cf121316 | [
"MIT"
] | 17 | 2021-05-03T08:24:21.000Z | 2021-08-04T15:19:06.000Z | albu_scheduler/schedulers.py | KiriLev/albu_scheduler | edb70f3d9c90761570744f35aed61c35cf121316 | [
"MIT"
] | null | null | null | albu_scheduler/schedulers.py | KiriLev/albu_scheduler | edb70f3d9c90761570744f35aed61c35cf121316 | [
"MIT"
] | 1 | 2021-08-04T13:46:54.000Z | 2021-08-04T13:46:54.000Z | from typing import Dict, List
from albumentations import BasicTransform, NoOp
class BaseTransformScheduler:
def __init__(self, **kwargs):
pass
def __call__(self, **kwargs):
return self.cur_transform(**kwargs)
def step(self, **kwargs):
pass
class TransformMultiStepScheduler(Bas... | 36.899329 | 113 | 0.58112 | from typing import Dict, List
from albumentations import BasicTransform, NoOp
class BaseTransformScheduler:
def __init__(self, **kwargs):
pass
def __call__(self, **kwargs):
return self.cur_transform(**kwargs)
def step(self, **kwargs):
pass
class TransformMultiStepScheduler(Bas... | true | true |
f775100d6103506b8dd524e0beb3058a7d9961af | 25,877 | py | Python | mripy/afni.py | herrlich10/mripy | df9a8e57a21163579af49c59a9dcd2da279cb9fa | [
"MIT"
] | 3 | 2020-08-05T10:18:59.000Z | 2022-01-19T08:28:16.000Z | mripy/afni.py | herrlich10/mripy | df9a8e57a21163579af49c59a9dcd2da279cb9fa | [
"MIT"
] | null | null | null | mripy/afni.py | herrlich10/mripy | df9a8e57a21163579af49c59a9dcd2da279cb9fa | [
"MIT"
] | 4 | 2020-08-19T05:06:16.000Z | 2021-02-03T09:53:33.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
import sys, os, re, shlex, shutil, glob, subprocess, collections
from os import path
from datetime import datetime
import numpy as np
from scipy import interpolate
import matplotlib as mpl
fr... | 36.601132 | 124 | 0.583337 | from __future__ import print_function, division, absolute_import, unicode_literals
import sys, os, re, shlex, shutil, glob, subprocess, collections
from os import path
from datetime import datetime
import numpy as np
from scipy import interpolate
import matplotlib as mpl
from . import six
has_afni = True
def filte... | true | true |
f775109f0790a2937683f3346b094f38b9c28724 | 1,389 | py | Python | app.py | animesh-007/digit-identify | 236befc520af08ff838dfdf2ae0392d8afb7598a | [
"MIT"
] | 21 | 2018-04-02T09:51:01.000Z | 2020-09-18T12:05:33.000Z | app.py | animesh-007/digit-identify | 236befc520af08ff838dfdf2ae0392d8afb7598a | [
"MIT"
] | 2 | 2018-04-02T13:48:35.000Z | 2018-04-04T09:34:33.000Z | app.py | animesh-007/digit-identify | 236befc520af08ff838dfdf2ae0392d8afb7598a | [
"MIT"
] | 39 | 2018-04-02T09:50:46.000Z | 2020-04-28T14:50:00.000Z | import os
#Define backend as tensorflow
os.environ['KERAS_BACKEND']='tensorflow'
#It is important to import keras after changing backend
import keras
from flask import Flask, render_template,request
from scipy.misc import imsave, imread, imresize
import numpy as np
#import keras.models
import re
import sys ... | 22.047619 | 56 | 0.670986 | import os
os.environ['KERAS_BACKEND']='tensorflow'
import keras
from flask import Flask, render_template,request
from scipy.misc import imsave, imread, imresize
import numpy as np
import re
import sys
import os
sys.path.append(os.path.abspath("./model"))
from load import *
app = Flask(__name__)
glob... | true | true |
f775115d760b134363d5869ba4d63de96761a370 | 38,121 | py | Python | src/prefect/engine/task_runner.py | nathaniel-md/prefect | 467bc5b1dcd83716bd896eff549f6bceb59da8cf | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/prefect/engine/task_runner.py | nathaniel-md/prefect | 467bc5b1dcd83716bd896eff549f6bceb59da8cf | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/prefect/engine/task_runner.py | nathaniel-md/prefect | 467bc5b1dcd83716bd896eff549f6bceb59da8cf | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | from contextlib import redirect_stdout
from dask.base import tokenize
import json
from typing import (
Any,
Callable,
Dict,
Iterable,
List,
NamedTuple,
Optional,
Set,
Tuple,
)
import pendulum
import prefect
from prefect import config
from prefect.core import Edge, Task
from prefect... | 37.631787 | 128 | 0.563049 | from contextlib import redirect_stdout
from dask.base import tokenize
import json
from typing import (
Any,
Callable,
Dict,
Iterable,
List,
NamedTuple,
Optional,
Set,
Tuple,
)
import pendulum
import prefect
from prefect import config
from prefect.core import Edge, Task
from prefect... | true | true |
f775117be7d477d54157eeee66f73e6471e8f436 | 13,888 | py | Python | ScPlayback.py | futamint/EM-uNetPi | 607516ab2fdeab0f2a4ac6ff65b1efe42b52cef5 | [
"MIT"
] | null | null | null | ScPlayback.py | futamint/EM-uNetPi | 607516ab2fdeab0f2a4ac6ff65b1efe42b52cef5 | [
"MIT"
] | null | null | null | ScPlayback.py | futamint/EM-uNetPi | 607516ab2fdeab0f2a4ac6ff65b1efe42b52cef5 | [
"MIT"
] | null | null | null | import sys, getopt, struct, time, termios, fcntl, sys, os, colorsys, threading, time, datetime, subprocess, random, os.path, math, json
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/fbtft')
from RenderManager import RenderManager
from WanemManager import WanemManager
from ScBase import ScBase
from gfx ... | 34.547264 | 135 | 0.616647 | import sys, getopt, struct, time, termios, fcntl, sys, os, colorsys, threading, time, datetime, subprocess, random, os.path, math, json
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/fbtft')
from RenderManager import RenderManager
from WanemManager import WanemManager
from ScBase import ScBase
from gfx ... | false | true |
f775119d837b072e9634b237ea349f41e1dd87b0 | 397 | py | Python | programs/pgm02_03.py | danielsunzhongyuan/python_practice | 79bc88db1c52ee2f5607f6f9fec1bbacea2804ff | [
"Apache-2.0"
] | null | null | null | programs/pgm02_03.py | danielsunzhongyuan/python_practice | 79bc88db1c52ee2f5607f6f9fec1bbacea2804ff | [
"Apache-2.0"
] | null | null | null | programs/pgm02_03.py | danielsunzhongyuan/python_practice | 79bc88db1c52ee2f5607f6f9fec1bbacea2804ff | [
"Apache-2.0"
] | null | null | null | #
# This file contains the Python code from Program 2.3 of
# "Data Structures and Algorithms
# with Object-Oriented Design Patterns in Python"
# by Bruno R. Preiss.
#
# Copyright (c) 2003 by Bruno R. Preiss, P.Eng. All rights reserved.
#
# http://www.brpreiss.com/books/opus7/programs/pgm02_03.txt
#
def factorial(n):
... | 24.8125 | 69 | 0.672544 | # with Object-Oriented Design Patterns in Python"
def factorial(n):
if n == 0:
return 1
else:
return n * factorial(n - 1)
| true | true |
f77511bafe0516fff8ec8c37a85556e219685f25 | 3,971 | py | Python | mk_ldac_spec.py | deapplegate/wtgpipeline | 9693e8562022cc97bf5a96427e22965e1a5e8497 | [
"MIT"
] | 1 | 2019-03-15T04:01:19.000Z | 2019-03-15T04:01:19.000Z | mk_ldac_spec.py | deapplegate/wtgpipeline | 9693e8562022cc97bf5a96427e22965e1a5e8497 | [
"MIT"
] | 5 | 2017-12-11T00:11:39.000Z | 2021-07-09T17:05:16.000Z | mk_ldac_spec.py | deapplegate/wtgpipeline | 9693e8562022cc97bf5a96427e22965e1a5e8497 | [
"MIT"
] | 2 | 2017-08-15T21:19:11.000Z | 2017-10-12T00:36:35.000Z |
def run(cluster, detect):
import os
import MySQLdb
import os, sys, anydbm, time
#from config import datb, dataloc
#from config_bonn import cluster
#cluster = sys.argv[1]
#detect = sys.argv[2]
SUBARUDIR = '/nfs/slac/g/ki/ki05/anja/SUBARU/'
output = SUBARUDIR + cluster + '/PHOTOME... | 33.652542 | 156 | 0.410224 |
def run(cluster, detect):
import os
import MySQLdb
import os, sys, anydbm, time
SUBARUDIR = '/nfs/slac/g/ki/ki05/anja/SUBARU/'
output = SUBARUDIR + cluster + '/PHOTOMETRY_' + detect + '_aper/' + cluster + 'spec.cat'
import lib
os.system("mkdir " + cluster... | false | true |
f77511c9b2c44564e540dc47c408600d65ff6e29 | 4,741 | py | Python | calm/dsl/cli/groups.py | tuxtof/calm-dsl | 5af67435d8304b97e170a690068f2d5975e9bfe6 | [
"Apache-2.0"
] | 1 | 2021-01-20T04:44:13.000Z | 2021-01-20T04:44:13.000Z | calm/dsl/cli/groups.py | gabybeitler/calm-dsl | bac453413cfcf800eef95d89d5a7323c83654a93 | [
"Apache-2.0"
] | null | null | null | calm/dsl/cli/groups.py | gabybeitler/calm-dsl | bac453413cfcf800eef95d89d5a7323c83654a93 | [
"Apache-2.0"
] | null | null | null | import click
import json
import sys
from prettytable import PrettyTable
from calm.dsl.api import get_api_client
from calm.dsl.builtins import Ref
from .task_commands import watch_task
from .constants import ERGON_TASK
from calm.dsl.config import get_context
from calm.dsl.store import Cache
from calm.dsl.constants impo... | 29.08589 | 112 | 0.598186 | import click
import json
import sys
from prettytable import PrettyTable
from calm.dsl.api import get_api_client
from calm.dsl.builtins import Ref
from .task_commands import watch_task
from .constants import ERGON_TASK
from calm.dsl.config import get_context
from calm.dsl.store import Cache
from calm.dsl.constants impo... | true | true |
f7751227d5fdfb2ce6982471279f87ea223bf1ff | 7,749 | py | Python | test/unit/data/test_data.py | rozlana-g/FEDOT | a909d6c0ef481cc1cf7a5f10f7b1292d8d2def5c | [
"BSD-3-Clause"
] | 358 | 2020-06-11T09:34:53.000Z | 2022-03-31T12:56:22.000Z | test/unit/data/test_data.py | rozlana-g/FEDOT | a909d6c0ef481cc1cf7a5f10f7b1292d8d2def5c | [
"BSD-3-Clause"
] | 467 | 2020-06-11T13:49:45.000Z | 2022-03-31T14:19:48.000Z | test/unit/data/test_data.py | rozlana-g/FEDOT | a909d6c0ef481cc1cf7a5f10f7b1292d8d2def5c | [
"BSD-3-Clause"
] | 48 | 2020-07-13T14:50:45.000Z | 2022-03-26T09:37:13.000Z | import os
from copy import deepcopy
import numpy as np
import pandas as pd
import pytest
from sklearn.datasets import load_iris
from fedot.core.data.data import InputData, OutputData
from fedot.core.data.multi_modal import MultiModalData
from fedot.core.repository.dataset_types import DataTypesEnum
from fedot.core.re... | 36.9 | 89 | 0.682153 | import os
from copy import deepcopy
import numpy as np
import pandas as pd
import pytest
from sklearn.datasets import load_iris
from fedot.core.data.data import InputData, OutputData
from fedot.core.data.multi_modal import MultiModalData
from fedot.core.repository.dataset_types import DataTypesEnum
from fedot.core.re... | true | true |
f7751357152eb004d100fdc7711df0be5a00bc60 | 11,997 | py | Python | manila/data/manager.py | kpawar89/manila | d487c2db728cedf8357b9f4acbc0a45c21c3a83e | [
"Apache-2.0"
] | null | null | null | manila/data/manager.py | kpawar89/manila | d487c2db728cedf8357b9f4acbc0a45c21c3a83e | [
"Apache-2.0"
] | null | null | null | manila/data/manager.py | kpawar89/manila | d487c2db728cedf8357b9f4acbc0a45c21c3a83e | [
"Apache-2.0"
] | null | null | null | # Copyright 2015, Hitachi Data Systems.
#
# 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 la... | 40.530405 | 79 | 0.596816 |
import os
from oslo_config import cfg
from oslo_log import log
from manila.common import constants
from manila import context
from manila.data import helper
from manila.data import utils as data_utils
from manila import exception
from manila import manager
from manila.share import rpcapi as share_rpc
from manila.i... | true | true |
f77513a200cf070432b01ca876d1ffacd6cec457 | 826 | py | Python | eggmorning/urls.py | beautifultools/eggmorning-django | 2f805088bcf8f2473bd742e76267364c6985074e | [
"MIT",
"Unlicense"
] | null | null | null | eggmorning/urls.py | beautifultools/eggmorning-django | 2f805088bcf8f2473bd742e76267364c6985074e | [
"MIT",
"Unlicense"
] | null | null | null | eggmorning/urls.py | beautifultools/eggmorning-django | 2f805088bcf8f2473bd742e76267364c6985074e | [
"MIT",
"Unlicense"
] | null | null | null | from django.urls import path
from .views import slide
from .views import user
from .views import etc
from .views import rank
urlpatterns = [
path('', etc.index, name='index'),
path('main/slide', slide.get_main_slide_list, name='main_slide'),
path('main/slide/create/dummy', slide.create_dummy_slide, name='... | 37.545455 | 89 | 0.713075 | from django.urls import path
from .views import slide
from .views import user
from .views import etc
from .views import rank
urlpatterns = [
path('', etc.index, name='index'),
path('main/slide', slide.get_main_slide_list, name='main_slide'),
path('main/slide/create/dummy', slide.create_dummy_slide, name='... | true | true |
f77514063653e7ecd2c62a78a8a22c6d42137d2e | 281 | py | Python | src/tests/v14/test_issue_126.py | TetianaHrunyk/FireO | d837f253a6816b173a392c0007654acfd3a5ab13 | [
"Apache-2.0"
] | 231 | 2019-10-27T10:52:54.000Z | 2022-03-22T10:25:21.000Z | src/tests/v14/test_issue_126.py | TetianaHrunyk/FireO | d837f253a6816b173a392c0007654acfd3a5ab13 | [
"Apache-2.0"
] | 97 | 2019-10-26T09:21:47.000Z | 2022-03-26T04:41:57.000Z | src/tests/v14/test_issue_126.py | TetianaHrunyk/FireO | d837f253a6816b173a392c0007654acfd3a5ab13 | [
"Apache-2.0"
] | 34 | 2019-10-30T18:57:05.000Z | 2022-02-14T17:07:02.000Z | from fireo.fields import TextField, NumberField
from fireo.models import Model
class City(Model):
name = TextField()
population = NumberField()
def test_issue_126():
city = City.collection.create(name='NYC', population=500000, no_return=True)
assert city == None | 25.545455 | 80 | 0.733096 | from fireo.fields import TextField, NumberField
from fireo.models import Model
class City(Model):
name = TextField()
population = NumberField()
def test_issue_126():
city = City.collection.create(name='NYC', population=500000, no_return=True)
assert city == None | true | true |
f77514d20bf1b486d24c4b98620087efa1343296 | 3,825 | py | Python | vahun_cmd.py | evelkey/vahun | a7967ffd9d8e27911888057b4906fc4221c2a6fe | [
"Apache-2.0"
] | 1 | 2017-03-28T09:49:52.000Z | 2017-03-28T09:49:52.000Z | vahun_cmd.py | evelkey/vahun | a7967ffd9d8e27911888057b4906fc4221c2a6fe | [
"Apache-2.0"
] | null | null | null | vahun_cmd.py | evelkey/vahun | a7967ffd9d8e27911888057b4906fc4221c2a6fe | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import tensorflow as tf
import sys
import numpy as np
from vahun.corpus import Corpus
from vahun.genetic import evolution
from vahun.genetic import experiment
from vahun.tools import Timer
from vahun.tools import explog
fro... | 45 | 168 | 0.699869 | import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import tensorflow as tf
import sys
import numpy as np
from vahun.corpus import Corpus
from vahun.genetic import evolution
from vahun.genetic import experiment
from vahun.tools import Timer
from vahun.tools import explog
from vahun.autoencoder import Autoencoder_ffnn
fr... | true | true |
f77514d27fb0ec29beb0fe0f912ee216d09aea10 | 926 | py | Python | venv/lib/python3.8/site-packages/ansible/plugins/doc_fragments/validate.py | saeedya/docker-ansible | 6fb0cfc6bc4a5925b21380952a5a4502ec02119a | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/ansible/plugins/doc_fragments/validate.py | saeedya/docker-ansible | 6fb0cfc6bc4a5925b21380952a5a4502ec02119a | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/ansible/plugins/doc_fragments/validate.py | saeedya/docker-ansible | 6fb0cfc6bc4a5925b21380952a5a4502ec02119a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright: (c) 2015, Ansible, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
class ModuleDocFragment(object):
# Standard documentation fragment
D... | 42.090909 | 119 | 0.740821 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
class ModuleDocFragment(object):
DOCUMENTATION = r'''
options:
validate:
description:
- The validation command to run before copying the updated file into the final destination.
- A temporary file path is us... | true | true |
f775155351b663b2033635a6868ec154d1d8f75a | 2,999 | py | Python | test_backs_direction_matrix.py | pwcberry/footy-simulator-python | ece16c89723030e4a4729eec299b2585cf2014a9 | [
"MIT"
] | null | null | null | test_backs_direction_matrix.py | pwcberry/footy-simulator-python | ece16c89723030e4a4729eec299b2585cf2014a9 | [
"MIT"
] | null | null | null | test_backs_direction_matrix.py | pwcberry/footy-simulator-python | ece16c89723030e4a4729eec299b2585cf2014a9 | [
"MIT"
] | null | null | null | import unittest
from data import Skills
from status import BallDirection, FieldZone, Possession
from backs_direction_matrix import BacksDirectionMatrix
class TestBacksDirectionMatrix(unittest.TestCase):
def setUp(self):
self.states = [
BallDirection.NONE, BallDirection.FORWARD,
Bal... | 39.460526 | 76 | 0.7009 | import unittest
from data import Skills
from status import BallDirection, FieldZone, Possession
from backs_direction_matrix import BacksDirectionMatrix
class TestBacksDirectionMatrix(unittest.TestCase):
def setUp(self):
self.states = [
BallDirection.NONE, BallDirection.FORWARD,
Bal... | true | true |
f775162128a9c8a18c6fa95c9a3124aee6fcf07a | 2,526 | py | Python | google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/resources/types/group_placement_view.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/resources/types/group_placement_view.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/resources/types/group_placement_view.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 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... | 30.804878 | 93 | 0.65479 | import proto
from google.ads.googleads.v8.enums.types import placement_type as gage_placement_type
__protobuf__ = proto.module(
package='google.ads.googleads.v8.resources',
marshal='google.ads.googleads.v8',
manifest={
'GroupPlacementView',
},
)
class GroupPlacementView(proto.Message):
... | true | true |
f7751636a23182b341b36381f2fd34c32d242505 | 1,651 | py | Python | See/Model_001_f00/submit.py | arc144/siim-pneumothorax | 98fdb1fe08e9c001e0191d5024ba6c56ec82a9c8 | [
"MIT"
] | 18 | 2019-09-08T02:12:52.000Z | 2021-09-11T09:45:53.000Z | See/Model_001_f00/submit.py | rajatmodi62/siim-pneumothorax | 98fdb1fe08e9c001e0191d5024ba6c56ec82a9c8 | [
"MIT"
] | 10 | 2020-03-24T17:36:36.000Z | 2022-01-13T01:35:43.000Z | See/Model_001_f00/submit.py | rajatmodi62/siim-pneumothorax | 98fdb1fe08e9c001e0191d5024ba6c56ec82a9c8 | [
"MIT"
] | 9 | 2019-09-09T06:03:26.000Z | 2021-04-11T13:28:46.000Z | import pandas as pd
from zipfile import ZipFile
import torch as th
import cv2
import numpy as np
import os
from glob import glob
import pydicom
from matplotlib import pyplot as plt
from segmentation_model import FPNSegmentation
def main():
train_image_fns = sorted(glob(os.path.join(
'dicom-images-train', '*/*... | 28.964912 | 73 | 0.618413 | import pandas as pd
from zipfile import ZipFile
import torch as th
import cv2
import numpy as np
import os
from glob import glob
import pydicom
from matplotlib import pyplot as plt
from segmentation_model import FPNSegmentation
def main():
train_image_fns = sorted(glob(os.path.join(
'dicom-images-train', '*/*... | true | true |
f775172c595f748449a78dfabda3d87e18d98450 | 2,911 | py | Python | scripts/us_epa/ghgrp/gas_test.py | thejeshgn/data | 945af2e1269b914ff1e3169880169161f4137a58 | [
"Apache-2.0"
] | 25 | 2020-07-18T04:44:57.000Z | 2022-03-03T14:44:20.000Z | scripts/us_epa/ghgrp/gas_test.py | thejeshgn/data | 945af2e1269b914ff1e3169880169161f4137a58 | [
"Apache-2.0"
] | 276 | 2020-05-09T00:57:50.000Z | 2022-03-29T23:27:38.000Z | scripts/us_epa/ghgrp/gas_test.py | thejeshgn/data | 945af2e1269b914ff1e3169880169161f4137a58 | [
"Apache-2.0"
] | 59 | 2020-05-09T00:45:30.000Z | 2022-03-28T16:03:53.000Z | # Copyright 2021 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 41.585714 | 81 | 0.674339 |
import os
import sys
import unittest
sys.path.append(
os.path.dirname(os.path.dirname(os.path.dirname(
os.path.abspath(__file__)))))
from us_epa.ghgrp import gas
class GasTest(unittest.TestCase):
def test_name_to_dcid(self):
GAS_COL_NAMES_TO_DCID = {
'Total reported direct emiss... | true | true |
f77517fbb56357d003de257df86fa86a76d08ea4 | 1,555 | py | Python | nipype/interfaces/semtools/filtering/tests/test_auto_CannySegmentationLevelSetImageFilter.py | dPys/nipype | 75030b29297808e7c9a9e91b411b685154dff60b | [
"Apache-2.0"
] | 1 | 2019-03-25T14:11:18.000Z | 2019-03-25T14:11:18.000Z | nipype/interfaces/semtools/filtering/tests/test_auto_CannySegmentationLevelSetImageFilter.py | dPys/nipype | 75030b29297808e7c9a9e91b411b685154dff60b | [
"Apache-2.0"
] | 1 | 2017-01-05T01:24:33.000Z | 2017-01-05T01:24:33.000Z | nipype/interfaces/semtools/filtering/tests/test_auto_CannySegmentationLevelSetImageFilter.py | wtriplett/nipype | 388f140fceaf55438a987e9cdfa2a8e995428afd | [
"Apache-2.0"
] | 1 | 2020-12-16T16:36:48.000Z | 2020-12-16T16:36:48.000Z | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..featuredetection import CannySegmentationLevelSetImageFilter
def test_CannySegmentationLevelSetImageFilter_inputs():
input_map = dict(
advectionWeight=dict(argstr="--advectionWeight %f",),
args=dict(argstr="%s",),
cannyThreshold=... | 44.428571 | 86 | 0.696463 | from ..featuredetection import CannySegmentationLevelSetImageFilter
def test_CannySegmentationLevelSetImageFilter_inputs():
input_map = dict(
advectionWeight=dict(argstr="--advectionWeight %f",),
args=dict(argstr="%s",),
cannyThreshold=dict(argstr="--cannyThreshold %f",),
cannyVari... | true | true |
f775184166f4e5b5424b79cd96a6812b12395074 | 4,216 | py | Python | src/m3e_button_callback.py | DerrickSwart/24-Tkinter | 1f0c1bec19006ef7f78fb56f30107decbba90517 | [
"MIT"
] | null | null | null | src/m3e_button_callback.py | DerrickSwart/24-Tkinter | 1f0c1bec19006ef7f78fb56f30107decbba90517 | [
"MIT"
] | null | null | null | src/m3e_button_callback.py | DerrickSwart/24-Tkinter | 1f0c1bec19006ef7f78fb56f30107decbba90517 | [
"MIT"
] | null | null | null | """
Example showing for tkinter and ttk:
-- How to CONSTRUCT and DISPLAY a WIDGET
(in this case, a ttk.Button)
-- How to associate a widget (here, a ttk.Button)
with a CALLBACK function that is a LAMBDA (anonymous) function.
Authors: David Mutchler, Vibha Alangar, Matt Boutell, Dave Fisher,
... | 35.133333 | 79 | 0.566651 |
import tkinter
from tkinter import ttk
import random
def main():
root = tkinter.Tk()
frame1 = ttk.Frame(root, padding=10)
frame1.grid()
print_stuff_button = ttk.Button(frame1, text='Print stuff')
print_stuff_button['command'] = (lambda:
do_stuff())
print... | true | true |
f77518ae8e9eb2dddbb9d74fbfbedf591908e51c | 10,711 | py | Python | contrib/devtools/update-translations.py | ogcnode/org | 467cf82917a83ebf80e2eaaa730c43e3f60c2fef | [
"MIT"
] | null | null | null | contrib/devtools/update-translations.py | ogcnode/org | 467cf82917a83ebf80e2eaaa730c43e3f60c2fef | [
"MIT"
] | null | null | null | contrib/devtools/update-translations.py | ogcnode/org | 467cf82917a83ebf80e2eaaa730c43e3f60c2fef | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the foll... | 39.378676 | 154 | 0.632527 | import argparse
import subprocess
import re
import sys
import os
import io
import xml.etree.ElementTree as ET
TX = 'tx'
SOURCE_LANG = 'ogcnode_en.ts'
LOCALE_DIR = 'src/qt/locale'
MIN_NUM_MESSAGES = 10
MINIMUM_PERC = 80
GIT = os.getenv("GIT", "git")
def check_at_repository_root():
if not os.path.exists('.git'):
... | true | true |
f7751a5a5d5988c56723f6e65b7e371be73e9524 | 30,316 | py | Python | autogl/solver/classifier/graph_classifier.py | THUMNLab/AutoGL | 9dfcabcda41620a7d12d6322f0e52e68dd7dcec4 | [
"Apache-2.0"
] | 824 | 2020-11-30T14:38:07.000Z | 2022-03-19T10:14:04.000Z | autogl/solver/classifier/graph_classifier.py | MitchellTesla/AutoGL | 7b551961e90f5042d9b91d92c083f3f09dd9dbdd | [
"Apache-2.0"
] | 38 | 2020-12-21T12:32:57.000Z | 2022-01-31T02:32:05.000Z | autogl/solver/classifier/graph_classifier.py | MitchellTesla/AutoGL | 7b551961e90f5042d9b91d92c083f3f09dd9dbdd | [
"Apache-2.0"
] | 85 | 2020-12-21T05:16:09.000Z | 2022-03-28T08:44:22.000Z | """
Auto Classfier for Graph Node Classification
"""
import time
import json
from copy import deepcopy
import torch
import numpy as np
import yaml
from .base import BaseClassifier
from ...module.feature import FEATURE_DICT
from ...module.model import BaseModel, MODEL_DICT
from ...module.train import TRAINER_DICT, ge... | 38.472081 | 97 | 0.565279 | import time
import json
from copy import deepcopy
import torch
import numpy as np
import yaml
from .base import BaseClassifier
from ...module.feature import FEATURE_DICT
from ...module.model import BaseModel, MODEL_DICT
from ...module.train import TRAINER_DICT, get_feval, BaseGraphClassificationTrainer
from ..base i... | true | true |
f7751ca2bfd15f5b88b0f83e84b9897d71c49f2e | 983 | py | Python | portfolio/templatetags/portfolio_tags.py | raymcbride/django-portfolio | 5e03be618b0d5370875ab0168b16e93d882ec6e6 | [
"BSD-2-Clause"
] | null | null | null | portfolio/templatetags/portfolio_tags.py | raymcbride/django-portfolio | 5e03be618b0d5370875ab0168b16e93d882ec6e6 | [
"BSD-2-Clause"
] | null | null | null | portfolio/templatetags/portfolio_tags.py | raymcbride/django-portfolio | 5e03be618b0d5370875ab0168b16e93d882ec6e6 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import markdown
from django import template
from portfolio.models import (Artifact, FileArtifact, ImageArtifact,
TextArtifact)
register = template.Library()
@register.assignment_tag()
def get_artifact_list(project, artifa... | 28.911765 | 68 | 0.670397 | from __future__ import unicode_literals
import markdown
from django import template
from portfolio.models import (Artifact, FileArtifact, ImageArtifact,
TextArtifact)
register = template.Library()
@register.assignment_tag()
def get_artifact_list(project, artifact_type=""):
if arti... | true | true |
f7751cc59495fc9b451c8b32c511b1e34eb251b5 | 1,099 | py | Python | {{cookiecutter.repo_name}}/setup.py | naidu-rohit/ds_template | fad5f103781168bde53b43a8734fc27198a5c887 | [
"MIT"
] | null | null | null | {{cookiecutter.repo_name}}/setup.py | naidu-rohit/ds_template | fad5f103781168bde53b43a8734fc27198a5c887 | [
"MIT"
] | null | null | null | {{cookiecutter.repo_name}}/setup.py | naidu-rohit/ds_template | fad5f103781168bde53b43a8734fc27198a5c887 | [
"MIT"
] | null | null | null | import io
import os
import re
from setuptools import find_packages
from setuptools import setup
def read(filename):
filename = os.path.join(os.path.dirname(__file__), filename)
text_type = type(u"")
with io.open(filename, mode="r", encoding="utf-8") as fd:
return re.sub(text_type(r":[a-z]+:`~?(.*... | 26.804878 | 87 | 0.636943 | import io
import os
import re
from setuptools import find_packages
from setuptools import setup
def read(filename):
filename = os.path.join(os.path.dirname(__file__), filename)
text_type = type(u"")
with io.open(filename, mode="r", encoding="utf-8") as fd:
return re.sub(text_type(r":[a-z]+:`~?(.*... | true | true |
f7751f270918457ad4ea2e4327947807184080e6 | 3,650 | py | Python | oneflow/python/test/ops/test_image_decode.py | Gavin-Hoang/oneflow | 38d9e15d22c6c62827456b097a1d50adda67ca9b | [
"Apache-2.0"
] | 1 | 2020-12-04T03:06:16.000Z | 2020-12-04T03:06:16.000Z | oneflow/python/test/ops/test_image_decode.py | weibao918/oneflow | 320038ff5efd948516f7259442190f9b31f75027 | [
"Apache-2.0"
] | null | null | null | oneflow/python/test/ops/test_image_decode.py | weibao918/oneflow | 320038ff5efd948516f7259442190f9b31f75027 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow 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 applicable law or agr... | 36.5 | 86 | 0.687945 | import numpy as np
import oneflow as flow
from PIL import Image
import oneflow.typing as oft
def _of_image_decode(images):
image_files = [open(im, "rb") for im in images]
images_bytes = [imf.read() for imf in image_files]
static_shape = (len(images_bytes), max([len(bys) for bys in images_bytes]))
for ... | true | true |
f775210cc4084289483158b31f7eac2b59fb7d32 | 3,337 | py | Python | tests/test_evaluation.py | despawnerer/computer | 31d83b176b3ee6e6b85dd1282ecbc9820b615003 | [
"MIT"
] | 2 | 2016-01-26T11:31:04.000Z | 2016-05-18T17:05:20.000Z | tests/test_evaluation.py | despawnerer/computer | 31d83b176b3ee6e6b85dd1282ecbc9820b615003 | [
"MIT"
] | null | null | null | tests/test_evaluation.py | despawnerer/computer | 31d83b176b3ee6e6b85dd1282ecbc9820b615003 | [
"MIT"
] | null | null | null | from unittest import TestCase
from computer import (
evaluate,
BadExpression,
UndefinedVariable,
UnsupportedOperation,
)
class BasicMathTestCase(TestCase):
def test_addition(self):
self.assertEqual(evaluate('2 + 2'), 4)
def test_subtraction(self):
self.assertEqual(evaluate('5... | 29.017391 | 56 | 0.62721 | from unittest import TestCase
from computer import (
evaluate,
BadExpression,
UndefinedVariable,
UnsupportedOperation,
)
class BasicMathTestCase(TestCase):
def test_addition(self):
self.assertEqual(evaluate('2 + 2'), 4)
def test_subtraction(self):
self.assertEqual(evaluate('5... | true | true |
f775212c5cca7b20797403724422ed3d2b73a704 | 4,484 | py | Python | breathe.py | moridinamael/winbreathe | 7a237162d11e6986eeebe92cc142e10f58e2c047 | [
"MIT"
] | null | null | null | breathe.py | moridinamael/winbreathe | 7a237162d11e6986eeebe92cc142e10f58e2c047 | [
"MIT"
] | null | null | null | breathe.py | moridinamael/winbreathe | 7a237162d11e6986eeebe92cc142e10f58e2c047 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 31 12:22:57 2020
@author: Matt
"""
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 20 14:50:25 2020
@author: Matt
"""
from kivy.clock import Clock
from kivy.properties import ListProperty
from kivy.uix.widget import Widget
from kivy.properties import NumericProperty
fro... | 31.577465 | 141 | 0.557761 |
from kivy.clock import Clock
from kivy.properties import ListProperty
from kivy.uix.widget import Widget
from kivy.properties import NumericProperty
from kivy.graphics import Ellipse
from kivy.graphics import Color, Rectangle
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.image import Image
from kivy.uix.ima... | true | true |
f77521a7c49dba39849869ddceb7c0e885147722 | 8,601 | py | Python | tensorflow/compiler/tests/momentum_test.py | Zwysilence/tensorflow | b55001be83da044bb21d539d433dec6231eaec55 | [
"Apache-2.0"
] | 52 | 2018-11-12T06:39:35.000Z | 2022-03-08T05:31:27.000Z | tensorflow/compiler/tests/momentum_test.py | Zwysilence/tensorflow | b55001be83da044bb21d539d433dec6231eaec55 | [
"Apache-2.0"
] | 2 | 2018-12-04T08:35:40.000Z | 2020-10-22T16:17:39.000Z | tensorflow/compiler/tests/momentum_test.py | Zwysilence/tensorflow | b55001be83da044bb21d539d433dec6231eaec55 | [
"Apache-2.0"
] | 17 | 2019-03-11T01:17:16.000Z | 2022-02-21T00:44:47.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 48.050279 | 80 | 0.62516 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.compiler.tests import xla_test
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.ops import array_ops... | true | true |
f77523415a4ab2983025d45346bb78f8edd3beba | 7,880 | py | Python | tests/unit/test__retry.py | crwilcox/python-ndb | fc31553c77f6e7865df0efd4c820f69366f6607c | [
"Apache-2.0"
] | null | null | null | tests/unit/test__retry.py | crwilcox/python-ndb | fc31553c77f6e7865df0efd4c820f69366f6607c | [
"Apache-2.0"
] | null | null | null | tests/unit/test__retry.py | crwilcox/python-ndb | fc31553c77f6e7865df0efd4c820f69366f6607c | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 35.022222 | 79 | 0.697716 |
import itertools
try:
from unittest import mock
except ImportError: import mock
import pytest
from google.api_core import exceptions as core_exceptions
from google.cloud.ndb import _retry
from google.cloud.ndb import tasklets
from . import utils
class Test_retry:
@staticmethod
@pytest.mark.usefi... | true | true |
f775242af7422496541cad54251b3607e6a782b0 | 1,149 | py | Python | test/test_get_gender_response.py | doc22940/cloudmersive.apiclient.python | 8646291f45ebd7c6572a296e30f693693a6782c4 | [
"Apache-2.0"
] | 3 | 2018-06-23T21:37:21.000Z | 2020-04-20T23:07:36.000Z | test/test_get_gender_response.py | doc22940/cloudmersive.apiclient.python | 8646291f45ebd7c6572a296e30f693693a6782c4 | [
"Apache-2.0"
] | 1 | 2019-02-04T17:03:35.000Z | 2019-03-02T20:16:52.000Z | test/test_get_gender_response.py | doc22940/cloudmersive.apiclient.python | 8646291f45ebd7c6572a296e30f693693a6782c4 | [
"Apache-2.0"
] | 2 | 2019-03-21T15:54:15.000Z | 2020-05-27T17:30:43.000Z | # coding: utf-8
"""
validateapi
The validation APIs help you validate data. Check if an E-mail address is real. Check if a domain is real. Check up on an IP address, and even where it is located. All this and much more is available in the validation API. # noqa: E501
OpenAPI spec version: v1
Ge... | 28.02439 | 240 | 0.738033 |
from __future__ import absolute_import
import unittest
import cloudmersive_validate_api_client
from cloudmersive_validate_api_client.models.get_gender_response import GetGenderResponse from cloudmersive_validate_api_client.rest import ApiException
class TestGetGenderResponse(unittest.TestCase):
def setUp(s... | true | true |
f77525f8331d3f422446d4a6bd164b22770b5b4a | 2,285 | py | Python | vitrage-4.3.1/vitrage/evaluator/template_validation/content/v2/execute_mistral_validator.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 89 | 2015-09-30T21:42:17.000Z | 2022-03-28T16:31:19.000Z | vitrage-4.3.1/vitrage/evaluator/template_validation/content/v2/execute_mistral_validator.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | vitrage-4.3.1/vitrage/evaluator/template_validation/content/v2/execute_mistral_validator.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 43 | 2015-11-04T15:54:27.000Z | 2021-12-10T14:24:03.000Z | # Copyright 2017 - Nokia
#
# 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, sof... | 38.728814 | 78 | 0.740481 |
from oslo_log import log
import re
from vitrage.evaluator.actions.recipes.execute_mistral import INPUT
from vitrage.evaluator.actions.recipes.execute_mistral import WORKFLOW
from vitrage.evaluator.template_fields import TemplateFields
from vitrage.evaluator.template_functions.function_resolver import is_function
from... | true | true |
f7752615ea70ed5e8920e3b61c0a8c82acf98f0d | 2,427 | py | Python | bayesnet/tensor/tensor.py | ctgk/bayes | 96eab9305eaeecc5a5b032cdf92a8285de4f60bf | [
"MIT"
] | 21 | 2019-01-08T05:58:41.000Z | 2021-11-26T14:24:11.000Z | bayesnet/tensor/tensor.py | ctgk/bayes | 96eab9305eaeecc5a5b032cdf92a8285de4f60bf | [
"MIT"
] | null | null | null | bayesnet/tensor/tensor.py | ctgk/bayes | 96eab9305eaeecc5a5b032cdf92a8285de4f60bf | [
"MIT"
] | 11 | 2019-05-04T13:44:19.000Z | 2021-08-05T04:26:19.000Z | import numpy as np
class Tensor(object):
"""
a base class for tensor object
"""
__array_ufunc__ = None
def __init__(self, value, function=None):
"""
construct Tensor object
Parameters
----------
value : array_like
value of this tensor
f... | 26.380435 | 76 | 0.498146 | import numpy as np
class Tensor(object):
__array_ufunc__ = None
def __init__(self, value, function=None):
if not isinstance(value, (int, float, np.number, np.ndarray)):
raise TypeError(
"Unsupported class for Tensor: {}".format(type(value))
)
self.value... | true | true |
f77526955d07e03cb41eedbea50560849e460b51 | 3,136 | py | Python | setup.py | Jacaranda-Health/StyleFrame | 521219f7315fab51d672936c0187eb2e960d12d7 | [
"MIT"
] | null | null | null | setup.py | Jacaranda-Health/StyleFrame | 521219f7315fab51d672936c0187eb2e960d12d7 | [
"MIT"
] | null | null | null | setup.py | Jacaranda-Health/StyleFrame | 521219f7315fab51d672936c0187eb2e960d12d7 | [
"MIT"
] | null | null | null | import codecs
import os
import re
from setuptools import setup, find_packages
DESCRIPTION = 'A library that wraps pandas and openpyxl and allows easy styling of dataframes in excel. Documentation can be found at http://styleframe.readthedocs.org'
here = os.path.abspath(os.path.dirname(__file__)).lower()
def read(*... | 35.636364 | 168 | 0.660714 | import codecs
import os
import re
from setuptools import setup, find_packages
DESCRIPTION = 'A library that wraps pandas and openpyxl and allows easy styling of dataframes in excel. Documentation can be found at http://styleframe.readthedocs.org'
here = os.path.abspath(os.path.dirname(__file__)).lower()
def read(*... | true | true |
f775275c86db2758fb6f2b9bda735a77abf72bc6 | 2,617 | py | Python | app/data/models/user.py | Atheloses/Flask-Bones | 67d8de5abeeb5ca8e78ed247dec5a90eaa94bee0 | [
"MIT"
] | null | null | null | app/data/models/user.py | Atheloses/Flask-Bones | 67d8de5abeeb5ca8e78ed247dec5a90eaa94bee0 | [
"MIT"
] | null | null | null | app/data/models/user.py | Atheloses/Flask-Bones | 67d8de5abeeb5ca8e78ed247dec5a90eaa94bee0 | [
"MIT"
] | null | null | null | from flask.ext.login import UserMixin
from app.extensions import cache, bcrypt
from .. import db
from ..mixins import CRUDMixin
import datetime
class User(CRUDMixin, UserMixin, db.Model):
__tablename__ = "user"
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(20), nullable=Fal... | 33.987013 | 110 | 0.661062 | from flask.ext.login import UserMixin
from app.extensions import cache, bcrypt
from .. import db
from ..mixins import CRUDMixin
import datetime
class User(CRUDMixin, UserMixin, db.Model):
__tablename__ = "user"
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(20), nullable=Fal... | true | true |
f7752977c91be03c2890aa2ff60126ccf99fd7ad | 1,153 | py | Python | kubernetes/test/test_v1beta1_certificate_signing_request_condition.py | L3T/python | b6e4ae81a2afb49f668a142eb7d1c6e2571ef478 | [
"Apache-2.0"
] | 2 | 2020-06-21T08:03:18.000Z | 2020-06-21T09:53:29.000Z | kubernetes/test/test_v1beta1_certificate_signing_request_condition.py | L3T/python | b6e4ae81a2afb49f668a142eb7d1c6e2571ef478 | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1beta1_certificate_signing_request_condition.py | L3T/python | b6e4ae81a2afb49f668a142eb7d1c6e2571ef478 | [
"Apache-2.0"
] | 1 | 2020-06-21T08:03:17.000Z | 2020-06-21T08:03:17.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: release-1.16
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import... | 28.825 | 146 | 0.770165 |
from __future__ import absolute_import
import unittest
import kubernetes.client
from kubernetes.client.models.v1beta1_certificate_signing_request_condition import V1beta1CertificateSigningRequestCondition from kubernetes.client.rest import ApiException
class TestV1beta1CertificateSigningRequestCondition(unittes... | true | true |
f775298a4fb35a88565c18acbd4a1cc4cf7c14ce | 3,701 | py | Python | es_client.py | wangzhicheng2013/es_client | 52e1c4bcf369f25e1e274453bb85b38331ff236c | [
"MIT"
] | null | null | null | es_client.py | wangzhicheng2013/es_client | 52e1c4bcf369f25e1e274453bb85b38331ff236c | [
"MIT"
] | null | null | null | es_client.py | wangzhicheng2013/es_client | 52e1c4bcf369f25e1e274453bb85b38331ff236c | [
"MIT"
] | null | null | null | #!/usr/bin/python
import sys
import os
import signal
import time
import global_instance
from client_config import client_config
from json_utility import json_utility_instance
from file_handler import file_handler
from daemonize import daemonize
from datetime import datetime
from elasticsearch import Elastics... | 41.122222 | 129 | 0.552283 | import sys
import os
import signal
import time
import global_instance
from client_config import client_config
from json_utility import json_utility_instance
from file_handler import file_handler
from daemonize import daemonize
from datetime import datetime
from elasticsearch import Elasticsearch
from elastic... | true | true |
f7752b95c32c5675600b5605f503817672dbbd1a | 389 | py | Python | src/RumorValidator/hostsconf/views.py | HarleyCody/rumor | 9642f2fcb19c2dd486e7a18258f9d1948fa1f8b2 | [
"bzip2-1.0.6"
] | null | null | null | src/RumorValidator/hostsconf/views.py | HarleyCody/rumor | 9642f2fcb19c2dd486e7a18258f9d1948fa1f8b2 | [
"bzip2-1.0.6"
] | 6 | 2020-06-05T20:55:19.000Z | 2021-09-22T18:32:17.000Z | src/RumorValidator/hostsconf/views.py | HarleyCody/rumor | 9642f2fcb19c2dd486e7a18258f9d1948fa1f8b2 | [
"bzip2-1.0.6"
] | null | null | null | from django.http import HttpResponse, HttpResponseRedirect
from src.RumorValidator import settings
DEFAULT_REFIRECT_URL = getattr(settings, "DEFAULT_REDIRECT_URL", "http://www.rumor.com:8000")
def wildcard_redirect(request, path=None):
new_url = DEFAULT_REFIRECT_URL
if path is not None:
new_url = DEFAU... | 43.222222 | 93 | 0.77635 | from django.http import HttpResponse, HttpResponseRedirect
from src.RumorValidator import settings
DEFAULT_REFIRECT_URL = getattr(settings, "DEFAULT_REDIRECT_URL", "http://www.rumor.com:8000")
def wildcard_redirect(request, path=None):
new_url = DEFAULT_REFIRECT_URL
if path is not None:
new_url = DEFAU... | true | true |
f7752bb8fc364145603120e3289d7dc4b5c9e45a | 47,591 | py | Python | bigquery/google/cloud/bigquery/table.py | mbrukman/gcloud-python | 3144f100cf9b38853776880a516ef5f65e4dd6da | [
"Apache-2.0"
] | null | null | null | bigquery/google/cloud/bigquery/table.py | mbrukman/gcloud-python | 3144f100cf9b38853776880a516ef5f65e4dd6da | [
"Apache-2.0"
] | null | null | null | bigquery/google/cloud/bigquery/table.py | mbrukman/gcloud-python | 3144f100cf9b38853776880a516ef5f65e4dd6da | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 36.053788 | 90 | 0.605009 |
import datetime
import os
import httplib2
import six
import google.auth.transport.requests
from google import resumable_media
from google.resumable_media.requests import MultipartUpload
from google.resumable_media.requests import ResumableUpload
from google.cloud._helpers import _datetime_from_microseconds
from go... | true | true |
f7752be468a4c944b8efe10e4127186cb012a077 | 1,165 | py | Python | data/p4VQE/R4/benchmark/startPyquil95.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startPyquil95.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startPyquil95.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=10
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program() # circuit begin
prog += H(0) # number=1
pr... | 22.843137 | 64 | 0.603433 | import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program()
prog += H(0) prog += Z(3) prog += H(1) prog += H(2) prog += H(3... | true | true |
f7752bef31c594cb71d6d6a8b2fb69a41aba922d | 255 | py | Python | scripts/ins_hugo_date.py | peteraba/dotfiles | 574bffce35d1239b579a9831f5e538fce00ec92d | [
"Unlicense"
] | 2 | 2017-07-06T14:20:37.000Z | 2018-05-14T19:46:54.000Z | scripts/ins_hugo_date.py | peteraba/dotfiles | 574bffce35d1239b579a9831f5e538fce00ec92d | [
"Unlicense"
] | null | null | null | scripts/ins_hugo_date.py | peteraba/dotfiles | 574bffce35d1239b579a9831f5e538fce00ec92d | [
"Unlicense"
] | null | null | null | #! /usr/bin/env python
from datetime import datetime
import tzlocal
import sys
now = datetime.now(tzlocal.get_localzone())
hugo_date = now.strftime("%Y-%m-%dT%H:%M:%S%z")
hugo_date = hugo_date[:-2] + ':' + hugo_date[-2:]
sys.stdout.write(hugo_date)
| 17 | 49 | 0.694118 |
from datetime import datetime
import tzlocal
import sys
now = datetime.now(tzlocal.get_localzone())
hugo_date = now.strftime("%Y-%m-%dT%H:%M:%S%z")
hugo_date = hugo_date[:-2] + ':' + hugo_date[-2:]
sys.stdout.write(hugo_date)
| true | true |
f7752c96eb23017ec85de1750970adb5684a88be | 1,441 | py | Python | example_app/example_app/dags/triggered_dag101.py | dhan16/airflow | 094e2fb59c7d4abfaeb8695f1b8b45b27adc4413 | [
"Apache-2.0"
] | null | null | null | example_app/example_app/dags/triggered_dag101.py | dhan16/airflow | 094e2fb59c7d4abfaeb8695f1b8b45b27adc4413 | [
"Apache-2.0"
] | null | null | null | example_app/example_app/dags/triggered_dag101.py | dhan16/airflow | 094e2fb59c7d4abfaeb8695f1b8b45b27adc4413 | [
"Apache-2.0"
] | null | null | null | import datetime as dt
import os
import sys
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.operators.python_operator import PythonOperator
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from example_app.dag_functions import ... | 25.732143 | 102 | 0.673838 | import datetime as dt
import os
import sys
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.operators.python_operator import PythonOperator
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from example_app.dag_functions import ... | true | true |
f7752ceb907f8fe9cd2a25de5216bfc0dff1a858 | 6,037 | py | Python | server/api/database/models/teacher.py | brayest/testcode | 865d31ccfaf75946620c36955cc3dcb395515796 | [
"Unlicense"
] | 652 | 2021-01-24T10:32:08.000Z | 2022-02-05T09:14:10.000Z | server/api/database/models/teacher.py | starhappy/Dryvo | 14c549a4f2265afd515bfd6f5f477a68187ea287 | [
"Unlicense"
] | 1 | 2021-01-27T05:09:14.000Z | 2021-02-01T06:21:05.000Z | server/api/database/models/teacher.py | starhappy/Dryvo | 14c549a4f2265afd515bfd6f5f477a68187ea287 | [
"Unlicense"
] | 147 | 2021-01-25T10:57:22.000Z | 2022-02-05T09:14:12.000Z | import functools
from datetime import datetime, timedelta
from typing import Dict, Iterable, List, Tuple, Optional
import werkzeug
from loguru import logger
from sqlalchemy import and_, func
from sqlalchemy.ext.hybrid import hybrid_method
from sqlalchemy.orm import backref
from server.api.database import db
from serv... | 39.201299 | 86 | 0.63939 | import functools
from datetime import datetime, timedelta
from typing import Dict, Iterable, List, Tuple, Optional
import werkzeug
from loguru import logger
from sqlalchemy import and_, func
from sqlalchemy.ext.hybrid import hybrid_method
from sqlalchemy.orm import backref
from server.api.database import db
from serv... | true | true |
f7752d262efb06cb83afd7ec25b0cbd6de1dbb56 | 7,218 | py | Python | src/scraper_mt.py | rohan22shah/se-phase-2 | 07309c0fd677b19c7fd0a84edb288dcf1138cd00 | [
"MIT"
] | null | null | null | src/scraper_mt.py | rohan22shah/se-phase-2 | 07309c0fd677b19c7fd0a84edb288dcf1138cd00 | [
"MIT"
] | null | null | null | src/scraper_mt.py | rohan22shah/se-phase-2 | 07309c0fd677b19c7fd0a84edb288dcf1138cd00 | [
"MIT"
] | null | null | null | # package imports
from bs4 import BeautifulSoup
import requests
from datetime import datetime
from threading import Thread
# local imports
import src.formattr as form
from src.configs_mt import AMAZON, WALMART, COSTCO, BESTBUY, scrape_ebay, scrape_target
#=======
#import src.scraper.formattr as form
#from src.scraper... | 31.797357 | 158 | 0.509144 | from bs4 import BeautifulSoup
import requests
from datetime import datetime
from threading import Thread
import src.formattr as form
from src.configs_mt import AMAZON, WALMART, COSTCO, BESTBUY, scrape_ebay, scrape_target
class search(Thread):
def __init__(self, query, config):
self.result = {}
se... | true | true |
f7752da5b020b74aa8fcd6883292b6bf6a9ca5dc | 11,701 | py | Python | mmdet/models/bbox_heads/bbox_head.py | dutxubo/mmdetection | 607d2fc0bdff5a8f07e6a92da899505bd083dfc5 | [
"Apache-2.0"
] | null | null | null | mmdet/models/bbox_heads/bbox_head.py | dutxubo/mmdetection | 607d2fc0bdff5a8f07e6a92da899505bd083dfc5 | [
"Apache-2.0"
] | null | null | null | mmdet/models/bbox_heads/bbox_head.py | dutxubo/mmdetection | 607d2fc0bdff5a8f07e6a92da899505bd083dfc5 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.utils import _pair
from mmdet.core import (auto_fp16, bbox_target, delta2bbox, force_fp32,
multiclass_nms)
from ..builder import build_loss
from ..losses import accuracy
from ..registry import HEADS
import ... | 40.348276 | 79 | 0.537646 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.utils import _pair
from mmdet.core import (auto_fp16, bbox_target, delta2bbox, force_fp32,
multiclass_nms)
from ..builder import build_loss
from ..losses import accuracy
from ..registry import HEADS
import ... | true | true |
f7752ee59551b011810af909d33ac27caf61f91d | 250,661 | py | Python | Lib/fontbakery/profiles/googlefonts.py | aurium/fontbakery | 44cda4624502f920a7be9f7d10fcfcee633a3194 | [
"Apache-2.0"
] | null | null | null | Lib/fontbakery/profiles/googlefonts.py | aurium/fontbakery | 44cda4624502f920a7be9f7d10fcfcee633a3194 | [
"Apache-2.0"
] | null | null | null | Lib/fontbakery/profiles/googlefonts.py | aurium/fontbakery | 44cda4624502f920a7be9f7d10fcfcee633a3194 | [
"Apache-2.0"
] | null | null | null | import os
from fontbakery.profiles.universal import UNIVERSAL_PROFILE_CHECKS
from fontbakery.status import INFO, WARN, ERROR, SKIP, PASS, FAIL
from fontbakery.section import Section
from fontbakery.callable import check, disable
from fontbakery.utils import filesize_formatting
from fontbakery.message import Message
fr... | 42.767616 | 682 | 0.596535 | import os
from fontbakery.profiles.universal import UNIVERSAL_PROFILE_CHECKS
from fontbakery.status import INFO, WARN, ERROR, SKIP, PASS, FAIL
from fontbakery.section import Section
from fontbakery.callable import check, disable
from fontbakery.utils import filesize_formatting
from fontbakery.message import Message
fr... | true | true |
f7752ef6a07feb20e2d2760dddc46c4e824db968 | 12,722 | py | Python | torch/utils/tensorboard/_pytorch_graph.py | MagiaSN/pytorch | 7513455c743d3d644b45a804902c1a0d14b69f45 | [
"Intel"
] | 206 | 2020-11-28T22:56:38.000Z | 2022-03-27T02:33:04.000Z | torch/utils/tensorboard/_pytorch_graph.py | MagiaSN/pytorch | 7513455c743d3d644b45a804902c1a0d14b69f45 | [
"Intel"
] | 19 | 2020-12-09T23:13:14.000Z | 2022-01-24T23:24:08.000Z | torch/utils/tensorboard/_pytorch_graph.py | MagiaSN/pytorch | 7513455c743d3d644b45a804902c1a0d14b69f45 | [
"Intel"
] | 28 | 2020-11-29T15:25:12.000Z | 2022-01-20T02:16:27.000Z | from collections import OrderedDict
from typing import Dict, Any
from tensorboard.compat.proto.config_pb2 import RunMetadata
from tensorboard.compat.proto.graph_pb2 import GraphDef
from tensorboard.compat.proto.step_stats_pb2 import StepStats, DeviceStepStats
from tensorboard.compat.proto.versions_pb2 import VersionDe... | 40.906752 | 123 | 0.622544 | from collections import OrderedDict
from typing import Dict, Any
from tensorboard.compat.proto.config_pb2 import RunMetadata
from tensorboard.compat.proto.graph_pb2 import GraphDef
from tensorboard.compat.proto.step_stats_pb2 import StepStats, DeviceStepStats
from tensorboard.compat.proto.versions_pb2 import VersionDe... | true | true |
f7752f15a556e5d9e7f2147faef4ede663de0856 | 22,480 | py | Python | indico/modules/events/registration/fields/choices.py | CrownedSilverFox/conference-platform | 1858a2908763dc7e4c29d3157369e9aab6064933 | [
"MIT"
] | 1 | 2021-02-24T10:20:14.000Z | 2021-02-24T10:20:14.000Z | indico/modules/events/registration/fields/choices.py | CrownedSilverFox/conference-platform | 1858a2908763dc7e4c29d3157369e9aab6064933 | [
"MIT"
] | 1 | 2021-07-24T17:10:51.000Z | 2021-07-24T17:10:51.000Z | indico/modules/events/registration/fields/choices.py | CrownedSilverFox/conference-platform | 1858a2908763dc7e4c29d3157369e9aab6064933 | [
"MIT"
] | null | null | null | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from collections import Counter
from copy import deepcopy
from datetime import date, datetime
from uuid im... | 50.516854 | 120 | 0.628915 |
from collections import Counter
from copy import deepcopy
from datetime import date, datetime
from uuid import uuid4
from sqlalchemy.dialects.postgresql import ARRAY
from wtforms.validators import ValidationError
from indico.core.db import db
from indico.modules.events.registration.fields.base import (RegistrationFo... | true | true |
f7752f9d12c74fc203da0db61d084e9896e323fc | 7,204 | py | Python | Lib/distutils/command/upload.py | steandre/cpython | f61ea44688b69d74d6b475f71623696f4804eb0f | [
"PSF-2.0"
] | 1 | 2021-02-24T15:31:45.000Z | 2021-02-24T15:31:45.000Z | Lib/distutils/command/upload.py | steandre/cpython | f61ea44688b69d74d6b475f71623696f4804eb0f | [
"PSF-2.0"
] | null | null | null | Lib/distutils/command/upload.py | steandre/cpython | f61ea44688b69d74d6b475f71623696f4804eb0f | [
"PSF-2.0"
] | null | null | null | """
distutils.command.upload
Implements the Distutils 'upload' subcommand (upload package to a package
index).
"""
import os
import io
import platform
import hashlib
from base64 import standard_b64encode
from urllib.request import urlopen, Request, HTTPError
from urllib.parse import urlparse
from distutils.errors imp... | 36.02 | 74 | 0.558162 |
import os
import io
import platform
import hashlib
from base64 import standard_b64encode
from urllib.request import urlopen, Request, HTTPError
from urllib.parse import urlparse
from distutils.errors import DistutilsError, DistutilsOptionError
from distutils.core import PyPIRCCommand
from distutils.spawn import spawn
... | true | true |
f7753080f5a3cd449738829070560d86fc0949c0 | 835 | py | Python | data_manipulation.py | ITWSDataScience/EducationFundingAnalysisInCaliforniaGroup3Fall2021 | 1c7fb5265fb0a354c2a8a438fbe00f073667c397 | [
"MIT"
] | null | null | null | data_manipulation.py | ITWSDataScience/EducationFundingAnalysisInCaliforniaGroup3Fall2021 | 1c7fb5265fb0a354c2a8a438fbe00f073667c397 | [
"MIT"
] | null | null | null | data_manipulation.py | ITWSDataScience/EducationFundingAnalysisInCaliforniaGroup3Fall2021 | 1c7fb5265fb0a354c2a8a438fbe00f073667c397 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Data Manipulation
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1dnbNHRyDzukEq2IVv2Bx2tdzVEbLZJc0
"""
import pandas as pd
df1 = pd.read_csv("district_school_data.csv")
df2 = pd.read_csv("district_expense_data.csv")
d = {'D... | 30.925926 | 173 | 0.663473 |
import pandas as pd
df1 = pd.read_csv("district_school_data.csv")
df2 = pd.read_csv("district_expense_data.csv")
d = {'District': [], 'County': [], 'Students':[], 'Graduation Rate':[], 'Cost':[]}
df3 = pd.DataFrame(data=d)
for i1, row1 in df1.iterrows():
for i2, row2 in df2.iterrows():
if row1['District'] == r... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.