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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7756f019243eff4a08bda298f52f878182d900b | 807 | py | Python | crownstone_core/packets/serviceDataParsers/containers/AdvHubState.py | crownstone/crownstone-lib-python-core | e50eaae8680614c030df186aa06f13c9b20ac9ba | [
"MIT"
] | null | null | null | crownstone_core/packets/serviceDataParsers/containers/AdvHubState.py | crownstone/crownstone-lib-python-core | e50eaae8680614c030df186aa06f13c9b20ac9ba | [
"MIT"
] | 3 | 2020-08-04T19:32:03.000Z | 2021-10-06T09:07:08.000Z | crownstone_core/packets/serviceDataParsers/containers/AdvHubState.py | crownstone/crownstone-lib-python-core | e50eaae8680614c030df186aa06f13c9b20ac9ba | [
"MIT"
] | null | null | null | from crownstone_core.packets.serviceDataParsers.containers.elements.AdvTypes import AdvType
class AdvHubState:
def __init__(self):
self.type = AdvType.HUB_STATE
self.crownstoneId = None
self.hubFlags = None
self.hubData = None
self.timestamp = N... | 35.086957 | 91 | 0.542751 | from crownstone_core.packets.serviceDataParsers.containers.elements.AdvTypes import AdvType
class AdvHubState:
def __init__(self):
self.type = AdvType.HUB_STATE
self.crownstoneId = None
self.hubFlags = None
self.hubData = None
self.timestamp = N... | true | true |
f7756f706d24af94baa152c0884d7c89d79707d9 | 580 | py | Python | tools/scripts/b64map_c_gen.py | joeedh/webblender | 552d8eaa762af447346343be244647c316ae32f1 | [
"Apache-2.0"
] | 1 | 2015-05-22T14:11:17.000Z | 2015-05-22T14:11:17.000Z | tools/scripts/b64map_c_gen.py | joeedh/webblender | 552d8eaa762af447346343be244647c316ae32f1 | [
"Apache-2.0"
] | 2 | 2021-09-02T20:01:35.000Z | 2022-01-26T19:47:35.000Z | tools/scripts/b64map_c_gen.py | joeedh/fairmotion | 5c322fc012cdd94ddc2f21d68264c845b3c2c770 | [
"MIT"
] | null | null | null | import os, sys, time, random, struct, os.path
s = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
if len(sys.argv) > 1:
s = sys.argv[1]
print("Using encoding map:\n '%s'" % s)
else:
print("Using MIME standard encoding")
map = [0 for x in range(255)];
for i, c in enumerate(s):
map[ord(... | 16.111111 | 72 | 0.546552 | import os, sys, time, random, struct, os.path
s = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
if len(sys.argv) > 1:
s = sys.argv[1]
print("Using encoding map:\n '%s'" % s)
else:
print("Using MIME standard encoding")
map = [0 for x in range(255)];
for i, c in enumerate(s):
map[ord(... | true | true |
f7756f9078b53be1488530f33ee915df5e2642b5 | 37,550 | py | Python | venv/Lib/site-packages/sklearn/base.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | venv/Lib/site-packages/sklearn/base.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | venv/Lib/site-packages/sklearn/base.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | """Base classes for all estimators."""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD 3 clause
import copy
import warnings
from collections import defaultdict
import platform
import inspect
import re
import numpy as np
from . import __version__
from ._config import get_config... | 36.036468 | 89 | 0.572889 |
import copy
import warnings
from collections import defaultdict
import platform
import inspect
import re
import numpy as np
from . import __version__
from ._config import get_config
from .utils import _IS_32BIT
from .utils._tags import (
_DEFAULT_TAGS,
_safe_tags,
)
from .utils.validation ... | true | true |
f77570744486362506e5b7a4fbdddce96c7e712a | 12,229 | py | Python | tests/test_configuration.py | MothVine/DESC | 8f18ca63b34dad07ec67a4d43945d39287b303b8 | [
"MIT"
] | null | null | null | tests/test_configuration.py | MothVine/DESC | 8f18ca63b34dad07ec67a4d43945d39287b303b8 | [
"MIT"
] | null | null | null | tests/test_configuration.py | MothVine/DESC | 8f18ca63b34dad07ec67a4d43945d39287b303b8 | [
"MIT"
] | null | null | null | import numpy as np
import pytest
import unittest
from desc.equilibrium import Equilibrium, EquilibriaFamily
from desc.grid import ConcentricGrid
from desc.profiles import PowerSeriesProfile, SplineProfile
from desc.geometry import (
FourierRZCurve,
FourierRZToroidalSurface,
ZernikeRZToroidalSection,
)
cla... | 32.523936 | 88 | 0.514106 | import numpy as np
import pytest
import unittest
from desc.equilibrium import Equilibrium, EquilibriaFamily
from desc.grid import ConcentricGrid
from desc.profiles import PowerSeriesProfile, SplineProfile
from desc.geometry import (
FourierRZCurve,
FourierRZToroidalSurface,
ZernikeRZToroidalSection,
)
cla... | true | true |
f7757076b979a2ef09ea1dfb7069c064ac59668b | 1,407 | py | Python | src/eiffel_graphql_api/graphql/schemas/links/iut.py | fredjn/eiffel-graphql-api | 52e54954bd418686a5668e6dfe9fbb4bc35273af | [
"Apache-2.0"
] | 3 | 2019-12-16T13:54:21.000Z | 2019-12-20T21:52:14.000Z | src/eiffel_graphql_api/graphql/schemas/links/iut.py | fredjn/eiffel-graphql-api | 52e54954bd418686a5668e6dfe9fbb4bc35273af | [
"Apache-2.0"
] | 41 | 2019-12-16T13:32:30.000Z | 2021-09-01T06:51:51.000Z | src/eiffel_graphql_api/graphql/schemas/links/iut.py | fredjn/eiffel-graphql-api | 52e54954bd418686a5668e6dfe9fbb4bc35273af | [
"Apache-2.0"
] | 7 | 2019-12-19T13:38:46.000Z | 2021-12-20T14:05:00.000Z | # Copyright 2019-2020 Axis Communications AB.
#
# For a full list of individual contributors, please see the commit history.
#
# 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... | 34.317073 | 84 | 0.695096 | import graphene
from ..utils import find_type, search
class IUT(graphene.ObjectType):
link = graphene.Field("eiffel_graphql_api.graphql.schemas.union.EiffelIutUnion")
def __init__(self, link):
self.link = link
def resolve_link(self, _):
from ..union import NotFound
mo... | true | true |
f7757082898cf36c0bbed4fdce54002de3c916f9 | 32,228 | py | Python | genie/dashboard_table_updater.py | Sage-Bionetworks/Genie | ce70861b0d3717cd5b57a393a16b4d6fea9500f3 | [
"MIT"
] | 10 | 2017-08-31T21:32:18.000Z | 2022-03-07T21:37:17.000Z | genie/dashboard_table_updater.py | Sage-Bionetworks/Genie | ce70861b0d3717cd5b57a393a16b4d6fea9500f3 | [
"MIT"
] | 216 | 2016-10-24T21:30:12.000Z | 2022-03-31T15:04:37.000Z | genie/dashboard_table_updater.py | Sage-Bionetworks/Genie | ce70861b0d3717cd5b57a393a16b4d6fea9500f3 | [
"MIT"
] | 12 | 2016-10-21T13:48:06.000Z | 2020-06-04T19:21:23.000Z | """Updates dashboard tables"""
import argparse
import datetime
import logging
import os
import pandas as pd
import synapseclient
from synapseclient.core.utils import to_unix_epoch_time
from genie import process_functions
logger = logging.getLogger(__name__)
def get_center_data_completion(center, df):
"""
G... | 39.350427 | 85 | 0.659054 | import argparse
import datetime
import logging
import os
import pandas as pd
import synapseclient
from synapseclient.core.utils import to_unix_epoch_time
from genie import process_functions
logger = logging.getLogger(__name__)
def get_center_data_completion(center, df):
centerdf = df[df['CENTER'] == center]
... | true | true |
f775709ae1d0ad46da7bd0a91cab7d17d0175139 | 6,660 | py | Python | at.py | bitangler/weather | 87bb80caf8e114575afc4326951ae7cee7ff5651 | [
"MIT"
] | null | null | null | at.py | bitangler/weather | 87bb80caf8e114575afc4326951ae7cee7ff5651 | [
"MIT"
] | null | null | null | at.py | bitangler/weather | 87bb80caf8e114575afc4326951ae7cee7ff5651 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Weather stations along the Appalachian Trail, using trail towns
provided by Ref. [1].
[1]: http://www.aprs.org/hamtrails/AT-towns.txt
"""
stations = {
"GA": {
"Gainesville, GA": "KGVL", # Gainesville, GA
"Waleska, GA": "KCNI", # Cant... | 42.420382 | 65 | 0.458108 |
stations = {
"GA": {
"Gainesville, GA": "KGVL", "Waleska, GA": "KCNI", "Jasper, GA": "KCNI", "Chatsworth, GA": "KDNN", "Ellijay, GA": "KDZJ", "Dahlonega, GA": "KGVL", "Cleveland, GA": "KDZJ", "Tocco... | true | true |
f7757139d5ad3ac7256bedd91bb1ee901fc54549 | 75,638 | py | Python | getgauge/messages/spec_pb2.py | yicaifeitian/gauge-python | eaaa212f80f5e7113796d763fecf1d87ad256a52 | [
"MIT"
] | null | null | null | getgauge/messages/spec_pb2.py | yicaifeitian/gauge-python | eaaa212f80f5e7113796d763fecf1d87ad256a52 | [
"MIT"
] | null | null | null | getgauge/messages/spec_pb2.py | yicaifeitian/gauge-python | eaaa212f80f5e7113796d763fecf1d87ad256a52 | [
"MIT"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: spec.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _mess... | 44.078089 | 7,729 | 0.74333 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf i... | true | true |
f775713b2433504c07c07171545fe2547474461d | 12,671 | py | Python | ape/OptimalVibrations.py | shihchengli/APE | c2f529b9e20959824317dbc3c018ce41702d67f6 | [
"MIT"
] | 3 | 2020-04-13T02:26:34.000Z | 2022-01-04T12:02:08.000Z | ape/OptimalVibrations.py | shihchengli/APE | c2f529b9e20959824317dbc3c018ce41702d67f6 | [
"MIT"
] | 1 | 2021-08-06T11:05:51.000Z | 2021-08-06T11:05:51.000Z | ape/OptimalVibrations.py | shihchengli/APE | c2f529b9e20959824317dbc3c018ce41702d67f6 | [
"MIT"
] | 1 | 2021-08-03T08:28:25.000Z | 2021-08-03T08:28:25.000Z | # -*- coding: utf-8 -*-
"""
A module to find the optimizing vibrational coordinates to reduce intermode coupling
"""
import os
import time
import logging
import numpy as np
from copy import deepcopy
from scipy import optimize
from numba import jit
import rmgpy.constants as constants
from ape.job.job import Job
from... | 42.377926 | 163 | 0.556073 |
import os
import time
import logging
import numpy as np
from copy import deepcopy
from scipy import optimize
from numba import jit
import rmgpy.constants as constants
from ape.job.job import Job
from ape.qchem import QChemLog
from ape.exceptions import InputError, ConvergeError
from ape.common import diagonalize_pr... | true | true |
f775731d4506b5e7605c9df722f6352a8b20db8a | 1,080 | py | Python | tg_bot/modules/__init__.py | lucaubot4/h | ca6fd12c1f6a3ba95c27624f816165f65db6003d | [
"MIT"
] | 2 | 2021-08-04T21:39:00.000Z | 2021-09-28T06:52:56.000Z | tg_bot/modules/__init__.py | lucaubot4/h | ca6fd12c1f6a3ba95c27624f816165f65db6003d | [
"MIT"
] | null | null | null | tg_bot/modules/__init__.py | lucaubot4/h | ca6fd12c1f6a3ba95c27624f816165f65db6003d | [
"MIT"
] | 6 | 2020-09-22T07:04:40.000Z | 2021-12-02T16:14:30.000Z | from tg_bot import LOAD, NO_LOAD, LOGGER
def __list_all_modules():
from os.path import dirname, basename, isfile
import glob
# This generates a list of modules in this folder for the * in __main__ to work.
mod_paths = glob.glob(dirname(__file__) + "/*.py")
all_modules = [basename(f)[:-3] for f in ... | 30.857143 | 98 | 0.617593 | from tg_bot import LOAD, NO_LOAD, LOGGER
def __list_all_modules():
from os.path import dirname, basename, isfile
import glob
mod_paths = glob.glob(dirname(__file__) + "/*.py")
all_modules = [basename(f)[:-3] for f in mod_paths if isfile(f)
and f.endswith(".py")
... | true | true |
f77573a16d15f0380440d78d60074d7c50cceab2 | 170 | py | Python | Nkechi Esomonu/Phase 1/Python Basic 1/Day 1/Day2/task 9.py | nkem1010/python-challenge-solutions | 203cedc691094a83b110fc75764aac51dbbc1a03 | [
"MIT"
] | null | null | null | Nkechi Esomonu/Phase 1/Python Basic 1/Day 1/Day2/task 9.py | nkem1010/python-challenge-solutions | 203cedc691094a83b110fc75764aac51dbbc1a03 | [
"MIT"
] | null | null | null | Nkechi Esomonu/Phase 1/Python Basic 1/Day 1/Day2/task 9.py | nkem1010/python-challenge-solutions | 203cedc691094a83b110fc75764aac51dbbc1a03 | [
"MIT"
] | null | null | null | exam_st_date = input("Enter your exam date ").split(',')
output = f"The examination will start from : {exam_st_date[0]}/{exam_st_date[1]}/{exam_st_date[2]}"
print(output) | 56.666667 | 99 | 0.723529 | exam_st_date = input("Enter your exam date ").split(',')
output = f"The examination will start from : {exam_st_date[0]}/{exam_st_date[1]}/{exam_st_date[2]}"
print(output) | true | true |
f77573d6a2305076e1ff5071ae28ed3f3c86a322 | 22,428 | py | Python | general/paper_plots/general.py | njcuk9999/apero-utils | f77de4c9123874e5bb6ed6bd03a7de3b27057402 | [
"MIT"
] | 2 | 2020-10-08T17:03:45.000Z | 2021-03-09T17:49:44.000Z | general/paper_plots/general.py | njcuk9999/apero-utils | f77de4c9123874e5bb6ed6bd03a7de3b27057402 | [
"MIT"
] | 17 | 2020-09-24T17:35:38.000Z | 2020-12-11T16:10:13.000Z | general/paper_plots/general.py | njcuk9999/apero-utils | f77de4c9123874e5bb6ed6bd03a7de3b27057402 | [
"MIT"
] | 5 | 2020-04-10T06:41:00.000Z | 2020-12-16T21:09:14.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Plots for the apero drs paper
Created on 2021-08-01
@author: cook
"""
import matplotlib
matplotlib.use('Qt5Agg')
from astropy.io import fits
from astropy.visualization import imshow_norm, ZScaleInterval, LinearStretch
import glob
import matplotlib.pyplot as plt
import... | 42.72 | 81 | 0.524568 | import matplotlib
matplotlib.use('Qt5Agg')
from astropy.io import fits
from astropy.visualization import imshow_norm, ZScaleInterval, LinearStretch
import glob
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from mpl_toolkits.axes_grid1 import make_axes_locatable
import numpy as np
import os
from ... | true | true |
f77574ba10f05347823f5d200cec558190191b79 | 1,887 | py | Python | day5_2.py | goonmandu/advent_of_code_2021 | 4be3d501c04a98dbc30ac1ebadd86626adba8ed1 | [
"MIT"
] | null | null | null | day5_2.py | goonmandu/advent_of_code_2021 | 4be3d501c04a98dbc30ac1ebadd86626adba8ed1 | [
"MIT"
] | null | null | null | day5_2.py | goonmandu/advent_of_code_2021 | 4be3d501c04a98dbc30ac1ebadd86626adba8ed1 | [
"MIT"
] | null | null | null | def main():
with open("AoC-D5.txt") as f:
lines = f.readlines()
lines = [thing.strip("\n") for thing in lines]
lines = [thing.split(" -> ") for thing in lines]
lines = [point.split(',') for direction in lines for point in direction]
lines = [lines[n:n + 2] for n in range(0, len(lines), 2)]
... | 33.696429 | 114 | 0.391097 | def main():
with open("AoC-D5.txt") as f:
lines = f.readlines()
lines = [thing.strip("\n") for thing in lines]
lines = [thing.split(" -> ") for thing in lines]
lines = [point.split(',') for direction in lines for point in direction]
lines = [lines[n:n + 2] for n in range(0, len(lines), 2)]
... | true | true |
f7757545410a8f108dc0aea0c344b1b51df0b525 | 28,009 | py | Python | contrib/sign-releases.py | TheSin-/electrum-trc | d2f5b15fd4399a9248cce0d63e20128f3f54e69c | [
"MIT"
] | 1 | 2019-08-20T18:05:32.000Z | 2019-08-20T18:05:32.000Z | contrib/sign-releases.py | TheSin-/electrum-trc | d2f5b15fd4399a9248cce0d63e20128f3f54e69c | [
"MIT"
] | 1 | 2022-03-14T19:45:31.000Z | 2022-03-14T19:45:31.000Z | contrib/sign-releases.py | TheSin-/electrum-trc | d2f5b15fd4399a9248cce0d63e20128f3f54e69c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Sign releases on github, make/upload ppa to launchpad.net
NOTE on ppa: To build a ppa you may need to install some more packages.
On ubuntu:
sudo apt-get install devscripts libssl-dev python3-dev \
debhelper python3-setuptools dh-python
NOTE on apk sig... | 37.747978 | 88 | 0.558035 |
import os
import os.path
import re
import sys
import time
import getpass
import shutil
import hashlib
import tempfile
import json
import zipfile
from subprocess import check_call, CalledProcessError
from functools import cmp_to_key
from time import localtime, strftime
try:
import click
import certifi
impo... | true | true |
f7757654dd1429fb12396abb9f94f60ed7f4ad7e | 1,066 | py | Python | django_social_oauth_two_factor/middleware.py | thethirdbearsolutions/django-social-oauth-twofactor | 64592075daad9ef64a8da1383a808dd507fc08f8 | [
"MIT"
] | null | null | null | django_social_oauth_two_factor/middleware.py | thethirdbearsolutions/django-social-oauth-twofactor | 64592075daad9ef64a8da1383a808dd507fc08f8 | [
"MIT"
] | null | null | null | django_social_oauth_two_factor/middleware.py | thethirdbearsolutions/django-social-oauth-twofactor | 64592075daad9ef64a8da1383a808dd507fc08f8 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.shortcuts import redirect
from django_otp import user_has_device
class TwoFactorMiddleware(object):
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
response = None
if hasattr(self, 'process_req... | 38.071429 | 92 | 0.605066 | from django.conf import settings
from django.shortcuts import redirect
from django_otp import user_has_device
class TwoFactorMiddleware(object):
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
response = None
if hasattr(self, 'process_req... | true | true |
f775770aa05f2ad3aab03c69fad59f15db9b14d8 | 61,701 | py | Python | fcp3/freenetfs.py | jamesaxl/lib-pyFreenet-staging | 7da4898bd256e458e4a525ba3bdad80f4b77bc03 | [
"MIT"
] | 1 | 2018-11-10T12:19:21.000Z | 2018-11-10T12:19:21.000Z | fcp3/freenetfs.py | jamesaxl/lib-pyFreenet-staging | 7da4898bd256e458e4a525ba3bdad80f4b77bc03 | [
"MIT"
] | null | null | null | fcp3/freenetfs.py | jamesaxl/lib-pyFreenet-staging | 7da4898bd256e458e4a525ba3bdad80f4b77bc03 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
#@+leo-ver=4
#@+node:@file freenetfs.py
#@@first
"""
A FUSE-based filesystem for freenet
Written May 2006 by aum
Released under the GNU Lesser General Public License
Requires:
- python2.3 or later
- FUSE kernel module installed and loaded
(apt-get install fuse-source, crack tarba... | 28.738239 | 92 | 0.481986 | """
A FUSE-based filesystem for freenet
Written May 2006 by aum
Released under the GNU Lesser General Public License
Requires:
- python2.3 or later
- FUSE kernel module installed and loaded
(apt-get install fuse-source, crack tarball, build and install)
- python2.3-fuse
- libfuse2
"""
import s... | false | true |
f77578c3739b69f2317cc45d6af82cda760e51fa | 72,433 | py | Python | tests/cupyx_tests/scipy_tests/sparse_tests/test_csr.py | viantirreau/cupy | cafe9af0e974ff88fc6aa43bf106e343a60fb983 | [
"MIT"
] | 1 | 2021-06-03T16:51:02.000Z | 2021-06-03T16:51:02.000Z | tests/cupyx_tests/scipy_tests/sparse_tests/test_csr.py | viantirreau/cupy | cafe9af0e974ff88fc6aa43bf106e343a60fb983 | [
"MIT"
] | null | null | null | tests/cupyx_tests/scipy_tests/sparse_tests/test_csr.py | viantirreau/cupy | cafe9af0e974ff88fc6aa43bf106e343a60fb983 | [
"MIT"
] | null | null | null | import contextlib
import pickle
import unittest
import warnings
import numpy
import pytest
try:
import scipy.sparse
scipy_available = True
except ImportError:
scipy_available = False
import cupy
from cupy.core import _accelerator
from cupy import testing
from cupyx.scipy import sparse
def _make(xp, sp, ... | 35.0087 | 79 | 0.593307 | import contextlib
import pickle
import unittest
import warnings
import numpy
import pytest
try:
import scipy.sparse
scipy_available = True
except ImportError:
scipy_available = False
import cupy
from cupy.core import _accelerator
from cupy import testing
from cupyx.scipy import sparse
def _make(xp, sp, ... | true | true |
f775799a748d8aa708389925d98bdd450a7593f0 | 2,897 | py | Python | bims/migrations/0071_taxonidentifier.py | Christiaanvdm/django-bims | f92a63156c711b2d53c5f8ea06867cd64cee9eb9 | [
"MIT"
] | null | null | null | bims/migrations/0071_taxonidentifier.py | Christiaanvdm/django-bims | f92a63156c711b2d53c5f8ea06867cd64cee9eb9 | [
"MIT"
] | null | null | null | bims/migrations/0071_taxonidentifier.py | Christiaanvdm/django-bims | f92a63156c711b2d53c5f8ea06867cd64cee9eb9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-12-02 12:15
from __future__ import unicode_literals
import bims.enums.taxonomic_rank
import bims.enums.taxonomic_status
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrati... | 85.205882 | 695 | 0.721091 | from __future__ import unicode_literals
import bims.enums.taxonomic_rank
import bims.enums.taxonomic_status
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('bims', '0070_remove_biolog... | true | true |
f77579f04536bdc56bc98fa0eb022dcf7ae6b48c | 12,024 | py | Python | tests/gcp/hooks/test_kubernetes_engine.py | rolanddb/incubator-airflow | e090744787458b50d7eb35bd3c66f15fba7322c2 | [
"Apache-2.0"
] | 2 | 2020-10-12T05:21:27.000Z | 2021-07-07T09:23:47.000Z | tests/gcp/hooks/test_kubernetes_engine.py | sb2nov/airflow | e405be0141a996c5bb3659e3f19cab0e1ac8dc8d | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 3 | 2021-03-11T06:46:16.000Z | 2021-09-29T17:48:20.000Z | tests/gcp/hooks/test_kubernetes_engine.py | sb2nov/airflow | e405be0141a996c5bb3659e3f19cab0e1ac8dc8d | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 43.251799 | 89 | 0.679474 | import unittest
from airflow import AirflowException
from airflow.gcp.hooks.kubernetes_engine import GKEClusterHook
from tests.compat import mock
TASK_ID = 'test-gke-cluster-operator'
CLUSTER_NAME = 'test-cluster'
TEST_GCP_PROJECT_ID = 'test-project'
GKE_ZONE = 'test-zone'
class GKEClusterHookDeleteTest(unittest.T... | true | true |
f7757a0924e6fe40110d27bb8e8aa05ff4403689 | 1,393 | py | Python | debexpo/keyring/apps.py | debexpo/debexpo | 866b0e61726b14425f02e10977398444785337be | [
"MIT"
] | 3 | 2016-02-17T08:47:07.000Z | 2017-05-20T20:43:23.000Z | debexpo/keyring/apps.py | debexpo/debexpo | 866b0e61726b14425f02e10977398444785337be | [
"MIT"
] | 44 | 2015-01-11T00:54:24.000Z | 2019-08-17T21:06:25.000Z | debexpo/keyring/apps.py | debexpo/debexpo | 866b0e61726b14425f02e10977398444785337be | [
"MIT"
] | 8 | 2015-01-12T00:57:32.000Z | 2017-01-20T23:01:52.000Z | # apps.py - django app definition for keyring
#
# This file is part of debexpo
# https://salsa.debian.org/mentors.debian.net-team/debexpo
#
# Copyright © 2019 Baptiste Beauplat <lyknode@cilg.org>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associat... | 40.970588 | 69 | 0.74659 |
from django.apps import AppConfig
class KeyringConfig(AppConfig):
name = 'keyring'
| true | true |
f7757a71826fa809fed47a3fc57d211b692996bd | 5,916 | py | Python | archive/hdmimatrix/dummy.py | cccb/hdmilirc-mqtt | 302c244da573bfe93c87dc415f2d2e3cf0a5e7c0 | [
"MIT"
] | null | null | null | archive/hdmimatrix/dummy.py | cccb/hdmilirc-mqtt | 302c244da573bfe93c87dc415f2d2e3cf0a5e7c0 | [
"MIT"
] | 1 | 2018-09-02T18:00:13.000Z | 2018-09-30T08:52:31.000Z | archive/hdmimatrix/dummy.py | cccb/hdmilirc-mqtt | 302c244da573bfe93c87dc415f2d2e3cf0a5e7c0 | [
"MIT"
] | 1 | 2018-09-02T17:11:01.000Z | 2018-09-02T17:11:01.000Z | #!/usr/bin/env python3
"""
Hdmi Matrix simulation
"""
import time
from datetime import datetime
from llama import mqtt
import hdmi
DEADTIME = 1.0
# Update lock timer
LAST_UPDATE_A_FINISHED = 0
LAST_UPDATE_B_FINISHED = 0
# Actions
GET_CHANNEL_INPUTS_REQUEST = "@hdmi/GET_CHANNEL_INPUTS_REQUEST"
GET_CHANNEL_INPUTS... | 23.109375 | 66 | 0.628127 |
import time
from datetime import datetime
from llama import mqtt
import hdmi
DEADTIME = 1.0
LAST_UPDATE_A_FINISHED = 0
LAST_UPDATE_B_FINISHED = 0
GET_CHANNEL_INPUTS_REQUEST = "@hdmi/GET_CHANNEL_INPUTS_REQUEST"
GET_CHANNEL_INPUTS_SUCCESS = "@hdmi/GET_CHANNEL_INPUTS_SUCCESS"
SET_CHANNEL_A_INPUT_REQUEST = "@hdmi/... | true | true |
f7757a959b9a2b5e1ad43f631ec36e17108875b9 | 1,804 | py | Python | revokeRegister_part.py | linkhub-sdk/popbill.cashbill.example.py | 498dbfde68da5a0c622fac6bd9837653b0dcdc34 | [
"MIT"
] | null | null | null | revokeRegister_part.py | linkhub-sdk/popbill.cashbill.example.py | 498dbfde68da5a0c622fac6bd9837653b0dcdc34 | [
"MIT"
] | null | null | null | revokeRegister_part.py | linkhub-sdk/popbill.cashbill.example.py | 498dbfde68da5a0c622fac6bd9837653b0dcdc34 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# code for console Encoding difference. Dont' mind on it
import sys
import imp
imp.reload(sys)
try:
sys.setdefaultencoding('UTF8')
except Exception as E:
pass
import testValue
from popbill import Cashbill, CashbillService, PopbillException
cashbillService = CashbillService(testValue.... | 24.378378 | 111 | 0.673503 | import sys
import imp
imp.reload(sys)
try:
sys.setdefaultencoding('UTF8')
except Exception as E:
pass
import testValue
from popbill import Cashbill, CashbillService, PopbillException
cashbillService = CashbillService(testValue.LinkID, testValue.SecretKey)
cashbillService.IsTest = testValue.IsTest
cashbillSe... | true | true |
f7757c177fc84bc250527f1d3ad54e35af7910b4 | 13,890 | py | Python | elpa/elpy-20190415.2310/elpy/tests/test_jedibackend.py | llacom/emacs.d | e687d56670ea8d5b7d243a74948e90f93bfa06de | [
"MIT"
] | 1 | 2019-05-15T23:07:55.000Z | 2019-05-15T23:07:55.000Z | elpa/elpy-20190415.2310/elpy/tests/test_jedibackend.py | llacom/emacs.d | e687d56670ea8d5b7d243a74948e90f93bfa06de | [
"MIT"
] | 1 | 2020-03-24T12:50:29.000Z | 2020-03-24T12:51:11.000Z | elpa/elpy-20190415.2310/elpy/tests/test_jedibackend.py | llacom/emacs.d | e687d56670ea8d5b7d243a74948e90f93bfa06de | [
"MIT"
] | null | null | null | """Tests for the elpy.jedibackend module."""
import sys
import unittest
import jedi
import mock
from elpy import jedibackend
from elpy import rpc
from elpy.tests import compat
from elpy.tests.support import BackendTestCase
from elpy.tests.support import RPCGetCompletionsTests
from elpy.tests.support import RPCGetCom... | 37.238606 | 80 | 0.596112 |
import sys
import unittest
import jedi
import mock
from elpy import jedibackend
from elpy import rpc
from elpy.tests import compat
from elpy.tests.support import BackendTestCase
from elpy.tests.support import RPCGetCompletionsTests
from elpy.tests.support import RPCGetCompletionDocstringTests
from elpy.tests.support... | true | true |
f7757c332dc19908f91893bb1155ce610475eeb3 | 3,453 | py | Python | tests/app/api/bgm_tv_auto_tracker/api_v1/test_submit.py | renovate-tests/pol | dca9aa4ce34273575d69a140dc3bb1d2ac14ecbf | [
"MIT"
] | null | null | null | tests/app/api/bgm_tv_auto_tracker/api_v1/test_submit.py | renovate-tests/pol | dca9aa4ce34273575d69a140dc3bb1d2ac14ecbf | [
"MIT"
] | null | null | null | tests/app/api/bgm_tv_auto_tracker/api_v1/test_submit.py | renovate-tests/pol | dca9aa4ce34273575d69a140dc3bb1d2ac14ecbf | [
"MIT"
] | null | null | null | # import pytest
# from starlette.testclient import TestClient
#
# from app import db_models
# from app.db.mysql import objects
# from app.db_models import UserToken, UserSubmitBangumi
# from app.api.auth.api_v1.depends import get_current_user
# def test_submit_subject_id_require_auth(client: TestClient):
# r = cli... | 31.678899 | 85 | 0.592818 |
#
#
# def test_submit_subject_id(client: TestClient):
# async def mock_get_current_user():
# return UserToken(user_id=233)
#
# client.app.dependency_overrides[get_current_user] = mock_get_current_user
#
# r = client.post(
# '/bgm-tv-auto-tracker/api.v1/submit/subject_id',
# json={
#... | true | true |
f7757c38c626790edae803305b4c4d8934c64e9b | 3,100 | py | Python | src/streamlink/plugins/gulli.py | Billy2011/streamlink | 5f99ec52e0a9c315aeee00b96287edc45adaccd3 | [
"BSD-2-Clause"
] | 1 | 2019-09-14T10:19:47.000Z | 2019-09-14T10:19:47.000Z | src/streamlink/plugins/gulli.py | Billy2011/streamlink | 5f99ec52e0a9c315aeee00b96287edc45adaccd3 | [
"BSD-2-Clause"
] | 1 | 2018-07-12T18:18:05.000Z | 2018-07-12T18:18:05.000Z | src/streamlink/plugins/gulli.py | Billy2011/streamlink | 5f99ec52e0a9c315aeee00b96287edc45adaccd3 | [
"BSD-2-Clause"
] | null | null | null | """
$description French live TV channel and video on-demand service owned by Gulli.
$url replay.gulli.fr
$type live, vod
$region France
"""
import logging
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.hls import HLSStream
from streamlin... | 33.333333 | 120 | 0.558387 |
import logging
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.hls import HLSStream
from streamlink.stream.http import HTTPStream
log = logging.getLogger(__name__)
@pluginmatcher(re.compile(
r'https?://replay\.gulli\.fr/(?:Direct|.... | true | true |
f7757c780d51b0893f575dde201254d271ae3f86 | 150 | py | Python | Prometheus/views/__init__.py | JeremyBakker/nss-backendCapstone | 4efab982eab366df3adbcd15506a855c281aa8ae | [
"W3C"
] | 1 | 2020-09-02T04:59:14.000Z | 2020-09-02T04:59:14.000Z | Prometheus/views/__init__.py | JeremyBakker/nss-backendCapstone | 4efab982eab366df3adbcd15506a855c281aa8ae | [
"W3C"
] | 28 | 2017-06-06T02:19:15.000Z | 2017-06-06T02:51:45.000Z | Prometheus/views/__init__.py | JeremyBakker/nss-backendCapstone | 4efab982eab366df3adbcd15506a855c281aa8ae | [
"W3C"
] | 2 | 2020-02-27T00:13:28.000Z | 2021-04-13T16:43:22.000Z | from Prometheus.views.index_view import index
from Prometheus.views.search_view import search
from Prometheus.views.corporation_view import transcript | 50 | 56 | 0.886667 | from Prometheus.views.index_view import index
from Prometheus.views.search_view import search
from Prometheus.views.corporation_view import transcript | true | true |
f7757d151ee4c2adb86179a3703d8916959d3f48 | 1,703 | py | Python | setup.py | mgomezjimenez/stars_pairs | 95739d48edc35a7aaf8b724792a7e0e4936cd658 | [
"BSD-3-Clause"
] | 1 | 2017-09-20T05:41:05.000Z | 2017-09-20T05:41:05.000Z | setup.py | mgomezjimenez/pairs | 95739d48edc35a7aaf8b724792a7e0e4936cd658 | [
"BSD-3-Clause"
] | 11 | 2017-09-20T05:32:17.000Z | 2018-01-31T04:06:02.000Z | setup.py | mgomezjimenez/stars_pairs | 95739d48edc35a7aaf8b724792a7e0e4936cd658 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'Click>=6.0',
# TODO: Get ve... | 27.918033 | 69 | 0.625954 |
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'Click>=6.0',
'matplotlib>=1.4.2,<2.0',
'numpy>=1.9.1',
]
extra_requirements = {
... | true | true |
f7757d505c004dff5d0113b4796a6f1940491dd3 | 1,896 | py | Python | ludwig/utils/print_utils.py | yarenty/ludwig | d77aaf8da39f04a353a3a08fb699ae8a96ffea3a | [
"Apache-2.0"
] | 970 | 2020-12-17T15:09:20.000Z | 2022-03-31T22:58:03.000Z | ludwig/utils/print_utils.py | yarenty/ludwig | d77aaf8da39f04a353a3a08fb699ae8a96ffea3a | [
"Apache-2.0"
] | 503 | 2020-12-16T21:44:40.000Z | 2022-03-31T18:21:52.000Z | ludwig/utils/print_utils.py | yarenty/ludwig | d77aaf8da39f04a353a3a08fb699ae8a96ffea3a | [
"Apache-2.0"
] | 145 | 2020-12-18T07:38:30.000Z | 2022-03-29T19:05:08.000Z | #! /usr/bin/env python
# Copyright (c) 2019 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 31.081967 | 89 | 0.521097 | import logging
from collections import OrderedDict
from pprint import pformat
logging_level_registry = {
"critical": logging.CRITICAL,
"error": logging.ERROR,
"warning": logging.WARNING,
"info": logging.INFO,
"debug": logging.DEBUG,
"notset": logging.NOTSET,
}
logger = logging.getLogger(__name... | true | true |
f7757de169001ec867f18a70324c4f7aae53a41f | 14,505 | py | Python | src/olympia/internal_tools/tests/test_views.py | leplatrem/addons-server | 8b5ebda6f33194aa9fce12c0453574e7f850e6ad | [
"BSD-3-Clause"
] | null | null | null | src/olympia/internal_tools/tests/test_views.py | leplatrem/addons-server | 8b5ebda6f33194aa9fce12c0453574e7f850e6ad | [
"BSD-3-Clause"
] | null | null | null | src/olympia/internal_tools/tests/test_views.py | leplatrem/addons-server | 8b5ebda6f33194aa9fce12c0453574e7f850e6ad | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import base64
import json
import urlparse
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import override_settings
import mock
from rest_framework.test import APIClient
from rest_framework_jwt.serializers import VerifyJSONWebTokenSerializer
from ... | 40.630252 | 79 | 0.641986 | import base64
import json
import urlparse
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import override_settings
import mock
from rest_framework.test import APIClient
from rest_framework_jwt.serializers import VerifyJSONWebTokenSerializer
from olympia.accounts import ... | true | true |
f7757ed200dbc8f3c93856010256a065137b95ed | 627 | py | Python | faceweb/manage.py | Dheeraj2407/Face-web | e73696e0ff12fc19a8d88ccaf2a830db4fcbb102 | [
"MIT"
] | null | null | null | faceweb/manage.py | Dheeraj2407/Face-web | e73696e0ff12fc19a8d88ccaf2a830db4fcbb102 | [
"MIT"
] | null | null | null | faceweb/manage.py | Dheeraj2407/Face-web | e73696e0ff12fc19a8d88ccaf2a830db4fcbb102 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'faceweb.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Import... | 28.5 | 73 | 0.682616 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'faceweb.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
f775804bad8e378543544d50fc27672f425f0982 | 10,582 | py | Python | python/lvmnps/switch/iboot/iboot.py | wasndas/lvmnps | e1023c3d6032a5fa89b2fbd0e7a0d3ece9265179 | [
"BSD-3-Clause"
] | null | null | null | python/lvmnps/switch/iboot/iboot.py | wasndas/lvmnps | e1023c3d6032a5fa89b2fbd0e7a0d3ece9265179 | [
"BSD-3-Clause"
] | null | null | null | python/lvmnps/switch/iboot/iboot.py | wasndas/lvmnps | e1023c3d6032a5fa89b2fbd0e7a0d3ece9265179 | [
"BSD-3-Clause"
] | 2 | 2021-07-01T10:34:53.000Z | 2021-07-21T05:35:38.000Z | #!/usr/bin/env python
"""
Copyright (c) 2013, Luke Fitzgerald
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of c... | 30.672464 | 83 | 0.643546 |
import asyncio
import logging
import socket
import struct
HELLO_STR = "hello-000"
HEADER_STRUCT = struct.Struct("<B21s21sBBH")
COMMAND_MAP = {
"NULL": 0,
"SET": 1,
"GET": 2,
"IO": 3,
"KEEPALIVE": 4,
"RSS": 5,
"RCU": 6,
}
SOCKET_TIMEOUT = 1
class DXPCommand(object):
COMMAND = Non... | true | true |
f775806eea6c11e2eca2d0ea4a964b9dfd214015 | 3,057 | py | Python | python/astra_thecannon/tasks/train.py | sdss/astra_thecannon | 3062025aa2ac3b8af257490be63201587b23762d | [
"BSD-3-Clause"
] | null | null | null | python/astra_thecannon/tasks/train.py | sdss/astra_thecannon | 3062025aa2ac3b8af257490be63201587b23762d | [
"BSD-3-Clause"
] | 4 | 2019-04-22T15:16:03.000Z | 2019-04-22T17:54:33.000Z | python/astra_thecannon/tasks/train.py | sdss/the-cannon | 3062025aa2ac3b8af257490be63201587b23762d | [
"BSD-3-Clause"
] | null | null | null |
import os
import luigi
import numpy as np
from astropy.table import Table
from astra.tasks.base import BaseTask
from astra.utils import log
from astra_thecannon.tasks.base import TheCannonMixin, read_training_set
import astra_thecannon as tc
class TrainingSetTarget(BaseTask):
training_set_path = luigi.Paramet... | 30.57 | 94 | 0.636572 |
import os
import luigi
import numpy as np
from astropy.table import Table
from astra.tasks.base import BaseTask
from astra.utils import log
from astra_thecannon.tasks.base import TheCannonMixin, read_training_set
import astra_thecannon as tc
class TrainingSetTarget(BaseTask):
training_set_path = luigi.Paramet... | true | true |
f77580dd763e9fc3e7f6f010ddccf4a14e32965e | 4,145 | py | Python | pyne/pyne/spectanalysis.py | AllSafeCyberSecur1ty/Nuclear-Engineering | 302d6dcc7c0a85a9191098366b076cf9cb5a9f6e | [
"MIT"
] | 1 | 2022-03-26T20:01:13.000Z | 2022-03-26T20:01:13.000Z | pyne/pyne/spectanalysis.py | AllSafeCyberSecur1ty/Nuclear-Engineering | 302d6dcc7c0a85a9191098366b076cf9cb5a9f6e | [
"MIT"
] | null | null | null | pyne/pyne/spectanalysis.py | AllSafeCyberSecur1ty/Nuclear-Engineering | 302d6dcc7c0a85a9191098366b076cf9cb5a9f6e | [
"MIT"
] | 1 | 2022-03-26T19:59:13.000Z | 2022-03-26T19:59:13.000Z | """Purpose:
This module is for spectrometry analysis
will have functions for general spectrum processing
"""
from pyne.utils import QA_warn
import copy
QA_warn(__name__)
class PhSpectrum(object):
"""Pulse height spectrum class"""
def __init__(
self,
spec_name="",
start_chan_... | 25.429448 | 75 | 0.588902 | from pyne.utils import QA_warn
import copy
QA_warn(__name__)
class PhSpectrum(object):
def __init__(
self,
spec_name="",
start_chan_num=0,
num_channels=0,
channels=None,
ebin=None,
counts=None,
):
self.channels = [] if channels is None else ... | true | true |
f775818584eadf0369e22addc8be4eab9da0df40 | 20,309 | py | Python | zounds/spectral/frequencyscale.py | FelixAbrahamsson/zounds | 197c358acf3bea4252cfc2561da70cbe799e2c75 | [
"MIT"
] | 20 | 2016-06-04T05:44:28.000Z | 2021-05-26T02:26:08.000Z | zounds/spectral/frequencyscale.py | FelixAbrahamsson/zounds | 197c358acf3bea4252cfc2561da70cbe799e2c75 | [
"MIT"
] | 53 | 2016-08-07T15:11:38.000Z | 2019-05-21T15:56:40.000Z | zounds/spectral/frequencyscale.py | FelixAbrahamsson/zounds | 197c358acf3bea4252cfc2561da70cbe799e2c75 | [
"MIT"
] | 7 | 2016-08-14T15:50:33.000Z | 2020-12-22T13:34:23.000Z |
import numpy as np
import bisect
class Hertz(float):
def __init__(self, hz):
try:
self.hz = hz.hz
except AttributeError:
self.hz = hz
def __neg__(self):
return Hertz(-self.hz)
def __add__(self, other):
try:
other = other.hz
exc... | 32.4944 | 85 | 0.616574 |
import numpy as np
import bisect
class Hertz(float):
def __init__(self, hz):
try:
self.hz = hz.hz
except AttributeError:
self.hz = hz
def __neg__(self):
return Hertz(-self.hz)
def __add__(self, other):
try:
other = other.hz
exc... | true | true |
f775820c97f96673064d8595720180e55ccf3031 | 2,022 | py | Python | openpyxlzip/descriptors/office_art.py | ankitJoshi03/openpyxlzip | f3b8aa2f80f9d8bc31ce5fcf05c822d88d2ff647 | [
"MIT"
] | null | null | null | openpyxlzip/descriptors/office_art.py | ankitJoshi03/openpyxlzip | f3b8aa2f80f9d8bc31ce5fcf05c822d88d2ff647 | [
"MIT"
] | null | null | null | openpyxlzip/descriptors/office_art.py | ankitJoshi03/openpyxlzip | f3b8aa2f80f9d8bc31ce5fcf05c822d88d2ff647 | [
"MIT"
] | null | null | null | #copyright openpyxlzip 2010-2018
"""
Excel office art descriptors
"""
from openpyxlzip.xml.constants import REL_NS, DRAWING_NS, DRAWING_16_NS, DRAWING_14_NS
from openpyxlzip.compat import safe_string
from openpyxlzip.xml.functions import Element
from openpyxlzip.descriptors import (
Typed,)
from . import (
M... | 22.21978 | 86 | 0.626607 |
from openpyxlzip.xml.constants import REL_NS, DRAWING_NS, DRAWING_16_NS, DRAWING_14_NS
from openpyxlzip.compat import safe_string
from openpyxlzip.xml.functions import Element
from openpyxlzip.descriptors import (
Typed,)
from . import (
MatchPattern,
MinMax,
Integer,
String,
Sequence,
)
from... | true | true |
f775827c36c0a39bf13ef1d5d6797b0bd5aedf3b | 2,425 | py | Python | oneview_redfish_toolkit/tests/api/test_blade_manager.py | lhsvobodaj/oneview-redfish-toolkit | fc5c2055bb0710f706d45e9fe28039d9f0752c20 | [
"Apache-2.0"
] | null | null | null | oneview_redfish_toolkit/tests/api/test_blade_manager.py | lhsvobodaj/oneview-redfish-toolkit | fc5c2055bb0710f706d45e9fe28039d9f0752c20 | [
"Apache-2.0"
] | null | null | null | oneview_redfish_toolkit/tests/api/test_blade_manager.py | lhsvobodaj/oneview-redfish-toolkit | fc5c2055bb0710f706d45e9fe28039d9f0752c20 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (2017) Hewlett Packard Enterprise Development LP
#
# 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... | 33.219178 | 75 | 0.677938 |
import json
from oneview_redfish_toolkit.api.blade_manager import BladeManager
from oneview_redfish_toolkit import util
import unittest
from unittest import mock
class TestBladeManager(unittest.TestCase):
@mock.patch.object(util, 'OneViewClient')
def setUp(self, oneview_client_mock):
uti... | true | true |
f775834a9af8eddb14450b01bacdbda38ad47d42 | 326 | py | Python | tem/tem_01_for_win/fuckpath.py | zhangxiansheng/evepi | b1cc7a5b9a5d2867f33d62b01985eced4c533153 | [
"MIT"
] | null | null | null | tem/tem_01_for_win/fuckpath.py | zhangxiansheng/evepi | b1cc7a5b9a5d2867f33d62b01985eced4c533153 | [
"MIT"
] | null | null | null | tem/tem_01_for_win/fuckpath.py | zhangxiansheng/evepi | b1cc7a5b9a5d2867f33d62b01985eced4c533153 | [
"MIT"
] | null | null | null | #coding=utf-8
#该脚本用来对json文件标准化以保证不同环境下的识别率
import os
NAME = "tem_01"
try:
w = open( r"C:\evepi\%s\fuckpath.md" % NAME, "w" )
except:
os.system( "MD C:\evepi" )
os.system( "MD C:\evepi\%s" % NAME )
w = open( r"C:\etc\%s\fuckpath.md" % NAME, "w" )
path = os.getcwd() + "\\fuck.json"
w.write( path )
w.c... | 19.176471 | 54 | 0.58589 |
import os
NAME = "tem_01"
try:
w = open( r"C:\evepi\%s\fuckpath.md" % NAME, "w" )
except:
os.system( "MD C:\evepi" )
os.system( "MD C:\evepi\%s" % NAME )
w = open( r"C:\etc\%s\fuckpath.md" % NAME, "w" )
path = os.getcwd() + "\\fuck.json"
w.write( path )
w.close() | true | true |
f775847cc6bf0281daa228fb8733b3f9e0289781 | 4,954 | py | Python | cedm/evaluation/EvaluationManager.py | vmishra04/Pydial | a689fa1177cd34f32dd4d30a5a6140fb721855bf | [
"Apache-2.0"
] | 2 | 2020-01-20T14:43:27.000Z | 2021-04-29T12:21:05.000Z | cedm/evaluation/EvaluationManager.py | vmishra04/Pydial | a689fa1177cd34f32dd4d30a5a6140fb721855bf | [
"Apache-2.0"
] | null | null | null | cedm/evaluation/EvaluationManager.py | vmishra04/Pydial | a689fa1177cd34f32dd4d30a5a6140fb721855bf | [
"Apache-2.0"
] | null | null | null | ###############################################################################
# PyDial: Multi-domain Statistical Spoken Dialogue System Software
###############################################################################
#
# Copyright 2015 - 2019
# Cambridge University Engineering Department Dialogue Systems Grou... | 41.630252 | 174 | 0.635648 |
__author__ = "cued_dialogue_systems_group"
from evaluation import EvaluationManager as em
from utils import ContextLogger
logger = ContextLogger.getLogger('')
class EvaluationManager(em.EvaluationManager):
def turnReward(self, domainString, turnInfo):
dString = turnInf... | true | true |
f7758535b4f55badecdb7b794f60355a133ed4ae | 1,751 | py | Python | temp/maintestgraph.py | Pugavkomm/NS-analyst | 698af0e94f57b431fd77c17c49d4a23f11d21d3f | [
"MIT"
] | null | null | null | temp/maintestgraph.py | Pugavkomm/NS-analyst | 698af0e94f57b431fd77c17c49d4a23f11d21d3f | [
"MIT"
] | null | null | null | temp/maintestgraph.py | Pugavkomm/NS-analyst | 698af0e94f57b431fd77c17c49d4a23f11d21d3f | [
"MIT"
] | null | null | null | import sys
import time
import numpy as np
from matplotlib.backends.qt_compat import QtCore, QtWidgets, is_pyqt5
if is_pyqt5():
from matplotlib.backends.backend_qt5agg import (
FigureCanvas, NavigationToolbar2QT as NavigationToolbar)
else:
from matplotlib.backends.backend_qt4agg import (
Figure... | 33.037736 | 69 | 0.675043 | import sys
import time
import numpy as np
from matplotlib.backends.qt_compat import QtCore, QtWidgets, is_pyqt5
if is_pyqt5():
from matplotlib.backends.backend_qt5agg import (
FigureCanvas, NavigationToolbar2QT as NavigationToolbar)
else:
from matplotlib.backends.backend_qt4agg import (
Figure... | true | true |
f7758580b20eaa35900faa0880928e51da55bfa3 | 26,530 | py | Python | Archive/SecurityHubToSplunkLambdaVerbose/NewBotoVersion/botocore/model.py | leaderdevops/splunk-for-securityHub | 8414d8eb7da2943c81d8409e84b55b3098e19103 | [
"MIT"
] | 36 | 2019-11-06T20:49:07.000Z | 2021-07-07T02:26:52.000Z | Archive/SecurityHubToSplunkLambdaVerbose/NewBotoVersion/botocore/model.py | leaderdevops/splunk-for-securityHub | 8414d8eb7da2943c81d8409e84b55b3098e19103 | [
"MIT"
] | 21 | 2019-11-10T05:38:06.000Z | 2022-03-10T15:07:48.000Z | Archive/SecurityHubToSplunkLambdaVerbose/NewBotoVersion/botocore/model.py | leaderdevops/splunk-for-securityHub | 8414d8eb7da2943c81d8409e84b55b3098e19103 | [
"MIT"
] | 19 | 2019-01-11T13:02:28.000Z | 2021-09-09T03:00:55.000Z | # Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | 34.49935 | 79 | 0.627554 | from collections import defaultdict
from botocore.utils import CachedProperty, instance_cache, hyphenize_service_id
from botocore.compat import OrderedDict
from botocore.exceptions import MissingServiceIdError
from botocore.exceptions import UndefinedModelAttributeError
NOT_SET = object()
class NoShapeFoundError(Ex... | true | true |
f775869e8a9879a9948218bcca5891cac5ebdd69 | 3,011 | py | Python | tests/unit/datacenters/conftest.py | DoctorJohn/hcloud-python | fad870790a19621fd130fd28d564a8d6ba7a566c | [
"MIT"
] | 156 | 2019-02-21T09:19:07.000Z | 2022-03-14T12:19:23.000Z | tests/unit/datacenters/conftest.py | DoctorJohn/hcloud-python | fad870790a19621fd130fd28d564a8d6ba7a566c | [
"MIT"
] | 69 | 2018-12-20T16:05:30.000Z | 2022-03-28T21:06:31.000Z | tests/unit/datacenters/conftest.py | DoctorJohn/hcloud-python | fad870790a19621fd130fd28d564a8d6ba7a566c | [
"MIT"
] | 37 | 2019-02-22T08:32:07.000Z | 2022-02-02T12:42:45.000Z | import pytest
@pytest.fixture()
def datacenter_response():
return {
"datacenter": {
"id": 1,
"name": "fsn1-dc8",
"description": "Falkenstein 1 DC 8",
"location": {
"id": 1,
"name": "fsn1",
"description": "Falke... | 29.519608 | 59 | 0.340751 | import pytest
@pytest.fixture()
def datacenter_response():
return {
"datacenter": {
"id": 1,
"name": "fsn1-dc8",
"description": "Falkenstein 1 DC 8",
"location": {
"id": 1,
"name": "fsn1",
"description": "Falke... | true | true |
f775875cc57bb0a1e5c53034c176d006d53a8833 | 1,504 | py | Python | workshop/subscriptions/migrations/0002_auto_20201126_2259.py | yanfonseca/workshop | b4e640374c6bed86e821296589cdad0d1893d752 | [
"MIT"
] | null | null | null | workshop/subscriptions/migrations/0002_auto_20201126_2259.py | yanfonseca/workshop | b4e640374c6bed86e821296589cdad0d1893d752 | [
"MIT"
] | null | null | null | workshop/subscriptions/migrations/0002_auto_20201126_2259.py | yanfonseca/workshop | b4e640374c6bed86e821296589cdad0d1893d752 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.3 on 2020-11-26 22:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('subscriptions', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='subscription',
options={'order... | 31.333333 | 117 | 0.575133 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('subscriptions', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='subscription',
options={'ordering': ('-created_at',), 'verbose_name': 'Inscriç... | true | true |
f775878ef71b475ac7c069248a2eb85013ae00b1 | 7,839 | py | Python | kriging/estimar_outlier.py | jpmerlet/gp_spc | 9b0324c5cac3b1001ec2a6641c3da38ae7f23c7e | [
"Apache-2.0"
] | null | null | null | kriging/estimar_outlier.py | jpmerlet/gp_spc | 9b0324c5cac3b1001ec2a6641c3da38ae7f23c7e | [
"Apache-2.0"
] | null | null | null | kriging/estimar_outlier.py | jpmerlet/gp_spc | 9b0324c5cac3b1001ec2a6641c3da38ae7f23c7e | [
"Apache-2.0"
] | null | null | null | from block_model.controller.block_model import BlockModel
from drillhole.controller.composites import Composites
from geometry.controller.ellipsoid import Ellipsoid
from kriging.controller.search_ellipsoid import SearchEllipsoid
from kriging.controller.point_kriging import PointKriging
from variogram.controller.model i... | 40.828125 | 119 | 0.62036 | from block_model.controller.block_model import BlockModel
from drillhole.controller.composites import Composites
from geometry.controller.ellipsoid import Ellipsoid
from kriging.controller.search_ellipsoid import SearchEllipsoid
from kriging.controller.point_kriging import PointKriging
from variogram.controller.model i... | true | true |
f775884daddb4eb99cce0cdd6e5a0b096f33378a | 18,139 | py | Python | scripts/rendernode.py | oktomus/appleseed | 067d2ed3483d97ed58058efbe418299e9dc8ca4f | [
"MIT"
] | 1,907 | 2015-01-04T00:13:22.000Z | 2022-03-30T15:14:00.000Z | scripts/rendernode.py | oktomus/appleseed | 067d2ed3483d97ed58058efbe418299e9dc8ca4f | [
"MIT"
] | 1,196 | 2015-01-04T10:50:01.000Z | 2022-03-04T09:18:22.000Z | scripts/rendernode.py | oktomus/appleseed | 067d2ed3483d97ed58058efbe418299e9dc8ca4f | [
"MIT"
] | 373 | 2015-01-06T10:08:53.000Z | 2022-03-12T10:25:57.000Z | #!/usr/bin/python
#
# This source file is part of appleseed.
# Visit https://appleseedhq.net/ for additional information and resources.
#
# This software is released under the MIT license.
#
# Copyright (c) 2012-2013 Jonathan Topf, Jupiter Jazz Limited
# Copyright (c) 2014-2018 Jonathan Topf, The appleseedhq Organizat... | 35.358674 | 109 | 0.576438 |
import argparse
import datetime
import os
import random
import shutil
import socket
import string
import subprocess
import sys
import time
import traceback
import xml.dom.minidom as xml
from utils import print_runtime_details
VERSION = "1.18"
RENDERS_DIR = "_renders"
ARCHIVE_DIR = "_archives"
LOGS_DIR = "_logs"
P... | false | true |
f77588bf190ff8aa9fa339d8c2cb8481bf2c3820 | 959 | py | Python | src/shortener/forms.py | AbhishekTiwari72/Try-Django-1.10 | 734dff12fe5835320518d05ff52d10663757f75d | [
"MIT"
] | 129 | 2016-10-18T14:33:50.000Z | 2022-02-20T07:22:30.000Z | src/shortener/forms.py | AbhishekTiwari72/Try-Django-1.10 | 734dff12fe5835320518d05ff52d10663757f75d | [
"MIT"
] | 6 | 2017-03-14T09:11:58.000Z | 2021-07-14T07:06:10.000Z | src/shortener/forms.py | AbhishekTiwari72/Try-Django-1.10 | 734dff12fe5835320518d05ff52d10663757f75d | [
"MIT"
] | 97 | 2016-10-28T15:45:10.000Z | 2021-08-24T11:32:56.000Z | from django import forms
from .validators import validate_url, validate_dot_com
class SubmitUrlForm(forms.Form):
url = forms.CharField(
label='',
validators=[validate_url],
widget = forms.TextInput(
attrs ={
"placeholder": "Long URL... | 28.205882 | 71 | 0.493222 | from django import forms
from .validators import validate_url, validate_dot_com
class SubmitUrlForm(forms.Form):
url = forms.CharField(
label='',
validators=[validate_url],
widget = forms.TextInput(
attrs ={
"placeholder": "Long URL... | true | true |
f77589915e736e5b38bb404a67d4129528b8283f | 3,848 | py | Python | src/utilities/image_conversions.py | xpenalosa/Text-To-Image-Encryption | 667a0cc62a3495f6349e09992a99313f941ea2f4 | [
"MIT"
] | null | null | null | src/utilities/image_conversions.py | xpenalosa/Text-To-Image-Encryption | 667a0cc62a3495f6349e09992a99313f941ea2f4 | [
"MIT"
] | null | null | null | src/utilities/image_conversions.py | xpenalosa/Text-To-Image-Encryption | 667a0cc62a3495f6349e09992a99313f941ea2f4 | [
"MIT"
] | null | null | null | from typing import Tuple
import math
from random import choices as random_choices
from PIL import Image
padding_info_bytes = 2
def get_min_image_size(data: bytearray) -> Tuple[int, int]:
""" Find the minimum pixels required to create a square from an array.
Calculates the minimum dimensions used to create a... | 37 | 80 | 0.714137 | from typing import Tuple
import math
from random import choices as random_choices
from PIL import Image
padding_info_bytes = 2
def get_min_image_size(data: bytearray) -> Tuple[int, int]:
data_bytes = len(data) + padding_info_bytes
pixel_bytes = data_bytes + data_bytes % 3
short_side = math.floor(mat... | true | true |
f7758a2a30f229555df2e0e2f4bceec611f0469d | 377 | py | Python | src/noggin/__init__.py | rsokl/noggin | 154e4fffa3298eb1f65e1720712b21264733a7cd | [
"MIT"
] | 25 | 2019-05-28T13:59:43.000Z | 2021-08-20T00:08:10.000Z | src/noggin/__init__.py | rsokl/noggin | 154e4fffa3298eb1f65e1720712b21264733a7cd | [
"MIT"
] | 23 | 2019-05-30T14:51:58.000Z | 2020-04-17T15:53:20.000Z | src/noggin/__init__.py | rsokl/noggin | 154e4fffa3298eb1f65e1720712b21264733a7cd | [
"MIT"
] | 1 | 2020-04-17T15:54:52.000Z | 2020-04-17T15:54:52.000Z | from noggin._version import get_versions
from noggin.plotter import LivePlot
from noggin.logger import LiveLogger
from noggin.utils import create_plot, save_metrics, load_metrics, plot_logger
__version__ = get_versions()["version"]
del get_versions
__all__ = [
"create_plot",
"plot_logger",
"save_metrics",... | 22.176471 | 77 | 0.748011 | from noggin._version import get_versions
from noggin.plotter import LivePlot
from noggin.logger import LiveLogger
from noggin.utils import create_plot, save_metrics, load_metrics, plot_logger
__version__ = get_versions()["version"]
del get_versions
__all__ = [
"create_plot",
"plot_logger",
"save_metrics",... | true | true |
f7758a7971002f0805264dff7d1011f3dbc926c9 | 704 | py | Python | parkrundata/migrations/0002_auto_20180717_0815.py | remarkablerocket/parkrundata | c717b59771629d6308ec093e29fd373981726fde | [
"BSD-3-Clause"
] | null | null | null | parkrundata/migrations/0002_auto_20180717_0815.py | remarkablerocket/parkrundata | c717b59771629d6308ec093e29fd373981726fde | [
"BSD-3-Clause"
] | null | null | null | parkrundata/migrations/0002_auto_20180717_0815.py | remarkablerocket/parkrundata | c717b59771629d6308ec093e29fd373981726fde | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 2.0.5 on 2018-07-17 13:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('parkrundata', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='event',
name='is_discontinued',
... | 24.275862 | 53 | 0.566761 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('parkrundata', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='event',
name='is_discontinued',
field=models.BooleanField(default=False... | true | true |
f7758c53f2cac0e1885e72591ccc0aa6031d7813 | 515 | py | Python | Contents/Libraries/Shared/wraptor/decorators/test/test_timeout.py | jippo015/Sub-Zero.bundle | 734e0f7128c05c0f639e11e7dfc77daa1014064b | [
"MIT"
] | 1,553 | 2015-11-09T02:17:06.000Z | 2022-03-31T20:24:52.000Z | Contents/Libraries/Shared/wraptor/decorators/test/test_timeout.py | saiterlz/Sub-Zero.bundle | 1a0bb9c3e4be84be35d46672907783363fe5a87b | [
"MIT"
] | 691 | 2015-11-05T21:32:26.000Z | 2022-03-17T10:52:45.000Z | Contents/Libraries/Shared/wraptor/decorators/test/test_timeout.py | saiterlz/Sub-Zero.bundle | 1a0bb9c3e4be84be35d46672907783363fe5a87b | [
"MIT"
] | 162 | 2015-11-06T19:38:55.000Z | 2022-03-16T02:42:41.000Z | import time
from wraptor.decorators import timeout, TimeoutException
def test_basic():
@timeout(1)
def fn():
try:
time.sleep(2)
assert False
except TimeoutException:
pass
fn()
def test_catch_exception_outsize():
@timeout(1)
def fn():
tim... | 16.09375 | 56 | 0.553398 | import time
from wraptor.decorators import timeout, TimeoutException
def test_basic():
@timeout(1)
def fn():
try:
time.sleep(2)
assert False
except TimeoutException:
pass
fn()
def test_catch_exception_outsize():
@timeout(1)
def fn():
tim... | true | true |
f7758d007edd9fb70fa073d0b82b0a84f78bd383 | 13,707 | py | Python | examples/advection_2d_flagregions/setrun.py | rjleveque/amrclaw | d7acfe4a71b2515778b134540a015923ce77a3cd | [
"BSD-3-Clause"
] | 16 | 2015-05-27T08:16:09.000Z | 2022-01-21T06:36:24.000Z | examples/advection_2d_flagregions/setrun.py | clawpack/amrclaw | d7acfe4a71b2515778b134540a015923ce77a3cd | [
"BSD-3-Clause"
] | 107 | 2015-01-02T19:51:43.000Z | 2021-11-24T03:35:32.000Z | examples/advection_2d_flagregions/setrun.py | rjleveque/amrclaw | d7acfe4a71b2515778b134540a015923ce77a3cd | [
"BSD-3-Clause"
] | 28 | 2015-01-10T00:03:56.000Z | 2022-02-11T23:52:34.000Z | """
Module to set up run time parameters for Clawpack.
The values set in the function setrun are then written out to data files
that will be read in by the Fortran code.
"""
from __future__ import absolute_import
import os
import numpy as np
# used to create ruled rectangle:
from clawpack.amrclaw import regio... | 33.028916 | 92 | 0.601809 |
from __future__ import absolute_import
import os
import numpy as np
from clawpack.amrclaw import region_tools
def setrun(claw_pkg='amrclaw'):
from clawpack.clawutil import data
assert claw_pkg.lower() == 'amrclaw', "Expected claw_pkg = 'amrclaw'"
num_dim = 2
rundata = data.Cl... | true | true |
f7758d2f05100910059febfc4f81b7d971160b30 | 37,340 | py | Python | pymel/internal/startup.py | JFlynnXYZ/pymel | 2aa254c7982c78aac3e30e8d1b6a85f2465f898e | [
"BSD-3-Clause"
] | 287 | 2015-01-03T21:18:59.000Z | 2022-03-16T07:55:33.000Z | pymel/internal/startup.py | JFlynnXYZ/pymel | 2aa254c7982c78aac3e30e8d1b6a85f2465f898e | [
"BSD-3-Clause"
] | 412 | 2015-06-19T15:13:33.000Z | 2022-02-25T08:12:25.000Z | pymel/internal/startup.py | JFlynnXYZ/pymel | 2aa254c7982c78aac3e30e8d1b6a85f2465f898e | [
"BSD-3-Clause"
] | 106 | 2015-01-03T06:46:44.000Z | 2022-03-30T15:43:01.000Z | """
Maya-related functions, which are useful to both `api` and `core`, including `mayaInit` which ensures
that maya is initialized in standalone mode.
"""
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from builtins import zip
from builtins import object
imp... | 35.460589 | 137 | 0.610927 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from builtins import zip
from builtins import object
import os.path
import sys
import glob
import inspect
import pprint
import maya
import maya.OpenMaya as om
import maya.utils
import pymel.util
import pymel.ut... | true | true |
f7758e476b1619e36f05fafd01225df004310914 | 1,880 | py | Python | Button/ELB0306.py | kagurazakayashi/pi | e44f1de05972f361ee50f93df99cd4f1f6af9d21 | [
"MIT"
] | null | null | null | Button/ELB0306.py | kagurazakayashi/pi | e44f1de05972f361ee50f93df99cd4f1f6af9d21 | [
"MIT"
] | null | null | null | Button/ELB0306.py | kagurazakayashi/pi | e44f1de05972f361ee50f93df99cd4f1f6af9d21 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: UTF-8 -*-
"""
响应按钮
"""
import RPi.GPIO as GPIO
import time
class Buttons():
# 设置引脚编码模式
gpioMode = GPIO.BCM
# 检测电平是上升还是下降 GPIO.PUD_UP / GPIO.PUD_DOWN:
pudMode = GPIO.PUD_UP
# 0 视为按下还是 1 视为按下
isDownVal: int = 0
# 按键时可能有电平抖动,进行几次重复验证
chkDownTimes: int = 2... | 28.059701 | 71 | 0.510106 |
import RPi.GPIO as GPIO
import time
class Buttons():
gpioMode = GPIO.BCM
pudMode = GPIO.PUD_UP
isDownVal: int = 0
chkDownTimes: int = 2
chkDownTime: float = 0.05
keys = [20]
keysLen = 0
keyIsDown = []
keyChkDown = []
def __init__(self):
GP... | true | true |
f7758e7e9d54b63507f07979a0af8d27ec099b88 | 11,539 | py | Python | irl/mdp/gridworld.py | pragupta/Inverse-Reinforcement-Learning | e7bbb7bb0ad24ebc36d9e0d4b4e6c6788229fd9c | [
"MIT"
] | null | null | null | irl/mdp/gridworld.py | pragupta/Inverse-Reinforcement-Learning | e7bbb7bb0ad24ebc36d9e0d4b4e6c6788229fd9c | [
"MIT"
] | null | null | null | irl/mdp/gridworld.py | pragupta/Inverse-Reinforcement-Learning | e7bbb7bb0ad24ebc36d9e0d4b4e6c6788229fd9c | [
"MIT"
] | null | null | null | """
Implements the gridworld MDP.
Matthew Alger, 2015
matthew.alger@anu.edu.au
"""
import numpy as np
import numpy.random as rn
import matplotlib.pyplot as plt
class Gridworld(object):
"""
Gridworld MDP.
"""
def __init__(self, grid_size, wind, discount):
"""
grid_size: Grid size. int... | 33.063037 | 80 | 0.519716 |
import numpy as np
import numpy.random as rn
import matplotlib.pyplot as plt
class Gridworld(object):
def __init__(self, grid_size, wind, discount):
self.actions = ((1, 0), (0, 1), (-1, 0), (0, -1), (0, 0))
self.n_actions = len(self.actions)
self.n_states = grid_size**2
self.grid... | true | true |
f7758f64253c800e4c6ee339ecf3a2d15ef17809 | 1,083 | py | Python | PythonNetCode/chapter9/9_2_save_packets_in_pcap_format.py | AirChen/PythonPractic | 676708237dc502ea9a60218a3ca134874bd18456 | [
"MIT"
] | null | null | null | PythonNetCode/chapter9/9_2_save_packets_in_pcap_format.py | AirChen/PythonPractic | 676708237dc502ea9a60218a3ca134874bd18456 | [
"MIT"
] | null | null | null | PythonNetCode/chapter9/9_2_save_packets_in_pcap_format.py | AirChen/PythonPractic | 676708237dc502ea9a60218a3ca134874bd18456 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Python Network Programming Cookbook -- Chapter - 9
# This program is optimized for Python 2.7.
# It may run on any other version with/without modifications.
import os
from scapy.all import *
pkts = []
count = 0
pcapnum = 0
def write_cap(x):
global pkts
global count
global pcapnum
... | 23.543478 | 72 | 0.591874 |
import os
from scapy.all import *
pkts = []
count = 0
pcapnum = 0
def write_cap(x):
global pkts
global count
global pcapnum
pkts.append(x)
count += 1
if count == 3:
pcapnum += 1
pname = "pcap%d.pcap" % pcapnum
wrpcap(pname, pkts)
pkts = []
count = 0
de... | false | true |
f7758ff0807ab6ee28017ce80a30a4d130ad7f03 | 768 | py | Python | hystreet/hystreet_to_s3/compute_station_means.py | cfleschhut/virushack | 2fe7ded0be8672b066edef7fed52573794db2ba5 | [
"Apache-2.0"
] | 29 | 2020-03-21T00:47:51.000Z | 2021-07-17T15:50:33.000Z | hystreet/hystreet_to_s3/compute_station_means.py | cfleschhut/virushack | 2fe7ded0be8672b066edef7fed52573794db2ba5 | [
"Apache-2.0"
] | 7 | 2020-03-21T14:04:26.000Z | 2022-03-02T08:05:40.000Z | hystreet/hystreet_to_s3/compute_station_means.py | cfleschhut/virushack | 2fe7ded0be8672b066edef7fed52573794db2ba5 | [
"Apache-2.0"
] | 13 | 2020-03-21T01:08:08.000Z | 2020-04-08T17:21:11.000Z | import pandas as pd
from datetime import datetime, date
def compute_weekday(timestamp):
date_str = timestamp.split('+')[0]
date = datetime.strptime(date_str, '%Y-%m-%dT%H:%M:%S.%f')
return date.weekday()
data = pd.read_csv('data.temp.csv')
data['weekday'] = float("NaN")
for index, row in data.iterrows(... | 36.571429 | 209 | 0.72526 | import pandas as pd
from datetime import datetime, date
def compute_weekday(timestamp):
date_str = timestamp.split('+')[0]
date = datetime.strptime(date_str, '%Y-%m-%dT%H:%M:%S.%f')
return date.weekday()
data = pd.read_csv('data.temp.csv')
data['weekday'] = float("NaN")
for index, row in data.iterrows(... | true | true |
f7759029abd090e23e1cd582c7fea6277c778786 | 360 | py | Python | accounts/models.py | fahimfarhan/cancer-web-app | 6c5d8c5c90b0909cbd161d2ae87b4f12549bdfef | [
"MIT"
] | null | null | null | accounts/models.py | fahimfarhan/cancer-web-app | 6c5d8c5c90b0909cbd161d2ae87b4f12549bdfef | [
"MIT"
] | 5 | 2021-03-18T20:13:38.000Z | 2022-01-13T00:35:37.000Z | accounts/models.py | fahimfarhan/cancer-web-app | 6c5d8c5c90b0909cbd161d2ae87b4f12549bdfef | [
"MIT"
] | null | null | null | from django.contrib.auth.models import User
from django.db import models
# Create your models here.
class Doctor(models.Model):
identity_fk = models.OneToOneField(User, on_delete=models.CASCADE)
mobile = models.IntegerField()
designation = models.CharField(max_length=100, blank=True)
hospital = model... | 30 | 70 | 0.766667 | from django.contrib.auth.models import User
from django.db import models
class Doctor(models.Model):
identity_fk = models.OneToOneField(User, on_delete=models.CASCADE)
mobile = models.IntegerField()
designation = models.CharField(max_length=100, blank=True)
hospital = models.CharField(max_length=100,... | true | true |
f775911433b61c28fbe838235b1f6b3a93369712 | 145 | py | Python | src/net/pluto_tcp_server.py | WardenAllen/Uranus | 0d20cac631320b558254992c17678ddd1658587b | [
"MIT"
] | null | null | null | src/net/pluto_tcp_server.py | WardenAllen/Uranus | 0d20cac631320b558254992c17678ddd1658587b | [
"MIT"
] | null | null | null | src/net/pluto_tcp_server.py | WardenAllen/Uranus | 0d20cac631320b558254992c17678ddd1658587b | [
"MIT"
] | null | null | null | # !/usr/bin/python
# -*- coding: utf-8 -*-
# @Time : 2020/9/18 11:57
# @Author : WardenAllen
# @File : pluto_tcp_server.py
# @Brief :
| 18.125 | 32 | 0.558621 | true | true | |
f77591a33ee461b66e17c216d2698b6cd3953504 | 164 | py | Python | evilmc/__init__.py | BoiseStatePlanetary/evilmc | 4cba92a920587d55f4371bc9d806d63d7d8510cc | [
"BSD-2-Clause"
] | null | null | null | evilmc/__init__.py | BoiseStatePlanetary/evilmc | 4cba92a920587d55f4371bc9d806d63d7d8510cc | [
"BSD-2-Clause"
] | null | null | null | evilmc/__init__.py | BoiseStatePlanetary/evilmc | 4cba92a920587d55f4371bc9d806d63d7d8510cc | [
"BSD-2-Clause"
] | null | null | null | """A python version of the EVIL-MC code"""
__version__ = '0.26'
__author__ = 'Brian Jackson <bjackson@boisestate.edu>'
__all__ = ['evilmc']
from .evilmc import *
| 20.5 | 54 | 0.70122 |
__version__ = '0.26'
__author__ = 'Brian Jackson <bjackson@boisestate.edu>'
__all__ = ['evilmc']
from .evilmc import *
| true | true |
f775938877d4f1983c5ed4cb4bdcdc54e1a52dee | 4,740 | py | Python | pygraphblas/semiring.py | sebbacon/pygraphblas | 7bf01ab2a591994387193daaadcce309f74efad9 | [
"Apache-2.0"
] | null | null | null | pygraphblas/semiring.py | sebbacon/pygraphblas | 7bf01ab2a591994387193daaadcce309f74efad9 | [
"Apache-2.0"
] | null | null | null | pygraphblas/semiring.py | sebbacon/pygraphblas | 7bf01ab2a591994387193daaadcce309f74efad9 | [
"Apache-2.0"
] | null | null | null | """Contains all automatically generated Semirings from CFFI.
This documentation does not show all the semirings in this module
because of the sheer number of them (over 1700). Please see the
SuiteSparse User Guide for more information on the semirings usable in
The GraphBLAS.
All the standard and extension semirings... | 27.719298 | 135 | 0.620042 |
import sys
import re
import contextvars
from itertools import chain
from collections import defaultdict
from .base import lib, ffi, _check
from .monoid import Monoid
from . import types
current_semiring = contextvars.ContextVar("current_semiring")
__all__ = ["Semiring", "current_semiring"]
class Semiring:
__... | true | true |
f775948b3bcb74fa09604bab64bc62b6cb21f7ae | 2,132 | py | Python | packages/w3af/w3af/core/data/constants/file_extensions.py | ZooAtmosphereGroup/HelloPackages | 0ccffd33bf927b13d28c8f715ed35004c33465d9 | [
"Apache-2.0"
] | null | null | null | packages/w3af/w3af/core/data/constants/file_extensions.py | ZooAtmosphereGroup/HelloPackages | 0ccffd33bf927b13d28c8f715ed35004c33465d9 | [
"Apache-2.0"
] | null | null | null | packages/w3af/w3af/core/data/constants/file_extensions.py | ZooAtmosphereGroup/HelloPackages | 0ccffd33bf927b13d28c8f715ed35004c33465d9 | [
"Apache-2.0"
] | null | null | null | """
file_extensions.py
Copyright 2019 Andres Riancho
This file is part of w3af, http://w3af.org/ .
w3af 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 version 2 of the License.
w3af is distributed in the hope ... | 13.408805 | 74 | 0.449812 | JAVASCRIPT = {
'js',
}
CSS = {
'css',
}
FLASH = {
'swf',
}
IMAGES = {
'ase',
'art',
'bmp',
'blp',
'cd5',
'cit',
'cpt',
'cr2',
'cut',
'dds',
'dib',
'djvu',
'egt',
'exif',
'gif',
'gpl',
'grf',
'icns',
'ico',
'iff',
'jng'... | true | true |
f7759537702873818bfb0c87127e1bd7a6965514 | 1,202 | py | Python | cfgov/ask_cfpb/migrations/0043_answerpage_notification.py | adebisi-aden/consumerfinance.gov | 8c0f5afac341823c59f73b0c6bd60592e0f5eaca | [
"CC0-1.0"
] | 37 | 2020-08-18T19:52:39.000Z | 2022-03-23T08:08:41.000Z | cfgov/ask_cfpb/migrations/0043_answerpage_notification.py | adebisi-aden/consumerfinance.gov | 8c0f5afac341823c59f73b0c6bd60592e0f5eaca | [
"CC0-1.0"
] | 338 | 2020-08-14T20:46:36.000Z | 2022-03-31T20:49:32.000Z | cfgov/ask_cfpb/migrations/0043_answerpage_notification.py | adebisi-aden/consumerfinance.gov | 8c0f5afac341823c59f73b0c6bd60592e0f5eaca | [
"CC0-1.0"
] | 14 | 2020-10-21T15:27:03.000Z | 2022-03-17T03:16:36.000Z | # Generated by Django 2.2.20 on 2021-04-23 18:16
from django.db import migrations
import wagtail.core.blocks
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('ask_cfpb', '0042_share_and_print_help'),
]
operations = [
migrations.AddField(
mo... | 57.238095 | 808 | 0.714642 |
from django.db import migrations
import wagtail.core.blocks
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('ask_cfpb', '0042_share_and_print_help'),
]
operations = [
migrations.AddField(
model_name='answerpage',
name='notifica... | true | true |
f775971a681d2da3f23a5c8b430fe96d0dfd3a2d | 862 | py | Python | machine-learning/support-vector-machine/SupportVectorMachine.py | nothingelsematters/university | 5561969b1b11678228aaf7e6660e8b1a93d10294 | [
"WTFPL"
] | 1 | 2018-06-03T17:48:50.000Z | 2018-06-03T17:48:50.000Z | machine-learning/support-vector-machine/SupportVectorMachine.py | nothingelsematters/University | b1e188cb59e5a436731b92c914494626a99e1ae0 | [
"WTFPL"
] | null | null | null | machine-learning/support-vector-machine/SupportVectorMachine.py | nothingelsematters/University | b1e188cb59e5a436731b92c914494626a99e1ae0 | [
"WTFPL"
] | 14 | 2019-04-07T21:27:09.000Z | 2021-12-05T13:37:25.000Z | import numpy as np
import subprocess
import pathlib
def support_vector_machine(objects: np.array, results: np.array, c: int):
executablePath = "%s/support-vector-machine" % pathlib.Path(__file__).parent.absolute()
p = subprocess.Popen(executablePath, stdin=subprocess.PIPE, stdout=subprocess.PIPE, shell=True)
... | 26.9375 | 99 | 0.62181 | import numpy as np
import subprocess
import pathlib
def support_vector_machine(objects: np.array, results: np.array, c: int):
executablePath = "%s/support-vector-machine" % pathlib.Path(__file__).parent.absolute()
p = subprocess.Popen(executablePath, stdin=subprocess.PIPE, stdout=subprocess.PIPE, shell=True)
... | true | true |
f775971e3cb9ab86132605bbdb4f4d4e9daac0f6 | 1,953 | py | Python | easilyb/crawler/__init__.py | xaled/easilyb | cdb5f738205f700b37e03c50d04061a2d1e730cc | [
"MIT"
] | null | null | null | easilyb/crawler/__init__.py | xaled/easilyb | cdb5f738205f700b37e03c50d04061a2d1e730cc | [
"MIT"
] | null | null | null | easilyb/crawler/__init__.py | xaled/easilyb | cdb5f738205f700b37e03c50d04061a2d1e730cc | [
"MIT"
] | null | null | null | from easilyb.urlselector import UrlSelector
from easilyb.net.requestqueue import Requester
from lxml.html import fromstring
import logging
logger = logging.getLogger(__name__)
def _crawler_callback(resp, index=None):
url,counter, depth, crawler = index
crawler._parse_response(url, depth, resp)
class LxmlX... | 33.101695 | 116 | 0.656938 | from easilyb.urlselector import UrlSelector
from easilyb.net.requestqueue import Requester
from lxml.html import fromstring
import logging
logger = logging.getLogger(__name__)
def _crawler_callback(resp, index=None):
url,counter, depth, crawler = index
crawler._parse_response(url, depth, resp)
class LxmlX... | true | true |
f77597a5d990e2878a958ebb81da0905aaf7356a | 1,060 | py | Python | accounts/migrations/0018_auto_20150130_0403.py | CMU-TRP/podd-api | 6eb5c4598f848f75d131287163cd9babf2a0a0fc | [
"MIT"
] | 3 | 2020-04-26T06:28:50.000Z | 2021-04-05T08:02:26.000Z | accounts/migrations/0018_auto_20150130_0403.py | CMU-TRP/podd-api | 6eb5c4598f848f75d131287163cd9babf2a0a0fc | [
"MIT"
] | 10 | 2020-06-05T17:36:10.000Z | 2022-03-11T23:16:42.000Z | accounts/migrations/0018_auto_20150130_0403.py | CMU-TRP/podd-api | 6eb5c4598f848f75d131287163cd9babf2a0a0fc | [
"MIT"
] | 5 | 2021-04-08T08:43:49.000Z | 2021-11-27T06:36:46.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0017_auto_20150129_1257'),
]
operations = [
migrations.AlterField(
model_name='user',
na... | 50.47619 | 674 | 0.69434 | from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0017_auto_20150129_1257'),
]
operations = [
migrations.AlterField(
model_name='user',
name='status',
... | true | true |
f77597ca165893c0a9c9cc390c08eabe40dc9ba1 | 891 | py | Python | utils/plotting.py | OtavioPiza/project-euler | 96ca6d5af85ab2c2b911e38d89a78ac2443fbc5f | [
"MIT"
] | null | null | null | utils/plotting.py | OtavioPiza/project-euler | 96ca6d5af85ab2c2b911e38d89a78ac2443fbc5f | [
"MIT"
] | null | null | null | utils/plotting.py | OtavioPiza/project-euler | 96ca6d5af85ab2c2b911e38d89a78ac2443fbc5f | [
"MIT"
] | null | null | null | from matplotlib import pyplot as plt
from typing import Any, NoReturn, Tuple, List
def plot_range(params: Tuple[Tuple[Any], ...], functions: Tuple[(Any, )], x_label: str = 'input',
x_axis_labeling_function: (Any) = lambda i: i[0]) -> NoReturn:
"""
plots the time each function took to execute ea... | 35.64 | 120 | 0.665544 | from matplotlib import pyplot as plt
from typing import Any, NoReturn, Tuple, List
def plot_range(params: Tuple[Tuple[Any], ...], functions: Tuple[(Any, )], x_label: str = 'input',
x_axis_labeling_function: (Any) = lambda i: i[0]) -> NoReturn:
x_axis: List[Any] = list(map(x_axis_labeling_function, ... | true | true |
f77599a9b46d3f0278e248e2bd3ebe0c857095d4 | 20,657 | py | Python | gui/qt/network_dialog.py | GetAywa/electrum-aywa | 07a548bd14cdf563da49c1f1e52644b833ca972e | [
"MIT"
] | null | null | null | gui/qt/network_dialog.py | GetAywa/electrum-aywa | 07a548bd14cdf563da49c1f1e52644b833ca972e | [
"MIT"
] | null | null | null | gui/qt/network_dialog.py | GetAywa/electrum-aywa | 07a548bd14cdf563da49c1f1e52644b833ca972e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including witho... | 39.346667 | 151 | 0.632376 |
import socket
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
import PyQt5.QtCore as QtCore
from electrum_dash.i18n import _
from electrum_dash.bitcoin import NetworkConstants
from electrum_dash.util import print_error
from .util import *
protocol_names = ['TCP', 'SSL']
protocol_... | true | true |
f77599ec96c169139410dac273f4bb5bec2d1cf1 | 130 | py | Python | ros_ws/src/baxter_interface/src/baxter_interface/limb.py | mesneym/Baxter-Arm-PP | fdbf86309bc64c31af105daa026b2f8519710129 | [
"MIT"
] | null | null | null | ros_ws/src/baxter_interface/src/baxter_interface/limb.py | mesneym/Baxter-Arm-PP | fdbf86309bc64c31af105daa026b2f8519710129 | [
"MIT"
] | null | null | null | ros_ws/src/baxter_interface/src/baxter_interface/limb.py | mesneym/Baxter-Arm-PP | fdbf86309bc64c31af105daa026b2f8519710129 | [
"MIT"
] | null | null | null | version https://git-lfs.github.com/spec/v1
oid sha256:3b8f51dee337fe8b24d70642383ff0257e4a18a20fcfe9bcdcfd4c47073d9515
size 16016
| 32.5 | 75 | 0.884615 | version https://git-lfs.github.com/spec/v1
oid sha256:3b8f51dee337fe8b24d70642383ff0257e4a18a20fcfe9bcdcfd4c47073d9515
size 16016
| false | true |
f7759a4d4d65e9ed02843dfe517b9bb9f14f8dd3 | 7,424 | py | Python | selfdrive/controls/lib/radar_helpers.py | skynetera/openpilot | a7e099c946800c7a8b60c47678801d9a95f95549 | [
"MIT"
] | 4 | 2017-02-17T07:02:37.000Z | 2022-03-17T13:50:00.000Z | selfdrive/controls/lib/radar_helpers.py | mjiujiang/openpilot | a7e099c946800c7a8b60c47678801d9a95f95549 | [
"MIT"
] | null | null | null | selfdrive/controls/lib/radar_helpers.py | mjiujiang/openpilot | a7e099c946800c7a8b60c47678801d9a95f95549 | [
"MIT"
] | 3 | 2017-10-12T23:31:24.000Z | 2022-01-26T09:59:28.000Z | import numpy as np
import platform
import os
import sys
from common.kalman.ekf import FastEKF1D, SimpleSensor
# radar tracks
SPEED, ACCEL = 0, 1 # Kalman filter states enum
rate, ratev = 20., 20. # model and radar are both at 20Hz
ts = 1./rate
freq_v_lat = 0.2 # Hz
k_v_lat = 2*np.pi*freq_v_lat*ts / (1 + 2*np.pi... | 28.88716 | 144 | 0.655981 | import numpy as np
import platform
import os
import sys
from common.kalman.ekf import FastEKF1D, SimpleSensor
SPEED, ACCEL = 0, 1
rate, ratev = 20., 20. ts = 1./rate
freq_v_lat = 0.2 k_v_lat = 2*np.pi*freq_v_lat*ts / (1 + 2*np.pi*freq_v_lat*ts)
freq_a_lead = .5 k_a_lead = 2*np.pi*freq_a_lead*ts / (1 + 2*np.pi*... | true | true |
f7759b832e33f91ee4e2929d59cc25d295795b5b | 2,752 | py | Python | waferscreen/plot/band_and_keepout.py | chw3k5/WaferScreen | c0ca7fe939fe7cd0b722b7d6129b148c03a7505c | [
"Apache-2.0"
] | 1 | 2021-07-30T19:06:07.000Z | 2021-07-30T19:06:07.000Z | waferscreen/plot/band_and_keepout.py | chw3k5/WaferScreen | c0ca7fe939fe7cd0b722b7d6129b148c03a7505c | [
"Apache-2.0"
] | 8 | 2021-04-22T20:47:48.000Z | 2021-07-30T19:06:01.000Z | waferscreen/plot/band_and_keepout.py | chw3k5/WaferScreen | c0ca7fe939fe7cd0b722b7d6129b148c03a7505c | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2021 Members of the Simons Observatory collaboration.
# Please refer to the LICENSE file in the root of this repository.
import matplotlib.pyplot as plt
import matplotlib.transforms as mtransforms
from ref import band_params, smurf_keepout_zones_ghz
colors = ['BlueViolet', 'Brown', 'CadetBlue', 'Cora... | 44.387097 | 98 | 0.623547 |
import matplotlib.pyplot as plt
import matplotlib.transforms as mtransforms
from ref import band_params, smurf_keepout_zones_ghz
colors = ['BlueViolet', 'Brown', 'CadetBlue', 'Coral', 'Crimson',
'DarkGoldenRod', 'DarkGreen', 'DarkMagenta', 'DarkOrange',
'DarkOrchid', 'DarkRed', 'DarkSalmon', 'Dod... | true | true |
f7759b90d40a9395e803ee707e67cf32e1d8bec6 | 579 | py | Python | server/onesphere/onesphere_assembly_industry/models/product.py | kevin0120/onesphere | 7864076ab0de564fa21f91c946f3f1038aa36faf | [
"MIT"
] | 2 | 2022-01-19T06:36:55.000Z | 2022-01-26T05:53:20.000Z | server/onesphere/onesphere_assembly_industry/models/product.py | kevin0120/onesphere | 7864076ab0de564fa21f91c946f3f1038aa36faf | [
"MIT"
] | 2 | 2022-01-04T07:04:05.000Z | 2022-01-06T05:08:57.000Z | server/onesphere/onesphere_assembly_industry/models/product.py | kevin0120/onesphere | 7864076ab0de564fa21f91c946f3f1038aa36faf | [
"MIT"
] | 2 | 2021-12-25T07:18:22.000Z | 2022-02-22T01:35:44.000Z | # -*- coding: utf-8 -*-
from odoo import api, exceptions, fields, models, _
from odoo.exceptions import UserError
from uuid import uuid4
class ProductTemplate(models.Model):
_inherit = 'product.template'
onesphere_product_type = fields.Selection([('screw', 'Screw'), ('bolt', 'Bolt'), ('vehicle', 'Ve... | 32.166667 | 110 | 0.651123 | from odoo import api, exceptions, fields, models, _
from odoo.exceptions import UserError
from uuid import uuid4
class ProductTemplate(models.Model):
_inherit = 'product.template'
onesphere_product_type = fields.Selection([('screw', 'Screw'), ('bolt', 'Bolt'), ('vehicle', 'Vehicle')],
... | true | true |
f7759bfa75eedcb0b69367149ad39ca26d1e1ab9 | 2,879 | py | Python | py12306/helpers/qrcode.py | Heliner/ticket_12306 | 28a97129dbc93eed2dd9e7922f8059ca63f123d6 | [
"Apache-2.0"
] | 4 | 2021-12-29T15:38:26.000Z | 2022-01-07T09:19:02.000Z | py12306/helpers/qrcode.py | Heliner/py12306 | 28a97129dbc93eed2dd9e7922f8059ca63f123d6 | [
"Apache-2.0"
] | null | null | null | py12306/helpers/qrcode.py | Heliner/py12306 | 28a97129dbc93eed2dd9e7922f8059ca63f123d6 | [
"Apache-2.0"
] | 1 | 2022-01-12T02:16:32.000Z | 2022-01-12T02:16:32.000Z | # -*- coding: utf-8 -*-
import png
def print_qrcode(path):
"""
将二维码输出到控制台
需要终端尺寸足够大才能显示
:param path: 二维码图片路径 (PNG 格式)
:return: None
"""
reader = png.Reader(path)
width, height, rows, info = reader.read()
lines = list(rows)
planes = info['planes'] # 通道数
threshold = (2 **... | 26.906542 | 59 | 0.469955 |
import png
def print_qrcode(path):
reader = png.Reader(path)
width, height, rows, info = reader.read()
lines = list(rows)
planes = info['planes'] threshold = (2 ** info['bitdepth']) / 2
x_flag = -1 y_flag = -1 x_white = -1 y_white = -1
i = y_flag
while i < hei... | true | true |
f7759caf306a2c9144fbdd64fd483125af47262e | 983 | py | Python | gamepicker/budget.py | rouleau/gamepicker | 581334bf6d340010af5cefb227a854d5275a2f39 | [
"MIT"
] | null | null | null | gamepicker/budget.py | rouleau/gamepicker | 581334bf6d340010af5cefb227a854d5275a2f39 | [
"MIT"
] | null | null | null | gamepicker/budget.py | rouleau/gamepicker | 581334bf6d340010af5cefb227a854d5275a2f39 | [
"MIT"
] | null | null | null | """ Budget module """
class Budget:
""" Create a budget for placing bets """
def __init__(self, balance: float = 0.00, period: str = "Day") -> None:
"""
Initialize the budget object
>>> budget = Budget()
>>> budget
<__main__.Budget object at 0x...>
>>> budget.... | 20.061224 | 75 | 0.535097 |
class Budget:
def __init__(self, balance: float = 0.00, period: str = "Day") -> None:
self.balance = balance
self.period = period
def add_funds(self, amount: float) -> None:
self.balance = self.balance + amount
def test():
import doctest
flags = doctest.ELLIPSIS | doctest... | true | true |
f7759d3f8e78f17a066ee42f59c8e7042c602b62 | 2,008 | py | Python | leetcode/417.py | zi-NaN/algorithm_exercise | 817916a62774145fe6387b715f76c5badbf99197 | [
"MIT"
] | null | null | null | leetcode/417.py | zi-NaN/algorithm_exercise | 817916a62774145fe6387b715f76c5badbf99197 | [
"MIT"
] | null | null | null | leetcode/417.py | zi-NaN/algorithm_exercise | 817916a62774145fe6387b715f76c5badbf99197 | [
"MIT"
] | 1 | 2018-11-21T05:14:07.000Z | 2018-11-21T05:14:07.000Z | class Solution:
def pacificAtlantic(self, matrix):
"""
:type matrix: List[List[int]]
:rtype: List[List[int]]
"""
if len(matrix) == 0 or len(matrix[0]) == 0:
return []
# pacific
canaccess = [[0 for i in range(len(matrix[0]))] for ... | 34.62069 | 142 | 0.422809 | class Solution:
def pacificAtlantic(self, matrix):
if len(matrix) == 0 or len(matrix[0]) == 0:
return []
canaccess = [[0 for i in range(len(matrix[0]))] for j in range(len(matrix))]
for i in range(len(matrix)):
canaccess[i][0] = 1
for ... | true | true |
f7759dedf41f42cf48a538f3358e2eab0c195997 | 373 | py | Python | pirev/pirev.py | samjrdn/pirev-python | 2f763dca582c4af3849fb3241a045e04fd56e396 | [
"MIT"
] | null | null | null | pirev/pirev.py | samjrdn/pirev-python | 2f763dca582c4af3849fb3241a045e04fd56e396 | [
"MIT"
] | 3 | 2019-12-01T18:05:03.000Z | 2020-03-13T04:00:28.000Z | pirev/pirev.py | samjrdn/pirev-python | 2f763dca582c4af3849fb3241a045e04fd56e396 | [
"MIT"
] | null | null | null | from .cpuinfo import getCpuInfo
from .revinfo import getRevInfo
def getInfo(filename=None):
cpuInfo = getCpuInfo(filename)
if cpuInfo is not None and 'revision' in cpuInfo:
revInfo = getRevInfo(cpuInfo['revision'])
revInfo['code'] = cpuInfo['revision']
return { **cpuInfo, 'revision': revInfo }
else... | 26.642857 | 51 | 0.715818 | from .cpuinfo import getCpuInfo
from .revinfo import getRevInfo
def getInfo(filename=None):
cpuInfo = getCpuInfo(filename)
if cpuInfo is not None and 'revision' in cpuInfo:
revInfo = getRevInfo(cpuInfo['revision'])
revInfo['code'] = cpuInfo['revision']
return { **cpuInfo, 'revision': revInfo }
else... | true | true |
f7759fb87b3363c29e0fc20b4298b409f4dcd243 | 424 | py | Python | env/Lib/site-packages/plotly/validators/scatter/unselected/textfont/_color.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/Lib/site-packages/plotly/validators/scatter/unselected/textfont/_color.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/Lib/site-packages/plotly/validators/scatter/unselected/textfont/_color.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="scatter.unselected.textfont", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | 30.285714 | 86 | 0.658019 | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="scatter.unselected.textfont", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | true | true |
f775a059be1775812815a28b3fcb9aea15cbf359 | 4,584 | py | Python | gen_config/gen_config_script.py | gnomeosaurus/machinelearning4dc | fe5e4e5aa03d770b62377b0b8f16a8aa538dc7c9 | [
"MIT"
] | 2 | 2018-02-12T10:28:37.000Z | 2018-03-07T16:33:47.000Z | gen_config/gen_config_script.py | gnomeosaurus/machinelearning4dc | fe5e4e5aa03d770b62377b0b8f16a8aa538dc7c9 | [
"MIT"
] | null | null | null | gen_config/gen_config_script.py | gnomeosaurus/machinelearning4dc | fe5e4e5aa03d770b62377b0b8f16a8aa538dc7c9 | [
"MIT"
] | 5 | 2018-02-06T16:05:50.000Z | 2020-05-28T14:10:47.000Z | Q_all = 'L1tmu:GOOD,Hlt:GOOD,Lumi:GOOD,All:GOOD'
Q_1 = ',Pix:GOOD,Strip:GOOD,Track:GOOD'
Q_2 = ',Ecal:GOOD,Es:GOOD,Egamma:GOOD'
Q_3 = ',Hcal:GOOD,Jetmet:GOOD'
Q_4 = ',Dt:GOOD,Rpc:GOOD,Csc:GOOD,Muon:GOOD'
Q_not_mu = ',L1tcalo:GOOD' #Virginia's feedback:All except: BTagCSV, MET, Tau, BTagMu, Charmonium, DoubleM... | 53.929412 | 157 | 0.380017 | Q_all = 'L1tmu:GOOD,Hlt:GOOD,Lumi:GOOD,All:GOOD'
Q_1 = ',Pix:GOOD,Strip:GOOD,Track:GOOD'
Q_2 = ',Ecal:GOOD,Es:GOOD,Egamma:GOOD'
Q_3 = ',Hcal:GOOD,Jetmet:GOOD'
Q_4 = ',Dt:GOOD,Rpc:GOOD,Csc:GOOD,Muon:GOOD'
Q_not_mu = ',L1tcalo:GOOD'
d_1 = 'Bpix,Fpix,Tibtid,TecM,TecP,Tob'
d_2 = ',Ebm,Ebp,EeM,EeP,EsM,EsP'
ph... | true | true |
f775a0a9904e519680ee1a0d2d285ce772977a7a | 4,418 | py | Python | Compradc.py | alissonn17/compraVenda | 34949629cbb53976049716fb53a995c8cf21a8bd | [
"MIT"
] | null | null | null | Compradc.py | alissonn17/compraVenda | 34949629cbb53976049716fb53a995c8cf21a8bd | [
"MIT"
] | null | null | null | Compradc.py | alissonn17/compraVenda | 34949629cbb53976049716fb53a995c8cf21a8bd | [
"MIT"
] | null | null | null | print("Os planos são: 100mb, 200mb, 250mb, 500mb, 1gb, 2gb, 5gb")
credito = 0
vez = [0,0,0,0,0,0,0]
mais = "sim"
saldo = int(input("digite a quantidade de dinheiro que você irá gastar "))
while mais == "sim":
quero = input("Qual plano vc quer ativar? 1, 2, 3, 4, 5, 6, 7\n")
if quero == "1":
prin... | 28.140127 | 81 | 0.571752 | print("Os planos são: 100mb, 200mb, 250mb, 500mb, 1gb, 2gb, 5gb")
credito = 0
vez = [0,0,0,0,0,0,0]
mais = "sim"
saldo = int(input("digite a quantidade de dinheiro que você irá gastar "))
while mais == "sim":
quero = input("Qual plano vc quer ativar? 1, 2, 3, 4, 5, 6, 7\n")
if quero == "1":
prin... | true | true |
f775a0d37a28205f2766998abba00cbab6fa6977 | 4,184 | py | Python | model.py | wubin1836/MusciModel | 246eb688022fce15647b6613c74e56a938e1cae8 | [
"MIT"
] | null | null | null | model.py | wubin1836/MusciModel | 246eb688022fce15647b6613c74e56a938e1cae8 | [
"MIT"
] | null | null | null | model.py | wubin1836/MusciModel | 246eb688022fce15647b6613c74e56a938e1cae8 | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow.python.ops import rnn_cell
from tensorflow.python.ops import seq2seq
import numpy as np
class Model():
def __init__(self, args, infer=False):
self.args = args
if infer:
args.batch_size = 1
args.seq_length = 1
if args.model ==... | 39.471698 | 107 | 0.579589 | import tensorflow as tf
from tensorflow.python.ops import rnn_cell
from tensorflow.python.ops import seq2seq
import numpy as np
class Model():
def __init__(self, args, infer=False):
self.args = args
if infer:
args.batch_size = 1
args.seq_length = 1
if args.model ==... | false | true |
f775a12f9c141328d21998cf6c7207ee49b8c6fd | 1,288 | py | Python | databricks_notebooks/git/Import_Run.py | mirhendi/mlflow-export-import | 5be6217eda6a9178793cbc5ebe877b5dddc9a73e | [
"Apache-2.0"
] | null | null | null | databricks_notebooks/git/Import_Run.py | mirhendi/mlflow-export-import | 5be6217eda6a9178793cbc5ebe877b5dddc9a73e | [
"Apache-2.0"
] | null | null | null | databricks_notebooks/git/Import_Run.py | mirhendi/mlflow-export-import | 5be6217eda6a9178793cbc5ebe877b5dddc9a73e | [
"Apache-2.0"
] | null | null | null | # Databricks notebook source
# MAGIC %md ## Import Run
# MAGIC
# MAGIC Import run from folder that was created by [Export_Run]($Export_Run) notebook.
# MAGIC
# MAGIC #### Widgets
# MAGIC * Destination experiment name - Import run into this experiment. Will create if it doesn't exist.
# MAGIC * Input folder - Input di... | 24.769231 | 105 | 0.697205 | # MAGIC * Input folder - Input directory containing an exported run.
# MAGIC
# MAGIC #### Setup
# MAGIC * See Setup in [README]($00_README_Export_Import).
# COMMAND ----------
# MAGIC %md ### Setup
# COMMAND ----------
dbutils.widgets.text("Destination experiment name", "")
experiment_name = dbutils.widgets.get("... | true | true |
f775a1643491e6d135b21a5abded35dd06cae656 | 4,698 | py | Python | repo-utils/render.py | ebolyen/galaxy-tools | 01acfdf67d55bf238ebec789541b82b6922e7bc0 | [
"BSD-3-Clause"
] | 1 | 2022-03-11T12:02:57.000Z | 2022-03-11T12:02:57.000Z | repo-utils/render.py | ebolyen/galaxy-tools | 01acfdf67d55bf238ebec789541b82b6922e7bc0 | [
"BSD-3-Clause"
] | 8 | 2022-03-09T20:15:58.000Z | 2022-03-10T16:23:55.000Z | repo-utils/render.py | ebolyen/galaxy-tools | 01acfdf67d55bf238ebec789541b82b6922e7bc0 | [
"BSD-3-Clause"
] | 1 | 2022-03-09T19:51:35.000Z | 2022-03-09T19:51:35.000Z | #!/usr/bin/env python
import os
import sys
import json
import yaml
import conda.cli.python_api as conda_api
TMP_CONDA_PREFIX = '_conda/'
# SO: https://stackoverflow.com/a/39681672
class Dumper(yaml.Dumper):
def increase_indent(self, flow=False, *args, **kwargs):
return super().increase_indent(flow=flow... | 32.4 | 78 | 0.651341 |
import os
import sys
import json
import yaml
import conda.cli.python_api as conda_api
TMP_CONDA_PREFIX = '_conda/'
class Dumper(yaml.Dumper):
def increase_indent(self, flow=False, *args, **kwargs):
return super().increase_indent(flow=flow, indentless=False)
def check_and_add_plugin_cache(id_, version... | true | true |
f775a165551859c64fee127d48e664fe66d68c87 | 5,817 | py | Python | tf_agents/networks/network.py | andreas-eberle/agents | c355882d35273b889b84f90071d91ee6354d27d3 | [
"Apache-2.0"
] | 3 | 2019-10-02T13:55:14.000Z | 2021-05-06T23:08:45.000Z | tf_agents/networks/network.py | nealwu/agents | 27b9498689ea5b8f69fc77ada752e05e38192852 | [
"Apache-2.0"
] | null | null | null | tf_agents/networks/network.py | nealwu/agents | 27b9498689ea5b8f69fc77ada752e05e38192852 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The TF-Agents Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 34.625 | 82 | 0.713942 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import abc
import sys
import six
import tensorflow as tf
from tensorflow.keras import layers from tf_agents.specs import tensor_spec
from tf_agents.trajectories import time_step
from tensorflow.python.kera... | true | true |
f775a2163e967a3f3172f30f3da2bc561cf439a4 | 1,570 | py | Python | gearbox_py/core/environments.py | sColin16/gearbox_py | e9c8fb8a07c9342f15e0d0df0a746b6fb3de8dfc | [
"MIT"
] | null | null | null | gearbox_py/core/environments.py | sColin16/gearbox_py | e9c8fb8a07c9342f15e0d0df0a746b6fb3de8dfc | [
"MIT"
] | null | null | null | gearbox_py/core/environments.py | sColin16/gearbox_py | e9c8fb8a07c9342f15e0d0df0a746b6fb3de8dfc | [
"MIT"
] | null | null | null | """Defines the core data classes and types for Gearbox environments."""
from dataclasses import dataclass
from typing import Any, Callable, Iterable, Union
@dataclass
class Action:
"""Base class that all actions are suggested to extend."""
@dataclass
class State:
"""Base class that all states are suggested... | 23.432836 | 75 | 0.671975 |
from dataclasses import dataclass
from typing import Any, Callable, Iterable, Union
@dataclass
class Action:
@dataclass
class State:
@dataclass
class Outcome:
state: State
reward: Union[int, Iterable[int]]
done: bool
info: Any
Engine = Callable[[State, Action], Outcome]
class InvalidActionEx... | true | true |
f775a218d164cc07dcab6a8e60971377c3d938f6 | 11,405 | py | Python | src/marshmallow_sqlalchemy/convert.py | petrus-v/marshmallow-sqlalchemy | 7119d9565d3b49803046c54665e2c3a65b6cf634 | [
"MIT"
] | null | null | null | src/marshmallow_sqlalchemy/convert.py | petrus-v/marshmallow-sqlalchemy | 7119d9565d3b49803046c54665e2c3a65b6cf634 | [
"MIT"
] | null | null | null | src/marshmallow_sqlalchemy/convert.py | petrus-v/marshmallow-sqlalchemy | 7119d9565d3b49803046c54665e2c3a65b6cf634 | [
"MIT"
] | null | null | null | import inspect
import functools
import uuid
import marshmallow as ma
from marshmallow import validate, fields
from sqlalchemy.dialects import postgresql, mysql, mssql
import sqlalchemy as sa
from .exceptions import ModelConversionError
from .fields import Related, RelatedList
def _is_field(value):
return isinst... | 36.206349 | 89 | 0.636212 | import inspect
import functools
import uuid
import marshmallow as ma
from marshmallow import validate, fields
from sqlalchemy.dialects import postgresql, mysql, mssql
import sqlalchemy as sa
from .exceptions import ModelConversionError
from .fields import Related, RelatedList
def _is_field(value):
return isinst... | true | true |
f775a2d39a56940f4f5535d0199974f27f529821 | 858 | py | Python | test_package/conanfile.py | systelab/cpp-jwt-utils | 324b6756c63890d39bf2973aa7038f99c0ea219f | [
"MIT"
] | 2 | 2020-02-26T12:45:58.000Z | 2020-06-29T17:40:54.000Z | test_package/conanfile.py | systelab/cpp-jwt-utils | 324b6756c63890d39bf2973aa7038f99c0ea219f | [
"MIT"
] | 1 | 2019-03-06T15:30:39.000Z | 2019-03-06T15:30:39.000Z | test_package/conanfile.py | systelab/cpp-jwt-utils | 324b6756c63890d39bf2973aa7038f99c0ea219f | [
"MIT"
] | 2 | 2019-02-26T20:29:43.000Z | 2020-02-26T12:45:59.000Z | from conans import ConanFile, CMake
class JWTUtilsTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake_find_package"
options = {"gtest": ["1.7.0", "1.8.1", "1.10.0"], "openssl": ["1.0.2n", "1.0.2s", "1.1.1g", "1.1.1k"]}
default_options = {"gtest":"1.10.0", "opens... | 31.777778 | 106 | 0.573427 | from conans import ConanFile, CMake
class JWTUtilsTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake_find_package"
options = {"gtest": ["1.7.0", "1.8.1", "1.10.0"], "openssl": ["1.0.2n", "1.0.2s", "1.1.1g", "1.1.1k"]}
default_options = {"gtest":"1.10.0", "opens... | true | true |
f775a3afa2e97e8308527c6e22cdff8aaae1769f | 1,031 | py | Python | tests/test_other.py | kyleconroy/validictory | 9d5cced1d2b59eb40754e52716be8d89f026427e | [
"MIT"
] | 1 | 2015-11-05T06:49:23.000Z | 2015-11-05T06:49:23.000Z | tests/test_other.py | kyleconroy/validictory | 9d5cced1d2b59eb40754e52716be8d89f026427e | [
"MIT"
] | null | null | null | tests/test_other.py | kyleconroy/validictory | 9d5cced1d2b59eb40754e52716be8d89f026427e | [
"MIT"
] | null | null | null | from unittest import TestCase
import validictory
class TestSchemaErrors(TestCase):
valid_desc = { "description": "My Description for My Schema" }
invalid_desc = { "description": 1233 }
valid_title = { "title":"My Title for My Schema" }
invalid_title = { "title": 1233 }
# doesn't matter what this ... | 31.242424 | 70 | 0.630456 | from unittest import TestCase
import validictory
class TestSchemaErrors(TestCase):
valid_desc = { "description": "My Description for My Schema" }
invalid_desc = { "description": 1233 }
valid_title = { "title":"My Title for My Schema" }
invalid_title = { "title": 1233 }
data = "whatever"
... | false | true |
f775a40695ffbc5491b99beacd49a004f8c5522d | 8,895 | py | Python | mmdet/datasets/custom.py | ryohachiuma/DFU-challenge | 08401bfde9bcb1abcb32ef060e89b8c135e7f3f1 | [
"Apache-2.0"
] | null | null | null | mmdet/datasets/custom.py | ryohachiuma/DFU-challenge | 08401bfde9bcb1abcb32ef060e89b8c135e7f3f1 | [
"Apache-2.0"
] | null | null | null | mmdet/datasets/custom.py | ryohachiuma/DFU-challenge | 08401bfde9bcb1abcb32ef060e89b8c135e7f3f1 | [
"Apache-2.0"
] | null | null | null | import os.path as osp
import mmcv
import numpy as np
from torch.utils.data import Dataset
from mmdet.core import eval_map, eval_recalls
from .builder import DATASETS
from .pipelines import Compose
@DATASETS.register_module()
class CustomDataset(Dataset):
"""Custom dataset for detection.
The annotation form... | 35.297619 | 79 | 0.565936 | import os.path as osp
import mmcv
import numpy as np
from torch.utils.data import Dataset
from mmdet.core import eval_map, eval_recalls
from .builder import DATASETS
from .pipelines import Compose
@DATASETS.register_module()
class CustomDataset(Dataset):
CLASSES = None
def __init__(self,
... | true | true |
f775a52fb70b6c3cc5ea8e37579363f255277048 | 2,636 | py | Python | deepchem/molnet/load_function/clearance_datasets.py | Chasearmer/deepchem | eaedd4d79c69d42b840d416f7420634f558c4949 | [
"MIT"
] | 2 | 2021-04-01T01:17:53.000Z | 2021-10-04T16:46:13.000Z | deepchem/molnet/load_function/clearance_datasets.py | Chasearmer/deepchem | eaedd4d79c69d42b840d416f7420634f558c4949 | [
"MIT"
] | null | null | null | deepchem/molnet/load_function/clearance_datasets.py | Chasearmer/deepchem | eaedd4d79c69d42b840d416f7420634f558c4949 | [
"MIT"
] | 1 | 2021-04-06T20:32:02.000Z | 2021-04-06T20:32:02.000Z | """
clearance dataset loader.
"""
from __future__ import division
from __future__ import unicode_literals
import os
import logging
import deepchem
logger = logging.getLogger(__name__)
def load_clearance(featurizer='ECFP',
split='random',
reload=True,
... | 32.146341 | 87 | 0.673369 | from __future__ import division
from __future__ import unicode_literals
import os
import logging
import deepchem
logger = logging.getLogger(__name__)
def load_clearance(featurizer='ECFP',
split='random',
reload=True,
move_mean=True):
logger.... | true | true |
f775a67ef21b28f26ab3ddf76351bf430de72e2c | 12,756 | py | Python | examples/live_kf.py | vanillagorillaa/rednose | 7e41d39b71f7888875a2fbf9cea770eabe0a8128 | [
"MIT"
] | null | null | null | examples/live_kf.py | vanillagorillaa/rednose | 7e41d39b71f7888875a2fbf9cea770eabe0a8128 | [
"MIT"
] | null | null | null | examples/live_kf.py | vanillagorillaa/rednose | 7e41d39b71f7888875a2fbf9cea770eabe0a8128 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import numpy as np
import sympy as sp
from rednose.helpers import KalmanError
from rednose.helpers.ekf_sym import EKF_sym, gen_code
from rednose.helpers.sympy_helpers import (euler_rotate, quat_matrix_r, quat_rotate)
EARTH_GM = 3.986005e14 # m^3/s^2 (gravitational constant * mass of... | 37.628319 | 159 | 0.631546 | import sys
import numpy as np
import sympy as sp
from rednose.helpers import KalmanError
from rednose.helpers.ekf_sym import EKF_sym, gen_code
from rednose.helpers.sympy_helpers import (euler_rotate, quat_matrix_r, quat_rotate)
EARTH_GM = 3.986005e14
class ObservationKind():
UNKNOWN = 0
NO_OBSERVATION = 1
GP... | true | true |
f775a689c5c2fb73cdc669afec5f5aeb11dbb153 | 22,951 | py | Python | tests/utils/test_utils.py | MShaffar19/osbs-client | da6560e8c07b55dc05d66ab9eefdcc2f5e363526 | [
"BSD-3-Clause"
] | null | null | null | tests/utils/test_utils.py | MShaffar19/osbs-client | da6560e8c07b55dc05d66ab9eefdcc2f5e363526 | [
"BSD-3-Clause"
] | null | null | null | tests/utils/test_utils.py | MShaffar19/osbs-client | da6560e8c07b55dc05d66ab9eefdcc2f5e363526 | [
"BSD-3-Clause"
] | 1 | 2020-09-23T16:19:33.000Z | 2020-09-23T16:19:33.000Z | """
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import absolute_import
from flexmock import flexmock
import os
import os.path
import subprocess
import pytest
import datetime... | 37.501634 | 99 | 0.595573 | from __future__ import absolute_import
from flexmock import flexmock
import os
import os.path
import subprocess
import pytest
import datetime
import re
import sys
import requests
from time import tzset
from pkg_resources import parse_version
from textwrap import dedent
from osbs.constants import REPO_CONTAINER_CONFIG... | true | true |
f775a6aef33e1afd7c4a1e51ff107dbc97c9f472 | 32,006 | py | Python | python/ccxt/async_support/bibox.py | acreux/ccxt | 50e499a41b5ad82401591fe8b5b993103f2c07c9 | [
"MIT"
] | null | null | null | python/ccxt/async_support/bibox.py | acreux/ccxt | 50e499a41b5ad82401591fe8b5b993103f2c07c9 | [
"MIT"
] | null | null | null | python/ccxt/async_support/bibox.py | acreux/ccxt | 50e499a41b5ad82401591fe8b5b993103f2c07c9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
# -----------------------------------------------------------------------------
try... | 38.147795 | 262 | 0.504968 |
from ccxt.async_support.base.exchange import Exchange
try:
basestring except NameError:
basestring = str import hashlib
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import Argumen... | true | true |
f775a6b7caea0b5b500f54e938d9e5baef6e3ee6 | 7,681 | py | Python | ua_generic_rest_api/ua_generic_rest_api.py | UACoreFacilitiesIT/UA-Generic-Rest-Api | e541a4e60f3c6bb41299fba75875aef8760741e3 | [
"MIT"
] | 1 | 2020-07-14T16:27:17.000Z | 2020-07-14T16:27:17.000Z | ua_generic_rest_api/ua_generic_rest_api.py | UACoreFacilitiesIT/UA-Generic-Rest-Api | e541a4e60f3c6bb41299fba75875aef8760741e3 | [
"MIT"
] | null | null | null | ua_generic_rest_api/ua_generic_rest_api.py | UACoreFacilitiesIT/UA-Generic-Rest-Api | e541a4e60f3c6bb41299fba75875aef8760741e3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""An abstract class that holds get, put, post, delete for any REST api."""
import requests
import concurrent.futures
import asyncio
import abc
class GenericRestApi(abc.ABC):
"""The object that holds the stache environment variables."""
@abc.abstractmethod
def __init__(self, host, he... | 33.541485 | 79 | 0.604609 | import requests
import concurrent.futures
import asyncio
import abc
class GenericRestApi(abc.ABC):
@abc.abstractmethod
def __init__(self, host, header_info, page_query):
self.host = host
self.header_info = header_info
self.page_query = page_query
self.session = self._setup_sess... | true | true |
f775a6dc3dad091a9337db4b98d875cc49c56ab1 | 4,854 | py | Python | venv/Lib/site-packages/tests/test_200_MultipleRsltsetsUniformColDefs.py | shehzadulislam/Assignment4 | a9cced70be6ae5d2685027d68032d5849f638301 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/tests/test_200_MultipleRsltsetsUniformColDefs.py | shehzadulislam/Assignment4 | a9cced70be6ae5d2685027d68032d5849f638301 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/tests/test_200_MultipleRsltsetsUniformColDefs.py | shehzadulislam/Assignment4 | a9cced70be6ae5d2685027d68032d5849f638301 | [
"Apache-2.0"
] | null | null | null | #
# Licensed Materials - Property of IBM
#
# (c) Copyright IBM Corp. 2007-2008
#
import unittest, sys
import ibm_db
import config
from testfunctions import IbmDbTestFunctions
class IbmDbTestCase(unittest.TestCase):
def test_200_MultipleRsltsetsUniformColDefs(self):
obj = IbmDbTestFunctions()
obj.assert_... | 20.225 | 101 | 0.55171 |
import unittest, sys
import ibm_db
import config
from testfunctions import IbmDbTestFunctions
class IbmDbTestCase(unittest.TestCase):
def test_200_MultipleRsltsetsUniformColDefs(self):
obj = IbmDbTestFunctions()
obj.assert_expect(self.run_test_200)
def run_test_200(self):
conn = ibm_db.connect(confi... | true | true |
f775a75dcd33aead7df45a147769aa714d5c74dd | 15,858 | py | Python | main_step0.py | dfm/igrins_rv | 79aa31035bdc576c6c2ff05b6042146afaff49ac | [
"MIT"
] | null | null | null | main_step0.py | dfm/igrins_rv | 79aa31035bdc576c6c2ff05b6042146afaff49ac | [
"MIT"
] | null | null | null | main_step0.py | dfm/igrins_rv | 79aa31035bdc576c6c2ff05b6042146afaff49ac | [
"MIT"
] | null | null | null | from Engine.importmodule import *
# -------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
def DataPrep(args):
# Collects and organizes all relevant information on target observations and associated telluric s... | 54.494845 | 221 | 0.518224 | from Engine.importmodule import *
def DataPrep(args):
master_log = pd.read_csv('./Engine/IGRINS_MASTERLOG.csv')
star_files = master_log[(master_log['OBJNAME'].str.contains(args.targname, regex=True, na=False)) &
(master_log['OBJTYPE'].str.contains('TAR', ... | true | true |
f775a7691edd2132f7b3462ca4377a935b3efcde | 34,816 | py | Python | src/tropycal/recon/dataset.py | ATMOcanes/tropycal | 10cad2e4ff5b9cb1949d315cb328878306a65a74 | [
"MIT"
] | 72 | 2019-10-18T02:23:42.000Z | 2022-02-17T18:51:55.000Z | src/tropycal/recon/dataset.py | ATMOcanes/tropycal | 10cad2e4ff5b9cb1949d315cb328878306a65a74 | [
"MIT"
] | 52 | 2019-10-25T08:28:54.000Z | 2022-03-27T04:53:17.000Z | src/tropycal/recon/dataset.py | ATMOcanes/tropycal | 10cad2e4ff5b9cb1949d315cb328878306a65a74 | [
"MIT"
] | 28 | 2019-10-16T22:24:50.000Z | 2022-02-15T15:05:54.000Z | import os
import numpy as np
from datetime import datetime as dt,timedelta
import pandas as pd
import requests
import pickle
from scipy.interpolate import interp1d
from scipy.ndimage import gaussian_filter as gfilt,gaussian_filter1d as gfilt1d
from scipy.ndimage.filters import minimum_filter
import matplotlib.dates as... | 44.295165 | 158 | 0.563448 | import os
import numpy as np
from datetime import datetime as dt,timedelta
import pandas as pd
import requests
import pickle
from scipy.interpolate import interp1d
from scipy.ndimage import gaussian_filter as gfilt,gaussian_filter1d as gfilt1d
from scipy.ndimage.filters import minimum_filter
import matplotlib.dates as... | true | true |
f775a85a86f216f4302710d59acb6bfc2fb4b637 | 8,528 | py | Python | utils.py | abditag2/DCGAN-tensorflow | 432b0d91bd8252c48869c205b86701993eb37618 | [
"MIT"
] | 4 | 2019-04-30T08:46:13.000Z | 2020-09-08T07:18:23.000Z | utils.py | abditag2/DCGAN-tensorflow | 432b0d91bd8252c48869c205b86701993eb37618 | [
"MIT"
] | null | null | null | utils.py | abditag2/DCGAN-tensorflow | 432b0d91bd8252c48869c205b86701993eb37618 | [
"MIT"
] | 1 | 2019-10-24T12:24:23.000Z | 2019-10-24T12:24:23.000Z | """
Some codes from https://github.com/Newmu/dcgan_code
"""
from __future__ import division
import math
import pprint
import random
from time import gmtime, strftime
import numpy as np
import scipy.misc
import tensorflow as tf
import tensorflow.contrib.slim as slim
from six.moves import xrange
pp = pprint.PrettyPrin... | 34.526316 | 136 | 0.585131 | from __future__ import division
import math
import pprint
import random
from time import gmtime, strftime
import numpy as np
import scipy.misc
import tensorflow as tf
import tensorflow.contrib.slim as slim
from six.moves import xrange
pp = pprint.PrettyPrinter()
get_stddev = lambda x, k_h, k_w: 1/math.sqrt(k_w*k_h*... | true | true |
f775ab71df9bc8907ac85dc6d1173966036401e7 | 284 | py | Python | common_migration/tests/migration_files/new/central/migrations/0006_copy_help.py | Wazoku/django-common-migration | 51bbb4d3a5a5c76fc5dcf569da9eb7751b82c9eb | [
"BSD-2-Clause"
] | 1 | 2021-06-03T13:49:50.000Z | 2021-06-03T13:49:50.000Z | common_migration/tests/migration_files/old/central/migrations/0006_copy_help.py | Wazoku/django-common-migration | 51bbb4d3a5a5c76fc5dcf569da9eb7751b82c9eb | [
"BSD-2-Clause"
] | 1 | 2020-11-20T09:17:47.000Z | 2020-11-20T09:17:47.000Z | common_migration/tests/migration_files/old/central/migrations/0006_copy_help.py | Wazoku/django-common-migration | 51bbb4d3a5a5c76fc5dcf569da9eb7751b82c9eb | [
"BSD-2-Clause"
] | 1 | 2020-11-16T16:09:22.000Z | 2020-11-16T16:09:22.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-03-22 10:48
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('central', '0005_add_separate'),
]
operations = [
]
| 17.75 | 48 | 0.661972 | from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('central', '0005_add_separate'),
]
operations = [
]
| true | true |
f775ac26ee341ba8fb4bdb21b80d4c66811137b1 | 2,107 | py | Python | python/test/sklearn_version_specific_utils.py | scikit-spark/scikit-spark | 1b1291f14ce0c18d7ea358fe25687649a5b74ecd | [
"Apache-2.0"
] | 6 | 2018-07-26T13:53:25.000Z | 2020-10-04T10:06:11.000Z | python/test/sklearn_version_specific_utils.py | scikit-spark/scikit-spark | 1b1291f14ce0c18d7ea358fe25687649a5b74ecd | [
"Apache-2.0"
] | 1 | 2018-11-01T11:57:48.000Z | 2018-11-01T18:20:58.000Z | python/test/sklearn_version_specific_utils.py | scikit-spark/scikit-spark | 1b1291f14ce0c18d7ea358fe25687649a5b74ecd | [
"Apache-2.0"
] | 1 | 2018-06-16T08:54:38.000Z | 2018-06-16T08:54:38.000Z | import sklearn
def sklearn_version_is(version):
if sklearn.__version__.startswith(version):
return True
return False
def sklearn_is_at_least(version):
if sklearn.__version__ >= version:
return True
return False
def get_refactored_tests_to_skip():
"""These tests have been edited... | 43 | 106 | 0.696251 | import sklearn
def sklearn_version_is(version):
if sklearn.__version__.startswith(version):
return True
return False
def sklearn_is_at_least(version):
if sklearn.__version__ >= version:
return True
return False
def get_refactored_tests_to_skip():
if sklearn_version_is("0.19"):
... | true | true |
f775ad5945be07ec644f9144311a0abb41e5e228 | 9,906 | py | Python | selfdrive/thermald/power_monitoring.py | JoeOIVOV/ArnePilot | 82c71c6f5af1ba504b748940f22cc0ac98692662 | [
"MIT"
] | 116 | 2018-03-07T09:00:10.000Z | 2020-04-06T18:37:45.000Z | selfdrive/thermald/power_monitoring.py | JoeOIVOV/ArnePilot | 82c71c6f5af1ba504b748940f22cc0ac98692662 | [
"MIT"
] | 66 | 2020-04-09T20:27:57.000Z | 2022-01-27T14:39:24.000Z | selfdrive/thermald/power_monitoring.py | JoeOIVOV/ArnePilot | 82c71c6f5af1ba504b748940f22cc0ac98692662 | [
"MIT"
] | 154 | 2020-04-08T21:41:22.000Z | 2022-03-17T21:05:33.000Z | import random
import threading
import time
from statistics import mean
from cereal import log
from common.realtime import sec_since_boot
from common.params import Params, put_nonblocking
from common.hardware import TICI
from selfdrive.swaglog import cloudlog
PANDA_OUTPUT_VOLTAGE = 5.28
CAR_VOLTAGE_LOW_PASS_K = 0.091 ... | 41.797468 | 149 | 0.696043 | import random
import threading
import time
from statistics import mean
from cereal import log
from common.realtime import sec_since_boot
from common.params import Params, put_nonblocking
from common.hardware import TICI
from selfdrive.swaglog import cloudlog
PANDA_OUTPUT_VOLTAGE = 5.28
CAR_VOLTAGE_LOW_PASS_K = 0.091 ... | true | true |
f775adea0ea2febca9b9ece0bb609750ec185478 | 249 | py | Python | kattis/trik.py | anouard24/problem-solving | 8f3e3551bf9080f8e7305a09519fe7c638c42021 | [
"MIT"
] | null | null | null | kattis/trik.py | anouard24/problem-solving | 8f3e3551bf9080f8e7305a09519fe7c638c42021 | [
"MIT"
] | null | null | null | kattis/trik.py | anouard24/problem-solving | 8f3e3551bf9080f8e7305a09519fe7c638c42021 | [
"MIT"
] | null | null | null | cups = [1, 0, 0]
s = str(input())
for c in s:
if c == "A":
cups[0], cups[1] = cups[1], cups[0]
elif c == "B":
cups[2], cups[1] = cups[1], cups[2]
else:
cups[0], cups[2] = cups[2], cups[0]
print(cups.index(1) + 1)
| 22.636364 | 43 | 0.453815 | cups = [1, 0, 0]
s = str(input())
for c in s:
if c == "A":
cups[0], cups[1] = cups[1], cups[0]
elif c == "B":
cups[2], cups[1] = cups[1], cups[2]
else:
cups[0], cups[2] = cups[2], cups[0]
print(cups.index(1) + 1)
| true | true |
f775ae79abb0b980e7dac0377ab8abbcf7f41071 | 238 | py | Python | Evento/api/viewsets.py | higornobrega/Calendario_Feriado | bc6811f3159e0a88239a88f356b20bfa4bd6d4f8 | [
"Apache-2.0"
] | null | null | null | Evento/api/viewsets.py | higornobrega/Calendario_Feriado | bc6811f3159e0a88239a88f356b20bfa4bd6d4f8 | [
"Apache-2.0"
] | null | null | null | Evento/api/viewsets.py | higornobrega/Calendario_Feriado | bc6811f3159e0a88239a88f356b20bfa4bd6d4f8 | [
"Apache-2.0"
] | null | null | null | from rest_framework import viewsets
from Evento import models
from Evento.api import serializers
class EventoViewsets(viewsets.ModelViewSet):
serializer_class = serializers.EventoSerializer
queryset = models.Evento.objects.all()
| 29.75 | 51 | 0.823529 | from rest_framework import viewsets
from Evento import models
from Evento.api import serializers
class EventoViewsets(viewsets.ModelViewSet):
serializer_class = serializers.EventoSerializer
queryset = models.Evento.objects.all()
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.