hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
790de44435a03662547382c8bd4e98cc8e5b9c87 | 118 | py | Python | backEnd/app/api/auth/exceptions.py | HenryYDJ/flaskAPI | 9947fbad1050d6ba29c29e365c561689ea3e22d8 | [
"MIT"
] | null | null | null | backEnd/app/api/auth/exceptions.py | HenryYDJ/flaskAPI | 9947fbad1050d6ba29c29e365c561689ea3e22d8 | [
"MIT"
] | 14 | 2022-03-27T13:34:58.000Z | 2022-03-31T14:37:19.000Z | backEnd/app/api/auth/exceptions.py | HenryYDJ/flaskAPI | 9947fbad1050d6ba29c29e365c561689ea3e22d8 | [
"MIT"
] | null | null | null | class TokenNotFound(Exception):
"""
Indicates that a token could not be found in the database
"""
pass | 23.6 | 61 | 0.661017 | class TokenNotFound(Exception):
pass | true | true |
790de4fd9222d64d2d19db56fda267ac1bb55257 | 2,678 | py | Python | tests/test_base.py | simba999/dawdle | c858b6ecffefa1e4415fa79c368149c6f31176fa | [
"MIT"
] | null | null | null | tests/test_base.py | simba999/dawdle | c858b6ecffefa1e4415fa79c368149c6f31176fa | [
"MIT"
] | null | null | null | tests/test_base.py | simba999/dawdle | c858b6ecffefa1e4415fa79c368149c6f31176fa | [
"MIT"
] | null | null | null | from bson.objectid import ObjectId
from faker import Faker
from flask import url_for
from dawdle import create_app
from dawdle.models.board import Board, BoardType
from dawdle.models.user import User
class TestBase:
@classmethod
def setup_class(cls):
cls.fake = Faker()
cls.app = create_app(... | 29.428571 | 76 | 0.612024 | from bson.objectid import ObjectId
from faker import Faker
from flask import url_for
from dawdle import create_app
from dawdle.models.board import Board, BoardType
from dawdle.models.user import User
class TestBase:
@classmethod
def setup_class(cls):
cls.fake = Faker()
cls.app = create_app(... | true | true |
790de63139a64e545b16f27828fa93eba0d5ea70 | 15,589 | py | Python | src/wordle_cheater/interface.py | edsq/wordle-cheater | 216929bbc89da23693d434acbea7e0b89cbf698c | [
"MIT"
] | null | null | null | src/wordle_cheater/interface.py | edsq/wordle-cheater | 216929bbc89da23693d434acbea7e0b89cbf698c | [
"MIT"
] | 6 | 2022-03-12T01:01:38.000Z | 2022-03-27T01:34:40.000Z | src/wordle_cheater/interface.py | edsq/wordle-cheater | 216929bbc89da23693d434acbea7e0b89cbf698c | [
"MIT"
] | null | null | null | """Interfaces for interactively entering guesses."""
import curses
import time
import click
from wordle_cheater.interface_base import WordleCheaterUI
class CursesInterface(WordleCheaterUI):
"""Interface for using the curses library to enter guesses and display solutions.
Attributes
----------
guess... | 30.447266 | 87 | 0.545641 | import curses
import time
import click
from wordle_cheater.interface_base import WordleCheaterUI
class CursesInterface(WordleCheaterUI):
@classmethod
def init_and_run(cls, *args, **kwargs):
ui = cls(*args, **kwargs)
curses.wrapper(ui.main)
return ui
def main(self, stdscr):
... | true | true |
790de63c43567ce6ab59197e8f261a90fee5e92c | 4,359 | py | Python | src/dataset_creator.py | WZX1998/facial-recognition | 458b42e24aadda0df449c8a3170c2d3d0d01e5d8 | [
"MIT"
] | 95 | 2018-10-15T15:47:00.000Z | 2021-11-16T05:29:45.000Z | src/dataset_creator.py | niloyniil/facial_emotion_recognition__EMOJIFIER | 3284445abde438c0ae77807eeaf53bb5d1e06308 | [
"MIT"
] | 10 | 2019-12-16T21:52:26.000Z | 2022-02-10T01:35:51.000Z | src/dataset_creator.py | niloyniil/facial_emotion_recognition__EMOJIFIER | 3284445abde438c0ae77807eeaf53bb5d1e06308 | [
"MIT"
] | 33 | 2018-10-16T06:45:23.000Z | 2022-02-19T09:04:58.000Z | import logging
import pickle
import os
import sys
import json
import cv2
import numpy as np
import glob
import tqdm
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir))
import src
from src.__init__ import *
def image_reader(image_path_list):
image = cv2.imread(image_path_list[0], 0)
image... | 29.653061 | 95 | 0.628585 | import logging
import pickle
import os
import sys
import json
import cv2
import numpy as np
import glob
import tqdm
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir))
import src
from src.__init__ import *
def image_reader(image_path_list):
image = cv2.imread(image_path_list[0], 0)
image... | true | true |
790de642b09bcd930cbaa741c4bda368a30467f8 | 10,160 | py | Python | Autocoders/Python/src/fprime_ac/parsers/XmlSerializeParser.py | WaterBubbles/fprime | dfb1e72bfbe4f21c0014bf78d762fddb3b5c39a1 | [
"Apache-2.0"
] | 2 | 2021-02-23T06:56:03.000Z | 2021-02-23T07:03:53.000Z | Autocoders/Python/src/fprime_ac/parsers/XmlSerializeParser.py | WaterBubbles/fprime | dfb1e72bfbe4f21c0014bf78d762fddb3b5c39a1 | [
"Apache-2.0"
] | 9 | 2021-02-21T07:27:44.000Z | 2021-02-21T07:27:58.000Z | Autocoders/Python/src/fprime_ac/parsers/XmlSerializeParser.py | WaterBubbles/fprime | dfb1e72bfbe4f21c0014bf78d762fddb3b5c39a1 | [
"Apache-2.0"
] | 1 | 2021-02-23T17:10:44.000Z | 2021-02-23T17:10:44.000Z | #!/usr/bin/env python3
# ===============================================================================
# NAME: XmlSerializeParser.py
#
# DESCRIPTION: This class parses the XML serializable types files.
#
# USAGE:
#
# AUTHOR: reder
# EMAIL: reder@jpl.nasa.gov
# DATE CREATED : June 4, 2013
#
# Copyright 2013, Califo... | 34.324324 | 103 | 0.500197 |
import hashlib
import logging
import os
import sys
from lxml import etree
from fprime_ac.utils import ConfigManager
from fprime_ac.utils.buildroot import (
BuildRootCollisionException,
BuildRootMissingException,
locate_build_root,
)
from fprime_ac.utils.exceptions import FprimeXmlExcepti... | true | true |
790de64f669e9144b97ada11646d47281ef20116 | 7,916 | py | Python | main.py | RomeroBarata/upt | 6f953e7a61c31cf608aef9a77b0af3ae8e1f6594 | [
"BSD-3-Clause"
] | 75 | 2021-12-05T23:56:11.000Z | 2022-03-31T16:02:33.000Z | main.py | RomeroBarata/upt | 6f953e7a61c31cf608aef9a77b0af3ae8e1f6594 | [
"BSD-3-Clause"
] | 8 | 2021-12-10T07:56:25.000Z | 2022-03-25T12:16:55.000Z | main.py | RomeroBarata/upt | 6f953e7a61c31cf608aef9a77b0af3ae8e1f6594 | [
"BSD-3-Clause"
] | 16 | 2021-12-07T16:34:19.000Z | 2022-03-28T12:46:27.000Z | """
Utilities for training, testing and caching results
for HICO-DET and V-COCO evaluations.
Fred Zhang <frederic.zhang@anu.edu.au>
The Australian National University
Australian Centre for Robotic Vision
"""
import os
import sys
import torch
import random
import warnings
import argparse
import numpy as np
import tor... | 37.875598 | 102 | 0.676983 |
import os
import sys
import torch
import random
import warnings
import argparse
import numpy as np
import torch.distributed as dist
import torch.multiprocessing as mp
from torch.utils.data import DataLoader, DistributedSampler
from upt import build_detector
from utils import custom_collate, CustomisedDLE, DataFactory... | true | true |
790de8a08741e4d115e76027b4a83092d0197e46 | 149 | py | Python | showcase/post/admin.py | EvanPatrick423/showcase | 779d73740c977ae7e7d7fa130ceea004013fc5e2 | [
"MIT"
] | null | null | null | showcase/post/admin.py | EvanPatrick423/showcase | 779d73740c977ae7e7d7fa130ceea004013fc5e2 | [
"MIT"
] | 6 | 2020-06-12T18:49:43.000Z | 2021-09-22T19:11:03.000Z | showcase/post/admin.py | EvanPatrick423/showcase | 779d73740c977ae7e7d7fa130ceea004013fc5e2 | [
"MIT"
] | 1 | 2020-06-08T18:03:11.000Z | 2020-06-08T18:03:11.000Z | from django.contrib import admin
from .models import Post, Reply
# Register your models here.
admin.site.register(Post)
admin.site.register(Reply)
| 18.625 | 32 | 0.791946 | from django.contrib import admin
from .models import Post, Reply
admin.site.register(Post)
admin.site.register(Reply)
| true | true |
790dea0f54387804d817c82c1733143d3d140ea9 | 220 | py | Python | filter_plugins/env_json_map.py | paulrbr-fl/ansible-clever | b731b96649a95825576060e8821e247b99aa8f2d | [
"MIT"
] | 7 | 2020-10-12T16:25:30.000Z | 2021-02-26T15:47:17.000Z | filter_plugins/env_json_map.py | paulrbr-fl/ansible-clever | b731b96649a95825576060e8821e247b99aa8f2d | [
"MIT"
] | 1 | 2020-10-12T16:00:35.000Z | 2020-10-12T16:00:35.000Z | filter_plugins/env_json_map.py | paulrbr-fl/ansible-clever | b731b96649a95825576060e8821e247b99aa8f2d | [
"MIT"
] | 2 | 2020-12-08T10:17:41.000Z | 2021-06-03T09:32:49.000Z | #!/usr/bin/env python
class FilterModule(object):
def filters(self):
return {'json_env_map': self.json_env_map}
def json_env_map(self, env):
return [{'name': k, 'value': str(v)} for k,v in env.items()]
| 24.444444 | 66 | 0.65 |
class FilterModule(object):
def filters(self):
return {'json_env_map': self.json_env_map}
def json_env_map(self, env):
return [{'name': k, 'value': str(v)} for k,v in env.items()]
| true | true |
790deb812a406c2b661121d481d09392eca52b4d | 27,013 | py | Python | python/ccxt/bigone.py | tssujt/ccxt | 95a8befe3540043bac408b36794342b0a9e724cd | [
"MIT"
] | null | null | null | python/ccxt/bigone.py | tssujt/ccxt | 95a8befe3540043bac408b36794342b0a9e724cd | [
"MIT"
] | null | null | null | python/ccxt/bigone.py | tssujt/ccxt | 95a8befe3540043bac408b36794342b0a9e724cd | [
"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.base.exchange import Exchange
# -----------------------------------------------------------------------------
try:
basestri... | 41.367534 | 126 | 0.424018 |
ge import Exchange
try:
basestring
except NameError:
basestring = str
import math
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import ArgumentsRequired
from ccxt.base.errors import ExchangeNotAvailable
from ccxt.base.erro... | true | true |
790debf3909097b9e0411b0ed00743e6150e0725 | 5,155 | py | Python | code/modbus_server_py3.py | NanoDataCenter/nano_data_center | 76ad521e1a5139a37df80214af1413d2fd4ade60 | [
"MIT"
] | 2 | 2018-02-21T03:46:51.000Z | 2019-12-24T16:40:51.000Z | code/modbus_server_py3.py | NanoDataCenter/nano_data_center | 76ad521e1a5139a37df80214af1413d2fd4ade60 | [
"MIT"
] | 7 | 2020-07-16T19:54:08.000Z | 2022-03-02T03:29:07.000Z | code/modbus_server_py3.py | NanoDataCenter/nano_data_center | 76ad521e1a5139a37df80214af1413d2fd4ade60 | [
"MIT"
] | 2 | 2018-04-16T07:02:35.000Z | 2020-07-23T21:57:19.000Z |
import time
import base64
from datetime import datetime
import sys
import json
from redis_support_py3.graph_query_support_py3 import Query_Support
from redis_support_py3.construct_data_handlers_py3 import Generate_Handlers
from modbus_redis_server_py3.modbus_serial_ctrl_py3 import ModbusSerialCtrl... | 36.560284 | 107 | 0.671581 |
import time
import base64
from datetime import datetime
import sys
import json
from redis_support_py3.graph_query_support_py3 import Query_Support
from redis_support_py3.construct_data_handlers_py3 import Generate_Handlers
from modbus_redis_server_py3.modbus_serial_ctrl_py3 import ModbusSerialCtrl... | true | true |
790dec5c9feeac8dfc94fdd375692906bfd8bb4d | 12,628 | py | Python | nndrone/converters.py | Tevien/NNDrone | 76dce457324ea03a8757d74f6403fbf60132294b | [
"BSD-3-Clause"
] | 3 | 2017-11-06T11:21:20.000Z | 2018-07-20T14:47:21.000Z | nndrone/converters.py | Tevien/NNDrone | 76dce457324ea03a8757d74f6403fbf60132294b | [
"BSD-3-Clause"
] | 4 | 2018-01-12T15:49:40.000Z | 2018-04-06T02:29:56.000Z | nndrone/converters.py | Tevien/NNDrone | 76dce457324ea03a8757d74f6403fbf60132294b | [
"BSD-3-Clause"
] | 12 | 2018-01-12T15:46:35.000Z | 2018-06-21T22:41:56.000Z | import numpy as np
import pickle
import math
try:
from utilities import dot_loss, next_batch
except ImportError:
from utilities.utilities import dot_loss, next_batch
class DontCacheRef(Exception):
pass
class BasicConverter(object):
def __init__(self, learning_rate = 0.05, batch_size = 1, num_epochs =... | 45.261649 | 177 | 0.578001 | import numpy as np
import pickle
import math
try:
from utilities import dot_loss, next_batch
except ImportError:
from utilities.utilities import dot_loss, next_batch
class DontCacheRef(Exception):
pass
class BasicConverter(object):
def __init__(self, learning_rate = 0.05, batch_size = 1, num_epochs =... | true | true |
790dee9ae31e2e68f764162bc69de5f0809f90e7 | 2,059 | py | Python | resilient-circuits/setup.py | ibmresilient/resilient-python-api | 85e0ff684a88f744645c0ace414f51d769bcc3c2 | [
"MIT"
] | 28 | 2017-12-22T00:26:59.000Z | 2022-01-22T14:51:33.000Z | resilient-circuits/setup.py | ibmresilient/resilient-python-api | 85e0ff684a88f744645c0ace414f51d769bcc3c2 | [
"MIT"
] | 18 | 2018-03-06T19:04:20.000Z | 2022-03-21T15:06:30.000Z | resilient-circuits/setup.py | ibmresilient/resilient-python-api | 85e0ff684a88f744645c0ace414f51d769bcc3c2 | [
"MIT"
] | 28 | 2018-05-01T17:53:22.000Z | 2022-03-28T09:56:59.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (c) Copyright IBM Corp. 2010, 2021. All Rights Reserved.
""" setup.py for resilient-circuits Python module """
import io
from os import path
from setuptools import find_packages, setup
this_directory = path.abspath(path.dirname(__file__))
with io.open(path.join(this_... | 31.676923 | 102 | 0.63186 |
import io
from os import path
from setuptools import find_packages, setup
this_directory = path.abspath(path.dirname(__file__))
with io.open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
long_description = f.read()
setup(
name="resilient_circuits",
use_scm_version={"root": "../", ... | true | true |
790deea8025bfc6d3ad5be3b0c721ae8b17b96fd | 5,359 | py | Python | dev/scratch/sphinx-quickstart/conf.py | nrser/qb | 13b5737afb0f00971793768fcb539907d790d8a5 | [
"MIT"
] | 1 | 2018-03-23T01:42:52.000Z | 2018-03-23T01:42:52.000Z | dev/scratch/sphinx-quickstart/conf.py | nrser/qb | 13b5737afb0f00971793768fcb539907d790d8a5 | [
"MIT"
] | 12 | 2016-02-12T08:35:43.000Z | 2018-03-23T08:05:49.000Z | dev/scratch/sphinx-quickstart/conf.py | nrser/qb | 13b5737afb0f00971793768fcb539907d790d8a5 | [
"MIT"
] | 1 | 2017-07-13T10:10:34.000Z | 2017-07-13T10:10:34.000Z | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 30.448864 | 79 | 0.639112 |
project = u'QB'
copyright = u'2018, NRSER'
author = u'NRSER'
version = u''
release = u''
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.viewcod... | true | true |
790deeb39d6c1199c29d1d1e3b14a36019193573 | 637 | py | Python | model-optimizer/mo/pipeline/unified.py | monroid/openvino | 8272b3857ef5be0aaa8abbf7bd0d5d5615dc40b6 | [
"Apache-2.0"
] | 2,406 | 2020-04-22T15:47:54.000Z | 2022-03-31T10:27:37.000Z | model-optimizer/mo/pipeline/unified.py | thomas-yanxin/openvino | 031e998a15ec738c64cc2379d7f30fb73087c272 | [
"Apache-2.0"
] | 4,948 | 2020-04-22T15:12:39.000Z | 2022-03-31T18:45:42.000Z | model-optimizer/mo/pipeline/unified.py | thomas-yanxin/openvino | 031e998a15ec738c64cc2379d7f30fb73087c272 | [
"Apache-2.0"
] | 991 | 2020-04-23T18:21:09.000Z | 2022-03-31T18:40:57.000Z | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import argparse
from mo.graph.graph import Graph
from mo.pipeline.common import get_ir_version
from mo.utils import class_registration
def unified_pipeline(argv: argparse.Namespace):
graph = Graph(cmd_params=argv, name=argv.model_... | 31.85 | 89 | 0.78022 |
import argparse
from mo.graph.graph import Graph
from mo.pipeline.common import get_ir_version
from mo.utils import class_registration
def unified_pipeline(argv: argparse.Namespace):
graph = Graph(cmd_params=argv, name=argv.model_name, ir_version=get_ir_version(argv))
class_registration.apply_replacements... | true | true |
790defb2e60f646da18e707569642139f440968e | 8,837 | py | Python | tests/extractcode/extractcode_assert_utils.py | doc22940/scancode-toolk | 588b9a9411730e99d763d715ae9f38575744aaee | [
"Apache-2.0",
"CC0-1.0"
] | 1 | 2020-06-24T16:03:52.000Z | 2020-06-24T16:03:52.000Z | tests/extractcode/extractcode_assert_utils.py | doc22940/scancode-toolk | 588b9a9411730e99d763d715ae9f38575744aaee | [
"Apache-2.0",
"CC0-1.0"
] | 1 | 2021-06-02T02:50:07.000Z | 2021-06-02T02:50:07.000Z | tests/extractcode/extractcode_assert_utils.py | hwpplayers/scancode-toolkit | 72850bd57a1a841e5a6a6e4120223a00c4189046 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | #
# Copyright (c) 2015 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... | 37.927039 | 133 | 0.640715 |
from __future__ import absolute_import
from __future__ import print_function
import os
import ntpath
import posixpath
from commoncode import compat
from commoncode import filetype
from commoncode import fileutils
from commoncode.testcase import FileBasedTesting
from commoncode.system import on... | true | true |
790df00b3d96283fd9f00b4fd1e4b28bb99f7a5c | 2,817 | py | Python | calculation/gmhazard_calc/gmhazard_calc/nz_code/nzs1170p5/nzs_zfactor_2016/ll2z.py | ucgmsim/gmhazard | d3d90b4c94b3d9605597a3efeccc8523a1e50c0e | [
"MIT"
] | null | null | null | calculation/gmhazard_calc/gmhazard_calc/nz_code/nzs1170p5/nzs_zfactor_2016/ll2z.py | ucgmsim/gmhazard | d3d90b4c94b3d9605597a3efeccc8523a1e50c0e | [
"MIT"
] | 8 | 2021-10-13T02:33:23.000Z | 2022-03-29T21:01:08.000Z | calculation/gmhazard_calc/gmhazard_calc/nz_code/nzs1170p5/nzs_zfactor_2016/ll2z.py | ucgmsim/gmhazard | d3d90b4c94b3d9605597a3efeccc8523a1e50c0e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
from matplotlib.path import Path
import numpy as np
import pandas as pd
from scipy.interpolate import griddata
from qcore import geo
DATA = os.path.join(os.path.dirname(os.path.abspath(__file__)), "zdata")
# constant regions and max bounds for faster processing
POLYGONS = [
(os.... | 32.37931 | 145 | 0.636493 |
import os
from matplotlib.path import Path
import numpy as np
import pandas as pd
from scipy.interpolate import griddata
from qcore import geo
DATA = os.path.join(os.path.dirname(os.path.abspath(__file__)), "zdata")
POLYGONS = [
(os.path.join(DATA, "AucklandPolgonOutline_Points_WGS84.txt"), 0.13),
(os.pa... | true | true |
790df02ebcc7c2fd723b63bd54ae85b27f97db53 | 1,608 | py | Python | ocdskingfisherprocess/cli/commands/new_transform_upgrade_1_0_to_1_1.py | matiasSanabria/kingfisher-process | 88cb768aaa562714c8bd53e05717639faf041501 | [
"BSD-3-Clause"
] | 1 | 2019-04-11T10:17:32.000Z | 2019-04-11T10:17:32.000Z | ocdskingfisherprocess/cli/commands/new_transform_upgrade_1_0_to_1_1.py | matiasSanabria/kingfisher-process | 88cb768aaa562714c8bd53e05717639faf041501 | [
"BSD-3-Clause"
] | 282 | 2018-12-20T16:49:22.000Z | 2022-02-01T00:48:10.000Z | ocdskingfisherprocess/cli/commands/new_transform_upgrade_1_0_to_1_1.py | matiasSanabria/kingfisher-process | 88cb768aaa562714c8bd53e05717639faf041501 | [
"BSD-3-Clause"
] | 7 | 2019-04-15T13:36:18.000Z | 2021-03-02T16:25:41.000Z | import ocdskingfisherprocess.cli.commands.base
import ocdskingfisherprocess.database
from ocdskingfisherprocess.transform import TRANSFORM_TYPE_UPGRADE_1_0_TO_1_1
class NewTransformUpgrade10To11CLICommand(ocdskingfisherprocess.cli.commands.base.CLICommand):
command = 'new-transform-upgrade-1-0-to-1-1'
def co... | 43.459459 | 112 | 0.636816 | import ocdskingfisherprocess.cli.commands.base
import ocdskingfisherprocess.database
from ocdskingfisherprocess.transform import TRANSFORM_TYPE_UPGRADE_1_0_TO_1_1
class NewTransformUpgrade10To11CLICommand(ocdskingfisherprocess.cli.commands.base.CLICommand):
command = 'new-transform-upgrade-1-0-to-1-1'
def co... | true | true |
790df0fb4eab5abf961604977a83799295634a26 | 866 | py | Python | natural-languages-python.py | ErosMLima/python-server-connection | a15706a007a95eff64597fa02e64d95b6b2da6a5 | [
"MIT"
] | 2 | 2020-07-27T06:33:59.000Z | 2021-02-02T15:17:56.000Z | natural-languages-python.py | ErosMLima/python-server-connection | a15706a007a95eff64597fa02e64d95b6b2da6a5 | [
"MIT"
] | null | null | null | natural-languages-python.py | ErosMLima/python-server-connection | a15706a007a95eff64597fa02e64d95b6b2da6a5 | [
"MIT"
] | null | null | null | import emoji
emoji.emojize('\:sunglasses:?')
#Transformação #Comentário
String['Curso em Videos Python']
frase[9:13]
frase[9:21:2]
frase[:5]
frase[15:]
frase[9::3]
#Aula Curso Em Video Python 9 => revisão 2 [13/07/2020 14h00m]
#Funcionalidades de Trasnformação
Objeti.Methodo() #Comentário
frase.fi... | 24.055556 | 94 | 0.702079 | import emoji
emoji.emojize('\:sunglasses:?')
so em Videos Python']
frase[9:13]
frase[9:21:2]
frase[:5]
frase[15:]
frase[9::3]
Objeti.Methodo()
frase.find('deo')
frase.find('Android')
frase.replace('Python','Android')
frase.lower()
frase.capitelize()
frase.title()
frase = ['Aprenda Python']
... | true | true |
790df18be8449e10282c4e08023378127398a2ee | 8,687 | py | Python | GoogleScraper/commandline.py | hnhnarek/GoogleScraper | 80421366f2fbff2537edc8f29e51f9b75df919a3 | [
"Apache-2.0"
] | 1 | 2018-11-18T14:36:29.000Z | 2018-11-18T14:36:29.000Z | GoogleScraper/commandline.py | hnhnarek/GoogleScraper | 80421366f2fbff2537edc8f29e51f9b75df919a3 | [
"Apache-2.0"
] | null | null | null | GoogleScraper/commandline.py | hnhnarek/GoogleScraper | 80421366f2fbff2537edc8f29e51f9b75df919a3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import argparse
from GoogleScraper.version import __version__
def get_command_line(only_print_help=False):
"""
Parse command line arguments when GoogleScraper is used as a CLI application.
Returns:
The configuration as a dictionary that determines the behaviour of the app... | 58.302013 | 138 | 0.574191 |
import argparse
from GoogleScraper.version import __version__
def get_command_line(only_print_help=False):
parser = argparse.ArgumentParser(prog='GoogleScraper',
description='Scrapes the Google, Yandex, Bing and many other search engines by '
... | true | true |
790df2247cdf56f82b55987b1a12b3ee33742514 | 6,396 | py | Python | packages/pytea/pytest/benchmarks/transformers/tests/test_tokenization_fsmt.py | lego0901/pytea | 8ede650def2e68f4610ba816451d8b9e28f09f76 | [
"MIT"
] | 1 | 2020-11-14T06:08:38.000Z | 2020-11-14T06:08:38.000Z | packages/pytea/pytest/benchmarks/transformers/tests/test_tokenization_fsmt.py | lego0901/pytea | 8ede650def2e68f4610ba816451d8b9e28f09f76 | [
"MIT"
] | null | null | null | packages/pytea/pytest/benchmarks/transformers/tests/test_tokenization_fsmt.py | lego0901/pytea | 8ede650def2e68f4610ba816451d8b9e28f09f76 | [
"MIT"
] | 1 | 2020-11-16T23:12:50.000Z | 2020-11-16T23:12:50.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | 38.071429 | 141 | 0.635241 |
import json
import os
import unittest
from transformers.file_utils import cached_property
from transformers.testing_utils import slow
from transformers.tokenization_fsmt import VOCAB_FILES_NAMES, FSMTTokenizer
from .test_tokenization_common import TokenizerTesterMixin
FSMT_TINY2 = "stas/tiny-wmt19-... | true | true |
790df3d3edbdef7f3e27cbfab633888f8f7bfa8a | 3,597 | py | Python | milk/supervised/classifier.py | luispedro/milk | abc2a28b526c199414d42c0a26092938968c3caf | [
"MIT"
] | 284 | 2015-01-21T09:07:55.000Z | 2022-03-19T07:39:17.000Z | milk/supervised/classifier.py | pursh2002/milk | abc2a28b526c199414d42c0a26092938968c3caf | [
"MIT"
] | 6 | 2015-04-22T15:17:44.000Z | 2018-04-22T16:06:24.000Z | milk/supervised/classifier.py | pursh2002/milk | abc2a28b526c199414d42c0a26092938968c3caf | [
"MIT"
] | 109 | 2015-02-03T07:39:59.000Z | 2022-01-16T00:16:13.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2008-2015, Luis Pedro Coelho <luis@luispedro.org>
# vim: set ts=4 sts=4 sw=4 expandtab smartindent:
#
# 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... | 29.727273 | 80 | 0.666389 |
from __future__ import division
import numpy as np
from .normalise import normaliselabels
from .base import supervised_model
__all__ = ['normaliselabels', 'ctransforms']
class threshold_model(object):
def __init__(self, threshold=.5):
self.threshold = .5
def apply(self, f):
... | true | true |
790df45ba9086de045cf171d19e9c521fc8111bf | 17,757 | py | Python | cgp.py | Pavan-Samtani/CGP-CNN-v2 | 2eede8297542b7551d5ef5bf11aeeaba34bf4f3f | [
"MIT"
] | null | null | null | cgp.py | Pavan-Samtani/CGP-CNN-v2 | 2eede8297542b7551d5ef5bf11aeeaba34bf4f3f | [
"MIT"
] | null | null | null | cgp.py | Pavan-Samtani/CGP-CNN-v2 | 2eede8297542b7551d5ef5bf11aeeaba34bf4f3f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import csv
import time
import numpy as np
import math
import os
# gene[f][c] f:function type, c:connection (nodeID)
class Individual(object):
def __init__(self, net_info, init):
self.net_info = net_info
self.gene = np.zeros((self.net_info.node_num + ... | 47.862534 | 120 | 0.584108 |
import csv
import time
import numpy as np
import math
import os
class Individual(object):
def __init__(self, net_info, init):
self.net_info = net_info
self.gene = np.zeros((self.net_info.node_num + self.net_info.out_num, self.net_info.max_in_num + 1)).astype(int)
self.is_active = np.e... | true | true |
790df4d87f1f316506b7ed42cc4afd8e8add0212 | 19,206 | py | Python | ocs_ci/ocs/ui/views.py | keesturam/ocs-ci | de85058255b6a50c65889b8077da326be28bdcc7 | [
"MIT"
] | null | null | null | ocs_ci/ocs/ui/views.py | keesturam/ocs-ci | de85058255b6a50c65889b8077da326be28bdcc7 | [
"MIT"
] | null | null | null | ocs_ci/ocs/ui/views.py | keesturam/ocs-ci | de85058255b6a50c65889b8077da326be28bdcc7 | [
"MIT"
] | null | null | null | from selenium.webdriver.common.by import By
osd_sizes = ("512", "2048", "4096")
login = {
"ocp_page": "Overview · Red Hat OpenShift Container Platform",
"username": ("inputUsername", By.ID),
"password": ("inputPassword", By.ID),
"click_login": ("//button[text()='Log in']", By.XPATH),
"flexy_kubead... | 40.0125 | 88 | 0.6272 | from selenium.webdriver.common.by import By
osd_sizes = ("512", "2048", "4096")
login = {
"ocp_page": "Overview · Red Hat OpenShift Container Platform",
"username": ("inputUsername", By.ID),
"password": ("inputPassword", By.ID),
"click_login": ("//button[text()='Log in']", By.XPATH),
"flexy_kubead... | true | true |
790df4e7a9c04ae8a13942dddbafbb797339cb4a | 741 | py | Python | src/dictionaryCode/other/siderData1.py | ankita094/BioIntMed | a76616a3a87b02f3523a77704d6b9bc42253f9a7 | [
"MIT"
] | null | null | null | src/dictionaryCode/other/siderData1.py | ankita094/BioIntMed | a76616a3a87b02f3523a77704d6b9bc42253f9a7 | [
"MIT"
] | null | null | null | src/dictionaryCode/other/siderData1.py | ankita094/BioIntMed | a76616a3a87b02f3523a77704d6b9bc42253f9a7 | [
"MIT"
] | null | null | null | #CODE1---For preparing the list of DRUG side-effect relation from SIDER database---
#Python 3.6.5 |Anaconda, Inc.
import sys
import glob
import errno
import csv
path = '/home/16AT72P01/Excelra/SIDER1/output/adverse_effects.tsv'
files = glob.glob(path)
unique_sideeffect = set()
unique_drug = set()
unique_pair = set()... | 25.551724 | 105 | 0.735493 |
import sys
import glob
import errno
import csv
path = '/home/16AT72P01/Excelra/SIDER1/output/adverse_effects.tsv'
files = glob.glob(path)
unique_sideeffect = set()
unique_drug = set()
unique_pair = set()
with open(path) as f1:
reader = csv.DictReader(f1, quotechar='"', delimiter='\t', quoting=csv.QUOTE_ALL, skip... | true | true |
790df56e8912cf9310145a1e2cea8740ba1983f7 | 2,515 | py | Python | src/users/views/user.py | system-design-2/user-service | 5bf71e15d7c0969bac55a0e53298711877b02aa1 | [
"MIT"
] | null | null | null | src/users/views/user.py | system-design-2/user-service | 5bf71e15d7c0969bac55a0e53298711877b02aa1 | [
"MIT"
] | null | null | null | src/users/views/user.py | system-design-2/user-service | 5bf71e15d7c0969bac55a0e53298711877b02aa1 | [
"MIT"
] | null | null | null | import logging
from django.utils.decorators import method_decorator
from django_filters.rest_framework import DjangoFilterBackend
from drf_yasg.utils import swagger_auto_schema
from rest_condition import Or
from rest_framework import filters, viewsets
from rest_framework.permissions import IsAdminUser, IsAuthenticated... | 37.537313 | 97 | 0.749105 | import logging
from django.utils.decorators import method_decorator
from django_filters.rest_framework import DjangoFilterBackend
from drf_yasg.utils import swagger_auto_schema
from rest_condition import Or
from rest_framework import filters, viewsets
from rest_framework.permissions import IsAdminUser, IsAuthenticated... | true | true |
790df7fb23e384f7f4dd00412dd888030f392d8f | 3,149 | py | Python | tests/test_multiple_packages_with_tasks.py | orlevii/realm | e561ba09df4fbdc3bf60c8678462da4f55033894 | [
"MIT"
] | 3 | 2021-06-17T06:27:16.000Z | 2022-03-14T09:34:42.000Z | tests/test_multiple_packages_with_tasks.py | orlevii/realm | e561ba09df4fbdc3bf60c8678462da4f55033894 | [
"MIT"
] | null | null | null | tests/test_multiple_packages_with_tasks.py | orlevii/realm | e561ba09df4fbdc3bf60c8678462da4f55033894 | [
"MIT"
] | null | null | null | import unittest
from realm.cli.application import Application
from realm.cli.commands.install import InstallCommand
from realm.cli.commands.ls import LsCommand
from realm.cli.commands.task import TaskCommand
from realm.entities import Config, RealmContext
from realm.utils.child_process import ChildProcess
from tests.... | 33.5 | 94 | 0.617021 | import unittest
from realm.cli.application import Application
from realm.cli.commands.install import InstallCommand
from realm.cli.commands.ls import LsCommand
from realm.cli.commands.task import TaskCommand
from realm.entities import Config, RealmContext
from realm.utils.child_process import ChildProcess
from tests.... | true | true |
790df8504762ffa2a359c7df6676f6dc68a78386 | 409 | py | Python | curiefense/curielogserver/app/main.py | fossabot/curiefense | 6941f8aa08bcac1b0cf87c36ddb0037917a38c5a | [
"Apache-2.0"
] | 1 | 2020-11-15T06:27:05.000Z | 2020-11-15T06:27:05.000Z | curiefense/curielogserver/app/main.py | fossabot/curiefense | 6941f8aa08bcac1b0cf87c36ddb0037917a38c5a | [
"Apache-2.0"
] | 3 | 2022-02-24T09:58:32.000Z | 2022-03-01T20:05:07.000Z | curiefense/curielogserver/app/main.py | xavier-rbz/curiefense | 44200a90c515fe184e9c66ea662b2643adcbd34e | [
"Apache-2.0"
] | 1 | 2021-01-07T20:51:48.000Z | 2021-01-07T20:51:48.000Z | from curielogserver import app, get_default_dbconfig
import os
import time
import psycopg2.pool
from psycopg2 import OperationalError
retries = 10
while retries > 0:
retries -= 1
try:
app.config['postgreSQL_pool'] = psycopg2.pool.ThreadedConnectionPool(1, 20, get_default_dbconfig())
break
e... | 24.058824 | 107 | 0.691932 | from curielogserver import app, get_default_dbconfig
import os
import time
import psycopg2.pool
from psycopg2 import OperationalError
retries = 10
while retries > 0:
retries -= 1
try:
app.config['postgreSQL_pool'] = psycopg2.pool.ThreadedConnectionPool(1, 20, get_default_dbconfig())
break
e... | true | true |
790df908af3666ae813f54b97ab4e3aa3b0ef1c0 | 6,947 | py | Python | src/data/generateData.py | oesst/HRTF_neural_model | 494d29c514eaad3aee575f77d08a59a9d011a415 | [
"MIT"
] | null | null | null | src/data/generateData.py | oesst/HRTF_neural_model | 494d29c514eaad3aee575f77d08a59a9d011a415 | [
"MIT"
] | null | null | null | src/data/generateData.py | oesst/HRTF_neural_model | 494d29c514eaad3aee575f77d08a59a9d011a415 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import click
import logging
from pathlib import Path
from os import listdir
from os.path import isfile, join
import numpy as np
import soundfile as sf
from scipy import io
import scipy.signal as sp
from src.features import gtgram
ROOT = Path(__file__).resolve().parents[2]
# set the path to th... | 43.968354 | 165 | 0.539513 |
import click
import logging
from pathlib import Path
from os import listdir
from os.path import isfile, join
import numpy as np
import soundfile as sf
from scipy import io
import scipy.signal as sp
from src.features import gtgram
ROOT = Path(__file__).resolve().parents[2]
SOUND_FILES = ROOT / 'data/raw/sound_sampl... | true | true |
790df9f628d3cb8a6382a7969703167a2921418d | 2,267 | py | Python | zerver/management/commands/convert_bot_to_outgoing_webhook.py | lunayach/zulip | 2d8c1f6d93499aa6395cfcb1895859569890953f | [
"Apache-2.0"
] | null | null | null | zerver/management/commands/convert_bot_to_outgoing_webhook.py | lunayach/zulip | 2d8c1f6d93499aa6395cfcb1895859569890953f | [
"Apache-2.0"
] | 1 | 2021-11-15T17:53:42.000Z | 2021-11-15T17:53:42.000Z | zerver/management/commands/convert_bot_to_outgoing_webhook.py | lunayach/zulip | 2d8c1f6d93499aa6395cfcb1895859569890953f | [
"Apache-2.0"
] | null | null | null |
from argparse import ArgumentParser
from typing import Any
from zerver.lib.management import ZulipBaseCommand
from zerver.models import Service, UserProfile
class Command(ZulipBaseCommand):
help = """Given an existing bot, converts it into an outgoing webhook bot."""
def add_arguments(self, parser: Argument... | 37.783333 | 86 | 0.599912 |
from argparse import ArgumentParser
from typing import Any
from zerver.lib.management import ZulipBaseCommand
from zerver.models import Service, UserProfile
class Command(ZulipBaseCommand):
help = """Given an existing bot, converts it into an outgoing webhook bot."""
def add_arguments(self, parser: Argument... | true | true |
790dfa428636cd37454a13f136024e191d7e9967 | 14,814 | py | Python | jina/peapods/peas/__init__.py | anuragdw710/jina | b2d3577f2d5b86399f0b4a8e4529df4929dd18ff | [
"Apache-2.0"
] | 3 | 2021-09-02T04:55:20.000Z | 2021-11-15T09:41:50.000Z | jina/peapods/peas/__init__.py | sheetal01761/jina | 520fc0794fb43d96e1fc85534e9df3cf9c89c42e | [
"Apache-2.0"
] | null | null | null | jina/peapods/peas/__init__.py | sheetal01761/jina | 520fc0794fb43d96e1fc85534e9df3cf9c89c42e | [
"Apache-2.0"
] | null | null | null | import argparse
import multiprocessing
import os
import threading
import time
from typing import Any, Tuple, Union, Dict, Optional
from .helper import _get_event, ConditionalEvent
from ... import __stop_msg__, __ready_msg__, __default_host__
from ...enums import PeaRoleType, RuntimeBackendType, SocketType
from ...exce... | 38.984211 | 115 | 0.605778 | import argparse
import multiprocessing
import os
import threading
import time
from typing import Any, Tuple, Union, Dict, Optional
from .helper import _get_event, ConditionalEvent
from ... import __stop_msg__, __ready_msg__, __default_host__
from ...enums import PeaRoleType, RuntimeBackendType, SocketType
from ...exce... | true | true |
790dfaa3ace00ee844e14ba35f6542955066a057 | 2,534 | py | Python | src/yt_list_downloader/input.py | portikCoder/yt-list-downloader | a96dbf605b21ea0f62e4c80d04251ee4def4c60e | [
"MIT"
] | null | null | null | src/yt_list_downloader/input.py | portikCoder/yt-list-downloader | a96dbf605b21ea0f62e4c80d04251ee4def4c60e | [
"MIT"
] | null | null | null | src/yt_list_downloader/input.py | portikCoder/yt-list-downloader | a96dbf605b21ea0f62e4c80d04251ee4def4c60e | [
"MIT"
] | null | null | null | playlists = """https://www.youtube.com/playlist?list=PLWOxuTkHhAq70Q4ZF1EcsRaW1uHs6zygL
https://www.youtube.com/playlist?list=PLObmubSxSaRKdWB3BoyndydqDGkgbMlbC
https://www.youtube.com/playlist?list=PLxN__ARc_RfpOAdnB14rBSF6xDHDySNE4
https://www.youtube.com/playlist?list=PLxN__ARc_Rfrsee6JJkU198Fa0rxjbTgQ
https://www.y... | 70.388889 | 87 | 0.866219 | playlists = """https://www.youtube.com/playlist?list=PLWOxuTkHhAq70Q4ZF1EcsRaW1uHs6zygL
https://www.youtube.com/playlist?list=PLObmubSxSaRKdWB3BoyndydqDGkgbMlbC
https://www.youtube.com/playlist?list=PLxN__ARc_RfpOAdnB14rBSF6xDHDySNE4
https://www.youtube.com/playlist?list=PLxN__ARc_Rfrsee6JJkU198Fa0rxjbTgQ
https://www.y... | true | true |
790dfb1b129701f5d95410bf58efedf5ed0fc8d9 | 15,042 | py | Python | nets/block.py | manoil/Deep_VoiceChanger | 5cd3d6ff2a8a9eea3b8fae1c0e6ed2d00012b771 | [
"MIT"
] | 176 | 2019-01-03T02:18:09.000Z | 2022-03-25T11:39:23.000Z | nets/block.py | manoil/Deep_VoiceChanger | 5cd3d6ff2a8a9eea3b8fae1c0e6ed2d00012b771 | [
"MIT"
] | 9 | 2019-01-04T16:20:09.000Z | 2021-01-05T10:39:24.000Z | nets/block.py | manoil/Deep_VoiceChanger | 5cd3d6ff2a8a9eea3b8fae1c0e6ed2d00012b771 | [
"MIT"
] | 43 | 2018-12-02T15:04:27.000Z | 2022-03-11T15:48:02.000Z | import math
import chainer
import chainer.functions as F
import chainer.links as L
import numpy as np
from .sn_convolution_2d import SNConvolution2D, SNDeconvolution2D
from .sn_linear import SNLinear
def _upsample(x):
h, w = x.shape[2:]
return F.unpooling_2d(x, 2, outsize=(h * 2, w * 2))
def _downsample(x):
... | 39.899204 | 134 | 0.582103 | import math
import chainer
import chainer.functions as F
import chainer.links as L
import numpy as np
from .sn_convolution_2d import SNConvolution2D, SNDeconvolution2D
from .sn_linear import SNLinear
def _upsample(x):
h, w = x.shape[2:]
return F.unpooling_2d(x, 2, outsize=(h * 2, w * 2))
def _downsample(x):
... | true | true |
790dfbabe99181be277c7a5d49fc080057ab0ccf | 2,583 | py | Python | scripts/deindexify.py | learningequality/channel2site | 0020c15f404c58e369bbe435950e1a38418313e8 | [
"MIT"
] | null | null | null | scripts/deindexify.py | learningequality/channel2site | 0020c15f404c58e369bbe435950e1a38418313e8 | [
"MIT"
] | null | null | null | scripts/deindexify.py | learningequality/channel2site | 0020c15f404c58e369bbe435950e1a38418313e8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import argparse
import bs4
import os
import re
# better indentation hack via https://stackoverflow.com/a/15513483/127114
orig_prettify = bs4.BeautifulSoup.prettify
r = re.compile(r'^(\s*)', re.MULTILINE)
def prettify(self, encoding=None, formatter="minimal", indent_width=3):
return r.sub(r'\... | 33.115385 | 98 | 0.603175 |
import argparse
import bs4
import os
import re
orig_prettify = bs4.BeautifulSoup.prettify
r = re.compile(r'^(\s*)', re.MULTILINE)
def prettify(self, encoding=None, formatter="minimal", indent_width=3):
return r.sub(r'\1' * indent_width, orig_prettify(self, encoding, formatter))
bs4.BeautifulSoup.prettify = pret... | true | true |
790dfbd4daba2cae77c456b5f7c16f383632bb75 | 1,534 | py | Python | tests/timings.py | ncullen93/ANTsPy | a4c990dcd5b7445a45ce7b366ee018c7350e7d9f | [
"Apache-2.0"
] | 3 | 2018-06-07T19:11:47.000Z | 2019-06-10T05:24:06.000Z | tests/timings.py | ncullen93/ANTsPy | a4c990dcd5b7445a45ce7b366ee018c7350e7d9f | [
"Apache-2.0"
] | null | null | null | tests/timings.py | ncullen93/ANTsPy | a4c990dcd5b7445a45ce7b366ee018c7350e7d9f | [
"Apache-2.0"
] | 1 | 2019-04-04T06:18:44.000Z | 2019-04-04T06:18:44.000Z | """
Timings against numpy/itk/nibabel/etc where appropriate
"""
import os
import nibabel as nib
import itk
import ants
import time
def time_nifti_to_numpy(N_TRIALS):
"""
Times how fast a framework can read a nifti file and convert it to numpy
"""
datadir = os.path.join(os.path.dirname(os.path.realpa... | 26 | 89 | 0.625163 |
import os
import nibabel as nib
import itk
import ants
import time
def time_nifti_to_numpy(N_TRIALS):
datadir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data')
img_paths = []
for dtype in ['CHAR', 'DOUBLE', 'FLOAT', 'SHORT',
'UNSIGNEDCHAR', 'UNSIGNEDSHORT']:
... | true | true |
790dfd3fea2c63b9ff7d941d6798ec613cfce731 | 636 | py | Python | notes/migrations/0004_auto_20220101_1047.py | ArnedyNavi/studymate | 55e6a2c6717dd478a311ea8bf839a26ca3ef2b40 | [
"MIT"
] | 4 | 2021-12-31T17:25:00.000Z | 2022-02-08T17:05:46.000Z | notes/migrations/0004_auto_20220101_1047.py | ArnedyNavi/studymate | 55e6a2c6717dd478a311ea8bf839a26ca3ef2b40 | [
"MIT"
] | null | null | null | notes/migrations/0004_auto_20220101_1047.py | ArnedyNavi/studymate | 55e6a2c6717dd478a311ea8bf839a26ca3ef2b40 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.9 on 2022-01-01 10:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('notes', '0003_auto_20220101_1040'),
]
operations = [
migrations.RenameField(
model_name='notes',
old_name='category'... | 22.714286 | 47 | 0.553459 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('notes', '0003_auto_20220101_1040'),
]
operations = [
migrations.RenameField(
model_name='notes',
old_name='category',
new_name='categories',
),... | true | true |
790dfd571a02aaf0e1f50352d8a32cceda3321ae | 213 | py | Python | cogs/utils/my_errors.py | Roxedus/PoengBott | f485021b4bc9691cb860872eb51307de3f23d6dd | [
"MIT"
] | null | null | null | cogs/utils/my_errors.py | Roxedus/PoengBott | f485021b4bc9691cb860872eb51307de3f23d6dd | [
"MIT"
] | null | null | null | cogs/utils/my_errors.py | Roxedus/PoengBott | f485021b4bc9691cb860872eb51307de3f23d6dd | [
"MIT"
] | null | null | null | # pylint: disable=missing-class-docstring,missing-module-docstring
# Discord Packages
from discord.ext.commands.errors import CommandError
class NoDM(CommandError):
pass
class NoToken(Exception):
pass
| 17.75 | 66 | 0.784038 |
from discord.ext.commands.errors import CommandError
class NoDM(CommandError):
pass
class NoToken(Exception):
pass
| true | true |
790dfd5eeab3c790a341e13a086dc986dd95779e | 2,881 | py | Python | infer/lib/python/inferlib/capture/ant.py | stefb965/infer | 4057ffadcf6371af76be94dc34d05169ca290128 | [
"BSD-3-Clause"
] | 1 | 2016-12-19T07:33:16.000Z | 2016-12-19T07:33:16.000Z | infer/lib/python/inferlib/capture/ant.py | stefb965/infer | 4057ffadcf6371af76be94dc34d05169ca290128 | [
"BSD-3-Clause"
] | null | null | null | infer/lib/python/inferlib/capture/ant.py | stefb965/infer | 4057ffadcf6371af76be94dc34d05169ca290128 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2015 - present Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
import logging
from . ... | 34.297619 | 77 | 0.609511 |
import logging
from . import util
from inferlib import jwlib
MODULE_NAME = __name__
MODULE_DESCRIPTION = '''Run analysis of code built with a command like:
ant [options] [target]
Analysis examples:
infer -- ant compile'''
LANG = ['java']
def gen_instance(*args):
return AntCapture(*args)
create_argpar... | true | true |
790dfddcd5bba69ae9183519679bf598e77bebf4 | 4,776 | py | Python | cvss/datasets/nyuv2.py | etmwb/cvsegmentation | c283a79f4cf4e78d057f598944b1c252f6533f00 | [
"MIT"
] | null | null | null | cvss/datasets/nyuv2.py | etmwb/cvsegmentation | c283a79f4cf4e78d057f598944b1c252f6533f00 | [
"MIT"
] | null | null | null | cvss/datasets/nyuv2.py | etmwb/cvsegmentation | c283a79f4cf4e78d057f598944b1c252f6533f00 | [
"MIT"
] | null | null | null | import os
import sys
import numpy as np
import random
import math
from PIL import Image, ImageOps, ImageFilter
import torch
import torch.utils.data as data
import torchvision.transforms as transform
from .base import BaseDataset
class NYUv2Segmentation(BaseDataset):
BASE_DIR = 'nyuv2'
NUM_CLAS... | 37.904762 | 79 | 0.568677 | import os
import sys
import numpy as np
import random
import math
from PIL import Image, ImageOps, ImageFilter
import torch
import torch.utils.data as data
import torchvision.transforms as transform
from .base import BaseDataset
class NYUv2Segmentation(BaseDataset):
BASE_DIR = 'nyuv2'
NUM_CLAS... | true | true |
790dfde41c1193449a9e7c78b80a0145993ae772 | 1,090 | py | Python | cloudferrylib/os/actions/detach_used_volumes.py | toha10/CloudFerry | 5f844a480d3326d1fea74cca35b648c32d390fab | [
"Apache-2.0"
] | null | null | null | cloudferrylib/os/actions/detach_used_volumes.py | toha10/CloudFerry | 5f844a480d3326d1fea74cca35b648c32d390fab | [
"Apache-2.0"
] | null | null | null | cloudferrylib/os/actions/detach_used_volumes.py | toha10/CloudFerry | 5f844a480d3326d1fea74cca35b648c32d390fab | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | 36.333333 | 70 | 0.707339 |
from cloudferrylib.base.action import action
from cloudferrylib.utils import utils as utl
class DetachVolumes(action.Action):
def run(self, storage_info={}, **kwargs):
resource_storage = self.cloud.resources[utl.STORAGE_RESOURCE]
for (vol_id, vol_info) \
in storage_i... | true | true |
790e001fdd0c7d8bcf20399395d3bf6cac5629ca | 10,657 | py | Python | Zmax_autoscoring_controlled_train_test_split.py | MahdadJafarzadeh/ssccoorriinngg | 63c726e9e7d0f6d13032415c76b8c3bb1ff2bee3 | [
"MIT"
] | 2 | 2020-04-28T12:50:26.000Z | 2020-05-13T08:52:42.000Z | Zmax_autoscoring_controlled_train_test_split.py | MahdadJafarzadeh/ssccoorriinngg | 63c726e9e7d0f6d13032415c76b8c3bb1ff2bee3 | [
"MIT"
] | null | null | null | Zmax_autoscoring_controlled_train_test_split.py | MahdadJafarzadeh/ssccoorriinngg | 63c726e9e7d0f6d13032415c76b8c3bb1ff2bee3 | [
"MIT"
] | 1 | 2020-07-14T13:48:56.000Z | 2020-07-14T13:48:56.000Z | # -*- coding: utf-8 -*-
"""
Created on Sat Jun 6 22:41:54 2020
@author: mahjaf
Automatic sleep scoring implemented for Zmax headband.
"""
#%% Reading EDF section
#####===================== Importiung libraries =========================#####
import mne
import numpy as np
from numpy import loadtxt
import h5py
impor... | 41.956693 | 137 | 0.569016 |
confusion_matrix, make_scorer, accuracy_score, precision_score, recall_score, f1_score, classification_report
import pandas as pd
import tensorflow as tf
from scipy import signal
' + str(c_subj)
tmp_x = subjects_dic[str_test_feat]
tmp_y = hyp_dic[str_test_hyp]
X_test ... | true | true |
790e003189116c711c7868ee0796c708fa30c31e | 692 | py | Python | FatherSon/HelloWorld2_source_code/Listing_19-1.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 1 | 2019-01-04T05:47:50.000Z | 2019-01-04T05:47:50.000Z | FatherSon/HelloWorld2_source_code/Listing_19-1.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | null | null | null | FatherSon/HelloWorld2_source_code/Listing_19-1.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | null | null | null | # Listing_19-1.py
# Copyright Warren & Carter Sande, 2013
# Released under MIT license http://www.opensource.org/licenses/mit-license.php
# Version $version ----------------------------
# Trying out sounds in Pygame
import pygame
pygame.init()
pygame.mixer.init()
screen = pygame.display.set_mode([640,480... | 30.086957 | 82 | 0.628613 |
import pygame
pygame.init()
pygame.mixer.init()
screen = pygame.display.set_mode([640,480])
pygame.time.delay(1000)
splat = pygame.mixer.Sound("splat.wav")
splat.play()
running = True
while running:
for event in pygame.event.get():
if event.type == py... | true | true |
790e00df749b9f39cf73a004cd46aaf2af4e6723 | 18,416 | py | Python | librosa/decompose.py | nehz/librosa | 0dcd53f462db124ed3f54edf2334f28738d2ecc6 | [
"ISC"
] | 2 | 2018-10-24T09:04:54.000Z | 2021-03-29T16:49:01.000Z | librosa/decompose.py | nehz/librosa | 0dcd53f462db124ed3f54edf2334f28738d2ecc6 | [
"ISC"
] | null | null | null | librosa/decompose.py | nehz/librosa | 0dcd53f462db124ed3f54edf2334f28738d2ecc6 | [
"ISC"
] | 2 | 2022-01-28T06:40:44.000Z | 2022-02-06T19:03:58.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Spectrogram decomposition
=========================
.. autosummary::
:toctree: generated/
decompose
hpss
nn_filter
"""
import numpy as np
import scipy.sparse
from scipy.ndimage import median_filter
import sklearn.decomposition
from . import core
fro... | 32.827094 | 91 | 0.587641 |
import numpy as np
import scipy.sparse
from scipy.ndimage import median_filter
import sklearn.decomposition
from . import core
from . import cache
from . import segment
from . import util
from .util.exceptions import ParameterError
__all__ = ['decompose', 'hpss', 'nn_filter']
def decompose(S, n_components=None... | true | true |
790e0144510fac1fbcd705569fa24982f6cb97db | 3,352 | py | Python | xjsonrpc/server/validators/pydantic.py | bernhardkaindl/pjrpc | 6e21534ee5a073315e805a911ae75cada4a81137 | [
"Unlicense"
] | 10 | 2020-03-15T06:41:58.000Z | 2022-03-17T08:55:53.000Z | xjsonrpc/server/validators/pydantic.py | bernhardkaindl/pjrpc | 6e21534ee5a073315e805a911ae75cada4a81137 | [
"Unlicense"
] | 41 | 2019-11-16T09:57:54.000Z | 2022-03-31T17:34:13.000Z | xjsonrpc/server/validators/pydantic.py | bernhardkaindl/pjrpc | 6e21534ee5a073315e805a911ae75cada4a81137 | [
"Unlicense"
] | 1 | 2022-03-17T08:21:28.000Z | 2022-03-17T08:21:28.000Z | import functools as ft
import inspect
from typing import Any, Callable, Dict, Iterable, List, Optional, Union
import pydantic
from . import base
class PydanticValidator(base.BaseValidator):
"""
Parameters validator based on `pydantic <https://pydantic-docs.helpmanual.io/>`_ library.
Uses python type ann... | 40.385542 | 118 | 0.654236 | import functools as ft
import inspect
from typing import Any, Callable, Dict, Iterable, List, Optional, Union
import pydantic
from . import base
class PydanticValidator(base.BaseValidator):
def __init__(self, coerce: bool = True, **config_args: Any):
self._coerce = coerce
config_args.setdefaul... | true | true |
790e030ef31dc13e50d1a930d050458132b0c2ea | 7,501 | py | Python | flux_param.py | aelkouk/rainfall_runoff | 7ab984c77abbef38c768fea9993b0cfecaca3e67 | [
"MIT"
] | null | null | null | flux_param.py | aelkouk/rainfall_runoff | 7ab984c77abbef38c768fea9993b0cfecaca3e67 | [
"MIT"
] | null | null | null | flux_param.py | aelkouk/rainfall_runoff | 7ab984c77abbef38c768fea9993b0cfecaca3e67 | [
"MIT"
] | null | null | null |
# Purpose: Calculate hydrological fluxes in the canopy, unsaturated and saturated sub-domains
# Record of revisions:
# Date Programmer Description of change
# ======== ============= =====================
# 09-2020 A. Elkouk Original code
# ------------------------------------------------... | 28.520913 | 121 | 0.557792 |
def calc_wetted_fraction(canopyStore, canopyStore_max, gamma):
if canopyStore < canopyStore_max:
wetFrac = (canopyStore / canopyStore_max) ** gamma
else:
wetFrac = 1.0
return wetFrac
def calc_canopy_evaporation(pet, wetFrac):
canopyEvap = pet * wetFrac
... | true | true |
790e0328786b1fd98594b1a19535e01ae6bcec3e | 573 | py | Python | convnet3d/layers/misc.py | yecharlie/convnet3d | 0b2771eec149b196ef59b58d09eef71c9b201d40 | [
"MIT"
] | 6 | 2020-03-12T10:28:41.000Z | 2021-11-18T16:17:20.000Z | convnet3d/layers/misc.py | yecharlie/convnet3d | 0b2771eec149b196ef59b58d09eef71c9b201d40 | [
"MIT"
] | null | null | null | convnet3d/layers/misc.py | yecharlie/convnet3d | 0b2771eec149b196ef59b58d09eef71c9b201d40 | [
"MIT"
] | 1 | 2019-08-01T02:50:05.000Z | 2019-08-01T02:50:05.000Z | import keras
import keras.backend as K
class Shape(keras.layers.Layer):
def call(self, inputs):
return K.shape(inputs)
def compute_output_shape(self, input_shape):
return (len(input_shape),)
class Cast(keras.layers.Layer):
def __init__(self, dtype, **kwargs):
self.dtype = dtype
... | 22.92 | 48 | 0.645724 | import keras
import keras.backend as K
class Shape(keras.layers.Layer):
def call(self, inputs):
return K.shape(inputs)
def compute_output_shape(self, input_shape):
return (len(input_shape),)
class Cast(keras.layers.Layer):
def __init__(self, dtype, **kwargs):
self.dtype = dtype
... | true | true |
790e03e4bd37269bbae332195207109b25e08b98 | 2,532 | py | Python | scripts/support/split_genomes.py | Rfam/rfam-production | 36f3963380da2a08e9cf73c951691c4e95738ac4 | [
"Apache-2.0"
] | 7 | 2016-06-17T09:21:11.000Z | 2021-10-13T20:25:06.000Z | support/split_genomes.py | mb1069/rfam-production | 10c76e249dc22d30862b3a873fd54f390e859ad8 | [
"Apache-2.0"
] | 82 | 2016-04-08T10:51:32.000Z | 2022-03-11T13:49:18.000Z | support/split_genomes.py | mb1069/rfam-production | 10c76e249dc22d30862b3a873fd54f390e859ad8 | [
"Apache-2.0"
] | 3 | 2019-09-01T09:46:35.000Z | 2021-11-29T08:01:58.000Z | import os
import sys
import shutil
import subprocess
from config import rfam_local as conf
from config import gen_config as gc
from utils import genome_search_utils as gsu
# ------------------------------------------------------------------------
def split_genome_to_chunks(updir, upid):
"""
updir:
upid... | 31.259259 | 82 | 0.557267 | import os
import sys
import shutil
import subprocess
from config import rfam_local as conf
from config import gen_config as gc
from utils import genome_search_utils as gsu
def split_genome_to_chunks(updir, upid):
"""
updir:
upid:
return:
"""
upid_fasta = os.path.join(updir, upid + '.... | false | true |
790e0404674c8530ff8eaac4431731c3de59a3d6 | 1,843 | py | Python | mslib/mscolab/_tests/test_utils.py | gisi90/MSS | a790499e54fe6e2023608701e939a921fd02dee0 | [
"Apache-2.0"
] | null | null | null | mslib/mscolab/_tests/test_utils.py | gisi90/MSS | a790499e54fe6e2023608701e939a921fd02dee0 | [
"Apache-2.0"
] | null | null | null | mslib/mscolab/_tests/test_utils.py | gisi90/MSS | a790499e54fe6e2023608701e939a921fd02dee0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
mslib.mscolab._tests.test_utils
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tests for mscolab/utils
This file is part of mss.
:copyright: Copyright 2019 Shivashis Padhi
:copyright: Copyright 2019-2020 by the mss team, see AUTHORS.
Licensed under the Apache License, Ver... | 33.509091 | 87 | 0.686923 |
from mslib.mscolab.server import db, APP, initialize_managers
from mslib.mscolab.models import User
from mslib.mscolab.utils import get_recent_pid
from mslib.mscolab.conf import mscolab_settings
from mslib.mscolab.mscolab import handle_db_seed
class Test_Utils(object):
def setup(self):
handle_db_seed()
... | true | true |
790e0407f77db6797cd355bcbc23b95400522672 | 1,645 | py | Python | torch_glow/tests/nodes/conv2d_test.py | enricoros/glow | 9066d4ab4f7fcfbfbbc1297a7706f7ed78dc891b | [
"Apache-2.0"
] | 2 | 2021-08-02T22:39:33.000Z | 2021-11-17T11:00:17.000Z | torch_glow/tests/nodes/conv2d_test.py | a1f/glow | 49cf6972ce0cb25cea66f9ed39d32add5eeef130 | [
"Apache-2.0"
] | null | null | null | torch_glow/tests/nodes/conv2d_test.py | a1f/glow | 49cf6972ce0cb25cea66f9ed39d32add5eeef130 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn.functional as F
import torch_glow
from collections import namedtuple
from tests.utils import jitVsGlow
# Basic test of the PyTorch conv2d Node on Glow.
def test_conv2d_basic():
def conv2d_basic(inputs, filters):
conv = F.conv2d(inputs, filters, padding=1)
return F.relu(... | 29.909091 | 163 | 0.677204 | import torch
import torch.nn.functional as F
import torch_glow
from collections import namedtuple
from tests.utils import jitVsGlow
def test_conv2d_basic():
def conv2d_basic(inputs, filters):
conv = F.conv2d(inputs, filters, padding=1)
return F.relu(conv)
inputs = torch.randn(1, 4, 5, 5)
filt... | true | true |
790e0584b8e5a83f684e876da3efae7fb30671d1 | 34,381 | py | Python | corehq/apps/sms/tests/test_phone_numbers.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 1 | 2020-07-14T13:00:23.000Z | 2020-07-14T13:00:23.000Z | corehq/apps/sms/tests/test_phone_numbers.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 94 | 2020-12-11T06:57:31.000Z | 2022-03-15T10:24:06.000Z | corehq/apps/sms/tests/test_phone_numbers.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | null | null | null | from datetime import datetime, timedelta
from django.test import TestCase
from mock import patch
from corehq.apps.domain.models import Domain
from corehq.apps.hqcase.utils import update_case
from corehq.apps.sms.mixin import PhoneNumberInUseException
from corehq.apps.sms.models import (
PhoneNumber,
SQLMobil... | 41.17485 | 111 | 0.666647 | from datetime import datetime, timedelta
from django.test import TestCase
from mock import patch
from corehq.apps.domain.models import Domain
from corehq.apps.hqcase.utils import update_case
from corehq.apps.sms.mixin import PhoneNumberInUseException
from corehq.apps.sms.models import (
PhoneNumber,
SQLMobil... | true | true |
790e06e38495bb0be9f9f830d21b0ae4d802b00d | 4,386 | py | Python | contrib/seeds/generate-seeds.py | binariumpay/binarium | f527bb1829c0ea5ebb4d713b00a2ea8353fc13fa | [
"MIT"
] | 24 | 2018-05-12T01:29:50.000Z | 2021-03-05T13:02:47.000Z | contrib/seeds/generate-seeds.py | binariumpay/binarium | f527bb1829c0ea5ebb4d713b00a2ea8353fc13fa | [
"MIT"
] | 4 | 2018-09-11T16:32:39.000Z | 2019-02-22T06:31:02.000Z | contrib/seeds/generate-seeds.py | binariumpay/binarium | f527bb1829c0ea5ebb4d713b00a2ea8353fc13fa | [
"MIT"
] | 10 | 2018-05-17T09:34:32.000Z | 2019-10-01T13:50:31.000Z | #!/usr/bin/env python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the directory... | 31.553957 | 98 | 0.582991 |
from __future__ import print_function, division
from base64 import b32decode
from binascii import a2b_hex
import sys, os
import re
pchIPv4 = bytearray([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff])
pchOnionCat = bytearray([0xFD,0x87,0xD8,0x7E,0xEB,0x43])
def name_to_ipv6(addr):
if len(addr)>6 and addr.endswith... | true | true |
790e07aec44be9d4fe5025463f80574ced0792e3 | 16,156 | py | Python | DiffractionClassifierCombinatorial2.0.py | MatthewGong/DiffractionClassification | 68be6cf3960f09388253c79bab13cbd9dc07edbb | [
"MIT"
] | null | null | null | DiffractionClassifierCombinatorial2.0.py | MatthewGong/DiffractionClassification | 68be6cf3960f09388253c79bab13cbd9dc07edbb | [
"MIT"
] | null | null | null | DiffractionClassifierCombinatorial2.0.py | MatthewGong/DiffractionClassification | 68be6cf3960f09388253c79bab13cbd9dc07edbb | [
"MIT"
] | null | null | null | import ClientSide2 #custom package
import numpy as np
import argparse
import json
import os
import ClassifierFunctions2 as cf
import random
import logging
from matplotlib import pyplot as plt
from builtins import input
from Notation import SpaceGroupsDict as spgs
SpGr = spgs.spacegroups()
from itertools import co... | 36.224215 | 203 | 0.590121 | import ClientSide2
import numpy as np
import argparse
import json
import os
import ClassifierFunctions2 as cf
import random
import logging
from matplotlib import pyplot as plt
from builtins import input
from Notation import SpaceGroupsDict as spgs
SpGr = spgs.spacegroups()
from itertools import combinations,chai... | true | true |
790e082c63165426a7ac60263e8c58bd75754c64 | 2,006 | py | Python | tests/test_api.py | prtkv/biathlonresults | 0910322c29ad8dd7612d36e1d9914277ee48c336 | [
"MIT"
] | 7 | 2020-01-23T09:25:24.000Z | 2022-03-05T13:43:03.000Z | tests/test_api.py | prtkv/biathlonresults | 0910322c29ad8dd7612d36e1d9914277ee48c336 | [
"MIT"
] | null | null | null | tests/test_api.py | prtkv/biathlonresults | 0910322c29ad8dd7612d36e1d9914277ee48c336 | [
"MIT"
] | 2 | 2020-08-24T18:42:39.000Z | 2022-01-27T10:19:37.000Z | import biathlonresults as api
def test_cups():
res = api.cups(1819)
assert isinstance(res, list)
assert len(res) == 37
def test_cup_results():
res = api.cup_results("BT1819SWRLCP__SMTS")
assert isinstance(res, dict)
assert isinstance(res["Rows"], list)
assert res["Rows"][0]["Name"] == "B... | 27.479452 | 64 | 0.649053 | import biathlonresults as api
def test_cups():
res = api.cups(1819)
assert isinstance(res, list)
assert len(res) == 37
def test_cup_results():
res = api.cup_results("BT1819SWRLCP__SMTS")
assert isinstance(res, dict)
assert isinstance(res["Rows"], list)
assert res["Rows"][0]["Name"] == "B... | true | true |
790e088d126ecd746c50545a8644616f0f0f746e | 9,297 | py | Python | lspeas/analysis/stent_migration.py | almarklein/stentseg | 48255fffdc2394d1dc4ce2208c9a91e1d4c35a46 | [
"BSD-3-Clause"
] | 1 | 2020-08-28T16:34:10.000Z | 2020-08-28T16:34:10.000Z | lspeas/analysis/stent_migration.py | almarklein/stentseg | 48255fffdc2394d1dc4ce2208c9a91e1d4c35a46 | [
"BSD-3-Clause"
] | null | null | null | lspeas/analysis/stent_migration.py | almarklein/stentseg | 48255fffdc2394d1dc4ce2208c9a91e1d4c35a46 | [
"BSD-3-Clause"
] | 1 | 2021-04-25T06:59:36.000Z | 2021-04-25T06:59:36.000Z | """ Measure stent migration relative to renals
Option to visualize 2 longitudinal scans
"""
import sys, os
import visvis as vv
from stentseg.utils.datahandling import select_dir, loadvol, loadmodel, loadmesh
from stentseg.stentdirect.stentgraph import create_mesh
from stentseg.utils.visualization import show_ctvolume
f... | 40.776316 | 136 | 0.713994 | import sys, os
import visvis as vv
from stentseg.utils.datahandling import select_dir, loadvol, loadmodel, loadmesh
from stentseg.stentdirect.stentgraph import create_mesh
from stentseg.utils.visualization import show_ctvolume
from stentseg.utils import _utils_GUI, PointSet
from stentseg.utils.picker import pick3d
from... | true | true |
790e08c0aa1a381aa0bc42733bf546e522788fcf | 1,322 | py | Python | issues/models.py | mariofix/svsagro | 7eb05e59128ee8ccdab00c2945bfa74d4090b466 | [
"MIT"
] | null | null | null | issues/models.py | mariofix/svsagro | 7eb05e59128ee8ccdab00c2945bfa74d4090b466 | [
"MIT"
] | null | null | null | issues/models.py | mariofix/svsagro | 7eb05e59128ee8ccdab00c2945bfa74d4090b466 | [
"MIT"
] | null | null | null | from svs.models import Customer
from django.db import models
from django.utils import timezone
from svs.models import Customer, Machine
from core.models import CoreUser
from markdownx.models import MarkdownxField
STATUSES = (
("pending_our", "Pending - Our Side"),
("pending_their", "Pending - Their Side"),
... | 30.744186 | 75 | 0.715582 | from svs.models import Customer
from django.db import models
from django.utils import timezone
from svs.models import Customer, Machine
from core.models import CoreUser
from markdownx.models import MarkdownxField
STATUSES = (
("pending_our", "Pending - Our Side"),
("pending_their", "Pending - Their Side"),
... | true | true |
790e090aa563b12ea93463b7f3475dec12766fb1 | 5,379 | py | Python | stancode_project/baby_names/babygraphics.py | beomgyutxt/stanCode_project | 6e1e09b40c2104e98c0cf97478fbec0e345be21b | [
"MIT"
] | null | null | null | stancode_project/baby_names/babygraphics.py | beomgyutxt/stanCode_project | 6e1e09b40c2104e98c0cf97478fbec0e345be21b | [
"MIT"
] | null | null | null | stancode_project/baby_names/babygraphics.py | beomgyutxt/stanCode_project | 6e1e09b40c2104e98c0cf97478fbec0e345be21b | [
"MIT"
] | null | null | null | """
SC101 Baby Names Project
Adapted from Nick Parlante's Baby Names assignment by
Jerry Liao.
YOUR DESCRIPTION HERE
"""
import tkinter
import babynames
import babygraphicsgui as gui
FILENAMES = [
'data/full/baby-1900.txt', 'data/full/baby-1910.txt',
'data/full/baby-1920.txt', 'data/full/baby-1930.txt',
... | 35.86 | 112 | 0.636178 |
import tkinter
import babynames
import babygraphicsgui as gui
FILENAMES = [
'data/full/baby-1900.txt', 'data/full/baby-1910.txt',
'data/full/baby-1920.txt', 'data/full/baby-1930.txt',
'data/full/baby-1940.txt', 'data/full/baby-1950.txt',
'data/full/baby-1960.txt', 'data/full/baby-1970.txt',
'data/... | true | true |
790e0a0b65973504adceb349cc0ba8538aa2567b | 2,449 | py | Python | nih/loader.py | edupooch/cxr-domain-shift | 9e88f82e3d42f660e9f79723adb8a733d0a0e5e3 | [
"Apache-2.0"
] | 1 | 2019-11-17T19:08:48.000Z | 2019-11-17T19:08:48.000Z | nih/loader.py | edupooch/cxr-domain-shift | 9e88f82e3d42f660e9f79723adb8a733d0a0e5e3 | [
"Apache-2.0"
] | null | null | null | nih/loader.py | edupooch/cxr-domain-shift | 9e88f82e3d42f660e9f79723adb8a733d0a0e5e3 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import numpy as np
from torch.utils.data import Dataset
import os
from PIL import Image
class CXRDataset(Dataset):
def __init__(
self,
path_to_images,
fold,
transform=None,
sample=0,
finding="any",):
self.transfo... | 31 | 113 | 0.518987 | import pandas as pd
import numpy as np
from torch.utils.data import Dataset
import os
from PIL import Image
class CXRDataset(Dataset):
def __init__(
self,
path_to_images,
fold,
transform=None,
sample=0,
finding="any",):
self.transfo... | true | true |
790e0a12961861e69d4eb75fa9db8e9aff53a130 | 1,099 | py | Python | src/atcoder/dp/q/sol_4.py | kagemeka/competitive-programming | c70fe481bcd518f507b885fc9234691d8ce63171 | [
"MIT"
] | 1 | 2021-07-11T03:20:10.000Z | 2021-07-11T03:20:10.000Z | src/atcoder/dp/q/sol_4.py | kagemeka/competitive-programming | c70fe481bcd518f507b885fc9234691d8ce63171 | [
"MIT"
] | 39 | 2021-07-10T05:21:09.000Z | 2021-12-15T06:10:12.000Z | src/atcoder/dp/q/sol_4.py | kagemeka/competitive-programming | c70fe481bcd518f507b885fc9234691d8ce63171 | [
"MIT"
] | null | null | null | import typing
import sys
import numpy as np
def set_val(
a: np.array,
i: int,
x: int,
) -> typing.NoReturn:
while i < a.size:
a[i] = max(a[i], x)
i += i & -i
def get_mx(
a: np.array,
i: int,
) -> int:
mx = 0
while i > 0:
mx = max(mx, a[i])
i -= i & -i
return mx
def solve(
... | 13.7375 | 31 | 0.535032 | import typing
import sys
import numpy as np
def set_val(
a: np.array,
i: int,
x: int,
) -> typing.NoReturn:
while i < a.size:
a[i] = max(a[i], x)
i += i & -i
def get_mx(
a: np.array,
i: int,
) -> int:
mx = 0
while i > 0:
mx = max(mx, a[i])
i -= i & -i
return mx
def solve(
... | true | true |
790e0a5e8648b11550e56f5728f6b2ed76bfdb21 | 34 | py | Python | convore/__init__.py | kennethreitz-archive/python-convore | fcf1917a3c07441712a089500ca710abfcf81ad6 | [
"0BSD"
] | 2 | 2016-03-01T22:15:41.000Z | 2016-07-17T18:10:17.000Z | convore/__init__.py | colekowalski/python-convore | 77f4b3dfd50b710729839d0e9481a1a37b0cbd75 | [
"0BSD"
] | null | null | null | convore/__init__.py | colekowalski/python-convore | 77f4b3dfd50b710729839d0e9481a1a37b0cbd75 | [
"0BSD"
] | null | null | null | from core import *
import packages | 17 | 18 | 0.823529 | from core import *
import packages | true | true |
790e0abc1b375c170241b587ccd08f6c0ca72a1e | 454 | py | Python | gram/migrations/0005_auto_20190310_1523.py | viisualworks/instanoir | e1ab476b61b1cdb1abc7546ef06de51579b8f24e | [
"MIT"
] | null | null | null | gram/migrations/0005_auto_20190310_1523.py | viisualworks/instanoir | e1ab476b61b1cdb1abc7546ef06de51579b8f24e | [
"MIT"
] | 1 | 2021-09-08T00:51:50.000Z | 2021-09-08T00:51:50.000Z | gram/migrations/0005_auto_20190310_1523.py | viisualworks/instanoir | e1ab476b61b1cdb1abc7546ef06de51579b8f24e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-03-10 12:23
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gram', '0004_auto_20190310_1510'),
]
operations = [
migrations.AlterField(
... | 21.619048 | 58 | 0.614537 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gram', '0004_auto_20190310_1510'),
]
operations = [
migrations.AlterField(
model_name='image',
name='comment',
... | true | true |
790e0b4a985eb831926bb97e4f587081aa98a586 | 837 | py | Python | CtCI_custom_classes/overflow_stack.py | enyquist/Cracking_the_Coding_Interview | 3247ad7b349f728c83ec5d3f452a7dce34d6d50c | [
"MIT"
] | null | null | null | CtCI_custom_classes/overflow_stack.py | enyquist/Cracking_the_Coding_Interview | 3247ad7b349f728c83ec5d3f452a7dce34d6d50c | [
"MIT"
] | null | null | null | CtCI_custom_classes/overflow_stack.py | enyquist/Cracking_the_Coding_Interview | 3247ad7b349f728c83ec5d3f452a7dce34d6d50c | [
"MIT"
] | null | null | null | from CtCI_Custom_Classes.stack import Stack
class SetOfStacks:
def __init__(self, capacity):
self.capacity = capacity
self.stacks = []
def get_last_stack(self):
if not self.stacks:
return None
return self.stacks[-1]
def is_empty(self):
last = self.get_... | 23.914286 | 43 | 0.551971 | from CtCI_Custom_Classes.stack import Stack
class SetOfStacks:
def __init__(self, capacity):
self.capacity = capacity
self.stacks = []
def get_last_stack(self):
if not self.stacks:
return None
return self.stacks[-1]
def is_empty(self):
last = self.get_... | true | true |
790e0ba2d5067ba9776aa3c41a6f454ad345e441 | 3,177 | py | Python | resources/src/mythbox/mythtv/publish.py | bopopescu/ServerStatus | a883598248ad6f5273eb3be498e3b04a1fab6510 | [
"MIT"
] | null | null | null | resources/src/mythbox/mythtv/publish.py | bopopescu/ServerStatus | a883598248ad6f5273eb3be498e3b04a1fab6510 | [
"MIT"
] | 1 | 2015-04-21T22:05:02.000Z | 2015-04-22T22:27:15.000Z | resources/src/mythbox/mythtv/publish.py | GetSomeBlocks/Score_Soccer | a883598248ad6f5273eb3be498e3b04a1fab6510 | [
"MIT"
] | 2 | 2015-09-29T16:31:43.000Z | 2020-07-26T03:41:10.000Z | #
# MythBox for XBMC - http://mythbox.googlecode.com
# Copyright (C) 2011 analogue@yahoo.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at yo... | 38.277108 | 144 | 0.627951 |
import logging
import xbmc
from mythbox.bus import Event
from mythbox.util import run_async
from mythbox.mythtv.conn import EventConnection, inject_conn
log = logging.getLogger('mythbox.core')
class MythEventPublisher(object):
d... | false | true |
790e0c7056763bda123b6710f702fca2952e4e53 | 9,151 | py | Python | statsmodels/sandbox/regression/try_ols_anova.py | toobaz/statsmodels | 5286dd713a809b0630232508bf9ad5104aae1980 | [
"BSD-3-Clause"
] | 10 | 2016-05-18T11:46:33.000Z | 2018-12-23T04:52:27.000Z | statsmodels/sandbox/regression/try_ols_anova.py | AnaMP/statsmodels | 2d4aad9a14619ce0c84d4c7bca9dacd66b2be566 | [
"BSD-3-Clause"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | statsmodels/sandbox/regression/try_ols_anova.py | AnaMP/statsmodels | 2d4aad9a14619ce0c84d4c7bca9dacd66b2be566 | [
"BSD-3-Clause"
] | 3 | 2015-04-01T08:26:54.000Z | 2020-02-14T14:34:10.000Z | ''' convenience functions for ANOVA type analysis with OLS
Note: statistical results of ANOVA are not checked, OLS is
checked but not whether the reported results are the ones used
in ANOVA
includes form2design for creating dummy variables
TODO:
* ...
*
'''
import numpy as np
#from scipy import stats
import sta... | 31.774306 | 101 | 0.605289 | ''' convenience functions for ANOVA type analysis with OLS
Note: statistical results of ANOVA are not checked, OLS is
checked but not whether the reported results are the ones used
in ANOVA
includes form2design for creating dummy variables
TODO:
* ...
*
'''
import numpy as np
import statsmodels.api as sm
def ... | false | true |
790e0ce0cd33314e6bd660016ad994d3cc52b9e7 | 154,790 | py | Python | cmdx.py | fvbehr/cmdx | d2203e8eee51857b6e1bb1ed175d0ff928854c47 | [
"BSD-2-Clause"
] | null | null | null | cmdx.py | fvbehr/cmdx | d2203e8eee51857b6e1bb1ed175d0ff928854c47 | [
"BSD-2-Clause"
] | null | null | null | cmdx.py | fvbehr/cmdx | d2203e8eee51857b6e1bb1ed175d0ff928854c47 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import sys
import json
import time
import math
import types
import logging
import traceback
import operator
import collections
from functools import wraps
from maya import cmds
from maya.api import OpenMaya as om, OpenMayaAnim as oma, OpenMayaUI as omui
from maya import OpenMaya as o... | 27.488901 | 84 | 0.553472 |
import os
import sys
import json
import time
import math
import types
import logging
import traceback
import operator
import collections
from functools import wraps
from maya import cmds
from maya.api import OpenMaya as om, OpenMayaAnim as oma, OpenMayaUI as omui
from maya import OpenMaya as om1, OpenMayaMPx as ompx... | true | true |
790e0ce2f08f084c7a447e3f2a97c3bf8f907996 | 1,020 | py | Python | py/parse_sort_objects.py | rckmnt/How-Big-Is-A-Thing- | 48d723c8410e5014e234a979cabcf77a05b18393 | [
"MIT"
] | null | null | null | py/parse_sort_objects.py | rckmnt/How-Big-Is-A-Thing- | 48d723c8410e5014e234a979cabcf77a05b18393 | [
"MIT"
] | null | null | null | py/parse_sort_objects.py | rckmnt/How-Big-Is-A-Thing- | 48d723c8410e5014e234a979cabcf77a05b18393 | [
"MIT"
] | null | null | null | # parse list of objects
import csv
file = "basic_objects.txt"
objects = []
with open(file) as f:
for line in f:
if line[0:2] == '//' or line[0:2] == None: # skip empties, comments
pass
else:
obj = line.rstrip() # strip Newli... | 30 | 91 | 0.523529 |
import csv
file = "basic_objects.txt"
objects = []
with open(file) as f:
for line in f:
if line[0:2] == '//' or line[0:2] == None:
pass
else:
obj = line.rstrip()
obj = obj.capitalize()
o = [o.capita... | true | true |
790e0cfb98cd34babc58558cceb42f5a63791c4b | 840 | py | Python | Python learnings/Django projects/learning_users/basic_app/models.py | warpalatino/public | f04ce183799bcdd2fb8dc376d41d286314c19460 | [
"MIT"
] | 1 | 2021-01-04T10:37:16.000Z | 2021-01-04T10:37:16.000Z | Python learnings/Django projects/learning_users/basic_app/models.py | warpalatino/public | f04ce183799bcdd2fb8dc376d41d286314c19460 | [
"MIT"
] | null | null | null | Python learnings/Django projects/learning_users/basic_app/models.py | warpalatino/public | f04ce183799bcdd2fb8dc376d41d286314c19460 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
# Which data the user already has:
# SuperUserInformation
# User: Jose
# Email: training@pieriandata.com
# Password: testpassword
# Create your models here.
class UserProfileInfo(models.Model):
# Create relationship (don't inherit... | 33.6 | 92 | 0.717857 | from django.db import models
from django.contrib.auth.models import User
class UserProfileInfo(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
# Add any additional attributes to the user you want
portfolio_site = models.URLField(blank=True)
# pip insta... | true | true |
790e0d697f3464551928b67195f4c0d850b6829c | 7,240 | py | Python | mxfusion/components/distributions/gp/kernels/static.py | JeremiasKnoblauch/MXFusion | af6223e9636b055d029d136dd7ae023b210b4560 | [
"Apache-2.0"
] | 2 | 2019-05-31T09:50:47.000Z | 2021-03-06T09:38:47.000Z | mxfusion/components/distributions/gp/kernels/static.py | JeremiasKnoblauch/MXFusion | af6223e9636b055d029d136dd7ae023b210b4560 | [
"Apache-2.0"
] | null | null | null | mxfusion/components/distributions/gp/kernels/static.py | JeremiasKnoblauch/MXFusion | af6223e9636b055d029d136dd7ae023b210b4560 | [
"Apache-2.0"
] | 1 | 2019-05-30T09:39:46.000Z | 2019-05-30T09:39:46.000Z | # Copyright 2018 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://www.apache.org/licenses/LICENSE-2.0
#
# or in th... | 43.878788 | 110 | 0.618785 |
from .kernel import NativeKernel
from ....variables import Variable
from ....variables import PositiveTransformation
from .....util.customop import broadcast_to_w_samples
class Bias(NativeKernel):
broadcastable = True
def __init__(self, input_dim, variance=1., name='bias', active_dims=None,
... | true | true |
790e0d94f216908823fa654ecbd8eaa6320f382c | 54 | py | Python | Crypto-babyFibo/ans/secret.py | scnu-sloth/hsctf-2021-freshmen | 251d3e9d13e0d430eb5b76775acde519648b401f | [
"MIT"
] | null | null | null | Crypto-babyFibo/ans/secret.py | scnu-sloth/hsctf-2021-freshmen | 251d3e9d13e0d430eb5b76775acde519648b401f | [
"MIT"
] | null | null | null | Crypto-babyFibo/ans/secret.py | scnu-sloth/hsctf-2021-freshmen | 251d3e9d13e0d430eb5b76775acde519648b401f | [
"MIT"
] | 1 | 2021-11-26T14:35:18.000Z | 2021-11-26T14:35:18.000Z | flag = b'HSCTF{1d9cb42f-3302-46f3-a3a7-0ca30d631cc9}'
| 27 | 53 | 0.777778 | flag = b'HSCTF{1d9cb42f-3302-46f3-a3a7-0ca30d631cc9}'
| true | true |
790e0dd71afd4d196424463192f46a938c992ed8 | 9,694 | py | Python | baseline/fast_rcnn/trainer.py | ITMO-NSS-team/LightObjRecEnsembler | 1375400f0a681aefdd3ab484e828257fd7aed318 | [
"BSD-3-Clause"
] | 4 | 2021-07-01T14:04:47.000Z | 2022-03-05T08:31:40.000Z | baseline/fast_rcnn/trainer.py | ITMO-NSS-team/LightObjRecEnsembler | 1375400f0a681aefdd3ab484e828257fd7aed318 | [
"BSD-3-Clause"
] | 3 | 2021-09-10T14:13:42.000Z | 2021-10-05T11:35:07.000Z | baseline/fast_rcnn/trainer.py | ITMO-NSS-team/LightObjRecEnsembler | 1375400f0a681aefdd3ab484e828257fd7aed318 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import os
from collections import namedtuple
import time
from torch.nn import functional as F
from baseline.fast_rcnn.model.utils.creator_tool import AnchorTargetCreator, ProposalTargetCreator
from torch import nn
import torch as t
from baseline.fast_rcnn.utils import array_tool ... | 36.859316 | 98 | 0.611925 | from __future__ import absolute_import
import os
from collections import namedtuple
import time
from torch.nn import functional as F
from baseline.fast_rcnn.model.utils.creator_tool import AnchorTargetCreator, ProposalTargetCreator
from torch import nn
import torch as t
from baseline.fast_rcnn.utils import array_tool ... | true | true |
790e10b0d40c66a21974d20243262ab18d5737d9 | 2,865 | py | Python | caixa/profile/tagged.py | wstlabs/caixa | 7ce02640598a4261202196089a6bd1df8a9da344 | [
"Apache-2.0"
] | null | null | null | caixa/profile/tagged.py | wstlabs/caixa | 7ce02640598a4261202196089a6bd1df8a9da344 | [
"Apache-2.0"
] | null | null | null | caixa/profile/tagged.py | wstlabs/caixa | 7ce02640598a4261202196089a6bd1df8a9da344 | [
"Apache-2.0"
] | null | null | null | from collections import defaultdict
from typing import Dict, Tuple, Iterator, Callable, Any, Optional
from dataclasses import dataclass
"""
Provides the `TaggedProfiler` class related to record profiling.
TODO: Better description needed.
"""
@dataclass
class TaggedProfilerRecordStatus:
offset: int
tag: str
... | 37.697368 | 126 | 0.614311 | from collections import defaultdict
from typing import Dict, Tuple, Iterator, Callable, Any, Optional
from dataclasses import dataclass
@dataclass
class TaggedProfilerRecordStatus:
offset: int
tag: str
key: str
val: Any
r: Optional[dict]
@dataclass
class TaggedProfilerSummary:
total: int
... | true | true |
790e112c634a67bcfd0bab2618f347216d424567 | 46,580 | py | Python | lib-python/modified-2.5.2/pickle.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | 1 | 2019-05-27T00:58:46.000Z | 2019-05-27T00:58:46.000Z | lib-python/modified-2.5.2/pickle.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null | lib-python/modified-2.5.2/pickle.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null | """Create portable serialized representations of Python objects.
See module cPickle for a (much) faster implementation.
See module copy_reg for a mechanism for registering custom picklers.
See module pickletools source for extensive comments.
Classes:
Pickler
Unpickler
Functions:
dump(object, file)
... | 32.437326 | 80 | 0.557793 | """Create portable serialized representations of Python objects.
See module cPickle for a (much) faster implementation.
See module copy_reg for a mechanism for registering custom picklers.
See module pickletools source for extensive comments.
Classes:
Pickler
Unpickler
Functions:
dump(object, file)
... | false | true |
790e1310d068ec75c2fa665636158e6e3a5e3abd | 5,886 | py | Python | Modules/Gekokujo_vanilla_enhanced/Code/Module_system/modmerger_header.py | roalyr/gekokujo_vanilla_enhanced | 84d8cc1033be98357ac139fafbc1c10851274019 | [
"MIT"
] | 1 | 2021-01-17T06:21:36.000Z | 2021-01-17T06:21:36.000Z | Modules/Gekokujo_vanilla_enhanced/Code/Module_system/modmerger_header.py | roalyr/gekokujo_vanilla_enhanced | 84d8cc1033be98357ac139fafbc1c10851274019 | [
"MIT"
] | 2 | 2021-01-17T12:57:37.000Z | 2021-02-08T02:16:45.000Z | Modules/Gekokujo_vanilla_enhanced/Code/Module_system/modmerger_header.py | roalyr/gekokujo_vanilla_enhanced | 84d8cc1033be98357ac139fafbc1c10851274019 | [
"MIT"
] | null | null | null | # modmerger framework
# by sphere
modmerger_version = 201
# Note: the following is from Warband 1.127 module system.
from modmerger_options import *
# list of current module components
# not in use atm
mod_components = [
"animations",
"constants",
"dialogs",
"factions",
"game_m... | 29.577889 | 136 | 0.663099 |
modmerger_version = 201
from modmerger_options import *
mod_components = [
"animations",
"constants",
"dialogs",
"factions",
"game_menus",
"info",
"info_pages",
"items",
"map_icons",
"meshes",
"mission_templates",
"music",
"particle_syste... | true | true |
790e132404ed50d08b1244917c18bfcaf513277d | 568 | py | Python | wetterdienst/util/parameter.py | meteoDaniel/wetterdienst | 106a2fa9f887983281a6886c15bb3a845850dfb7 | [
"MIT"
] | 3 | 2020-06-19T09:21:07.000Z | 2020-06-30T22:12:42.000Z | wetterdienst/util/parameter.py | meteoDaniel/wetterdienst | 106a2fa9f887983281a6886c15bb3a845850dfb7 | [
"MIT"
] | 27 | 2020-06-17T23:10:37.000Z | 2020-07-01T22:05:17.000Z | wetterdienst/util/parameter.py | meteoDaniel/wetterdienst | 106a2fa9f887983281a6886c15bb3a845850dfb7 | [
"MIT"
] | 1 | 2020-06-22T22:37:45.000Z | 2020-06-22T22:37:45.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2018-2021, earthobservations developers.
# Distributed under the MIT License. See LICENSE for more info.
class _GetAttrMeta(type):
# https://stackoverflow.com/questions/33727217/subscriptable-objects-in-class
def __getitem__(cls, x):
return getattr(cls, x)
de... | 31.555556 | 81 | 0.672535 |
class _GetAttrMeta(type):
def __getitem__(cls, x):
return getattr(cls, x)
def __iter__(cls):
for attr in vars(cls):
if not attr.startswith("_"):
yield cls[attr]
class DatasetTreeCore(metaclass=_GetAttrMeta):
pass
| true | true |
790e136eafc8c8f7d463b00694cbbbb6e567b49b | 1,383 | py | Python | src/util/load_sentence.py | lychyzclc/High-throughput-relation-extraction-algorithm | 93530ddcb78df3f1b1b7fda34821fa307d095c74 | [
"MIT"
] | 1 | 2021-01-04T03:15:50.000Z | 2021-01-04T03:15:50.000Z | src/util/load_sentence.py | lychyzclc/High-throughput-relation-extraction-algorithm | 93530ddcb78df3f1b1b7fda34821fa307d095c74 | [
"MIT"
] | null | null | null | src/util/load_sentence.py | lychyzclc/High-throughput-relation-extraction-algorithm | 93530ddcb78df3f1b1b7fda34821fa307d095c74 | [
"MIT"
] | null | null | null | #!/bin/python
"""
This is a class for loading input sentences
"""
class SentenceAttr:
def __init__(self, attr_list):
self.article_id = attr_list[1]
self.title = attr_list[2]
self.sentence = attr_list[3]
self.article_structure = attr_list[4]
self.place = attr_list[5]
de... | 24.263158 | 102 | 0.54953 |
class SentenceAttr:
def __init__(self, attr_list):
self.article_id = attr_list[1]
self.title = attr_list[2]
self.sentence = attr_list[3]
self.article_structure = attr_list[4]
self.place = attr_list[5]
def __str__(self):
return "Article Id: " + self.article_id ... | true | true |
790e1487aaf6274b3e5915514fb45a95f0156ce1 | 3,349 | py | Python | micromamba/tests/test_constructor.py | wulmer/mamba | 5961d76afdd8b0f070bf0f2da396ef25289c965c | [
"BSD-3-Clause"
] | 2,262 | 2020-09-08T07:46:35.000Z | 2022-03-31T21:11:35.000Z | micromamba/tests/test_constructor.py | wulmer/mamba | 5961d76afdd8b0f070bf0f2da396ef25289c965c | [
"BSD-3-Clause"
] | 841 | 2020-09-07T15:22:43.000Z | 2022-03-31T18:18:43.000Z | micromamba/tests/test_constructor.py | wulmer/mamba | 5961d76afdd8b0f070bf0f2da396ef25289c965c | [
"BSD-3-Clause"
] | 132 | 2020-09-10T03:05:45.000Z | 2022-03-29T12:32:47.000Z | import glob
import json
import os
import shutil
import subprocess
from .helpers import *
def constructor(*args, default_channel=True, no_rc=True, no_dry_run=False):
umamba = get_umamba()
cmd = [umamba, "constructor"] + [arg for arg in args if arg]
try:
res = subprocess.check_output(cmd)
... | 34.173469 | 84 | 0.59779 | import glob
import json
import os
import shutil
import subprocess
from .helpers import *
def constructor(*args, default_channel=True, no_rc=True, no_dry_run=False):
umamba = get_umamba()
cmd = [umamba, "constructor"] + [arg for arg in args if arg]
try:
res = subprocess.check_output(cmd)
... | true | true |
790e1536aa8ba9f68a72fdec36fac8cfb0962a8d | 330 | py | Python | test/src/lib/idol/py_mar/all/target/optional_method.py | lyric-com/idol | 285005e9ddaa92b2284b7e9c28cd12f1e34746ec | [
"MIT"
] | null | null | null | test/src/lib/idol/py_mar/all/target/optional_method.py | lyric-com/idol | 285005e9ddaa92b2284b7e9c28cd12f1e34746ec | [
"MIT"
] | 2 | 2020-03-24T18:03:10.000Z | 2020-03-31T10:41:56.000Z | test/src/lib/idol/py_mar/all/target/optional_method.py | lyric-com/idol | 285005e9ddaa92b2284b7e9c28cd12f1e34746ec | [
"MIT"
] | null | null | null | # This file was scaffold by idol_mar, but it will not be overwritten, so feel free to edit.
# This file will be regenerated if you delete it.
from ...codegen.all.target.optional_method import (
AllTargetOptionalMethodSchema as OptionalMethodSchemaCodegen,
)
class OptionalMethodSchema(OptionalMethodSchemaCodegen):... | 33 | 91 | 0.79697 |
from ...codegen.all.target.optional_method import (
AllTargetOptionalMethodSchema as OptionalMethodSchemaCodegen,
)
class OptionalMethodSchema(OptionalMethodSchemaCodegen):
pass
| true | true |
790e15665d118e607ee6fb42f3600960688f5338 | 219 | py | Python | src/python/WMCore/WMBS/Oracle/JobGroup/Exists.py | khurtado/WMCore | f74e252412e49189a92962945a94f93bec81cd1e | [
"Apache-2.0"
] | 21 | 2015-11-19T16:18:45.000Z | 2021-12-02T18:20:39.000Z | src/python/WMCore/WMBS/Oracle/JobGroup/Exists.py | khurtado/WMCore | f74e252412e49189a92962945a94f93bec81cd1e | [
"Apache-2.0"
] | 5,671 | 2015-01-06T14:38:52.000Z | 2022-03-31T22:11:14.000Z | src/python/WMCore/WMBS/Oracle/JobGroup/Exists.py | khurtado/WMCore | f74e252412e49189a92962945a94f93bec81cd1e | [
"Apache-2.0"
] | 67 | 2015-01-21T15:55:38.000Z | 2022-02-03T19:53:13.000Z | #!/usr/bin/env python
"""
_Exists_
Oracle implementation of JobGroup.Exists
"""
__all__ = []
from WMCore.WMBS.MySQL.JobGroup.Exists import Exists as ExistsJobGroupMySQL
class Exists(ExistsJobGroupMySQL):
pass
| 13.6875 | 75 | 0.757991 |
__all__ = []
from WMCore.WMBS.MySQL.JobGroup.Exists import Exists as ExistsJobGroupMySQL
class Exists(ExistsJobGroupMySQL):
pass
| true | true |
790e156e6fcdfcc6193771a8f0462b9a233f5e2e | 509 | py | Python | extra_tests/snippets/encoding.py | mainsail-org/RustPython | 5d2d87c24f1ff7201fcc8d4fcffadb0ec12dc127 | [
"CC-BY-4.0",
"MIT"
] | 11,058 | 2018-05-29T07:40:06.000Z | 2022-03-31T11:38:42.000Z | extra_tests/snippets/encoding.py | mainsail-org/RustPython | 5d2d87c24f1ff7201fcc8d4fcffadb0ec12dc127 | [
"CC-BY-4.0",
"MIT"
] | 2,105 | 2018-06-01T10:07:16.000Z | 2022-03-31T14:56:42.000Z | extra_tests/snippets/encoding.py | mainsail-org/RustPython | 5d2d87c24f1ff7201fcc8d4fcffadb0ec12dc127 | [
"CC-BY-4.0",
"MIT"
] | 914 | 2018-07-27T09:36:14.000Z | 2022-03-31T19:56:34.000Z | from testutils import assert_raises
try:
b" \xff".decode("ascii")
except UnicodeDecodeError as e:
assert e.start == 3
assert e.end == 4
else:
assert False, "should have thrown UnicodeDecodeError"
assert_raises(UnicodeEncodeError, "¿como estás?".encode, "ascii")
def round_trip(s, encoding="utf-8"):... | 24.238095 | 66 | 0.667976 | from testutils import assert_raises
try:
b" \xff".decode("ascii")
except UnicodeDecodeError as e:
assert e.start == 3
assert e.end == 4
else:
assert False, "should have thrown UnicodeDecodeError"
assert_raises(UnicodeEncodeError, "¿como estás?".encode, "ascii")
def round_trip(s, encoding="utf-8"):... | true | true |
790e17e8c0da2027ad0cb511c168c353056583aa | 4,163 | py | Python | pywikibot/titletranslate.py | jkjkjkjkjk/pywikibot-core | f3748c95ea694083ae00534973d0d1dd018a5b43 | [
"MIT"
] | 2 | 2017-06-19T16:48:34.000Z | 2017-07-07T14:15:28.000Z | pywikibot/titletranslate.py | jkjkjkjkjk/pywikibot-core | f3748c95ea694083ae00534973d0d1dd018a5b43 | [
"MIT"
] | 11 | 2018-12-07T18:20:05.000Z | 2022-03-11T23:12:42.000Z | pywikibot/titletranslate.py | jkjkjkjkjk/pywikibot-core | f3748c95ea694083ae00534973d0d1dd018a5b43 | [
"MIT"
] | 3 | 2018-12-09T10:18:35.000Z | 2020-09-12T13:50:14.000Z | # -*- coding: utf-8 -*-
"""Title translate module."""
#
# (C) Rob W.W. Hooft, 2003
# (C) Yuri Astrakhan, 2005
# (C) Pywikibot team, 2003-2015
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
__version__ = '$Id: 790e17e8c0da2027ad0cb511c168c353056583aa $'
#... | 37.504505 | 77 | 0.515974 |
from __future__ import absolute_import, unicode_literals
__version__ = '$Id: 790e17e8c0da2027ad0cb511c168c353056583aa $'
import re
import pywikibot
import pywikibot.date as date
from pywikibot import config
from pywikibot.tools import deprecated_args
@deprecated_args(family=None)
def translate(page=None, ... | true | true |
790e184447ef77e263091f70152537bcdf6ca866 | 546 | py | Python | manage.py | sendsent/djorgification | b8a5c61acde0dc78a1f9f4e913cb735a3495c70d | [
"MIT"
] | null | null | null | manage.py | sendsent/djorgification | b8a5c61acde0dc78a1f9f4e913cb735a3495c70d | [
"MIT"
] | null | null | null | manage.py | sendsent/djorgification | b8a5c61acde0dc78a1f9f4e913cb735a3495c70d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djorgification.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Djang... | 34.125 | 78 | 0.690476 |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djorgification.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 ... | true | true |
790e188c3fc31d15b1293bb631f8f155e990503d | 6,365 | py | Python | kubernetes-the-hard-way/system/collections/ansible_collections/community/general/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_location.py | jkroepke/homelab | ffdd849e39b52972870f5552e734fd74cb1254a1 | [
"Apache-2.0"
] | 5 | 2020-12-16T21:42:09.000Z | 2022-03-28T16:04:32.000Z | kubernetes-the-hard-way/system/collections/ansible_collections/community/general/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_location.py | jkroepke/kubernetes-the-hard-way | 70fd096a04addec0777744c9731a4e3fbdc40c8f | [
"Apache-2.0"
] | null | null | null | kubernetes-the-hard-way/system/collections/ansible_collections/community/general/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_location.py | jkroepke/kubernetes-the-hard-way | 70fd096a04addec0777744c9731a4e3fbdc40c8f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright: (c) 2018, Johannes Brunswicker <johannes.brunswicker@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: utm_proxy_... | 31.20098 | 118 | 0.614925 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: utm_proxy_location
author:
- Johannes Brunswicker (@MatrixCrawler)
short_description: create, update or destroy reverse_proxy location entry in Sophos UTM
description:
- Create, update... | true | true |
790e18ac2c2f48915e12579beb0e6dcb4b5321c2 | 961 | py | Python | test/test_settings.py | carlio/setoptconf-tmp | 959733fa2babe3ae0afe3f8826977fdcf7b8c09a | [
"MIT"
] | null | null | null | test/test_settings.py | carlio/setoptconf-tmp | 959733fa2babe3ae0afe3f8826977fdcf7b8c09a | [
"MIT"
] | null | null | null | test/test_settings.py | carlio/setoptconf-tmp | 959733fa2babe3ae0afe3f8826977fdcf7b8c09a | [
"MIT"
] | null | null | null | from decimal import Decimal
import setoptconf as soc
GOOD_NAMES = ("foo", "foo_bar", "foo123", "foo_bar_baz")
BAD_NAMES = ("_foo", "1foo", "FOO", "foo_", "foo__bar", "foo-bar")
def test_name():
for name in GOOD_NAMES:
yield check_good_name, name
for name in BAD_NAMES:
yield check_bad_name,... | 19.612245 | 66 | 0.636837 | from decimal import Decimal
import setoptconf as soc
GOOD_NAMES = ("foo", "foo_bar", "foo123", "foo_bar_baz")
BAD_NAMES = ("_foo", "1foo", "FOO", "foo_", "foo__bar", "foo-bar")
def test_name():
for name in GOOD_NAMES:
yield check_good_name, name
for name in BAD_NAMES:
yield check_bad_name,... | true | true |
790e19a196cbe8574a7a57830504d6e3674e0e25 | 793 | py | Python | venv/Scripts/f2py.py | jeremycward/ipp-core | c3dbebaf997b045da8385cb3dfab46820e40afda | [
"MIT"
] | 1 | 2019-12-04T15:38:54.000Z | 2019-12-04T15:38:54.000Z | venv/Scripts/f2py.py | jeremycward/ipp-core | c3dbebaf997b045da8385cb3dfab46820e40afda | [
"MIT"
] | null | null | null | venv/Scripts/f2py.py | jeremycward/ipp-core | c3dbebaf997b045da8385cb3dfab46820e40afda | [
"MIT"
] | 1 | 2019-12-04T15:42:57.000Z | 2019-12-04T15:42:57.000Z | #!c:\users\jerem\dev\ipp-core\venv\scripts\python.exe
# See http://cens.ioc.ee/projects/f2py2e/
from __future__ import division, print_function
import os
import sys
for mode in ["g3-numpy", "2e-numeric", "2e-numarray", "2e-numpy"]:
try:
i = sys.argv.index("--" + mode)
del sys.argv[i]
break
... | 27.344828 | 67 | 0.641866 |
from __future__ import division, print_function
import os
import sys
for mode in ["g3-numpy", "2e-numeric", "2e-numarray", "2e-numpy"]:
try:
i = sys.argv.index("--" + mode)
del sys.argv[i]
break
except ValueError:
pass
os.environ["NO_SCIPY_IMPORT"] = "f2py"
if mode == "g3-nump... | true | true |
790e19bbff4454a6b0438be6595349c610dc7d0d | 3,008 | py | Python | testsuite/ui/views/admin/product/active_docs.py | dlaso99/3scale-tests | b31a3b3596af6d632b393e383c0417ea56bd95ca | [
"Apache-2.0"
] | 5 | 2021-11-04T14:09:24.000Z | 2021-12-23T13:48:36.000Z | testsuite/ui/views/admin/product/active_docs.py | dlaso99/3scale-tests | b31a3b3596af6d632b393e383c0417ea56bd95ca | [
"Apache-2.0"
] | 41 | 2021-11-03T14:27:21.000Z | 2022-03-29T14:46:16.000Z | testsuite/ui/views/admin/product/active_docs.py | dlaso99/3scale-tests | b31a3b3596af6d632b393e383c0417ea56bd95ca | [
"Apache-2.0"
] | 12 | 2021-11-03T17:28:31.000Z | 2021-11-30T12:28:25.000Z | """View representations of Product Active docs pages"""
from widgetastic_patternfly4 import PatternflyTable
from widgetastic.widget import View, Text
from testsuite.ui.views.admin.product import BaseProductView
from testsuite.ui.widgets.buttons import ThreescaleDeleteButton, ThreescaleEditButton
from testsuite.ui.widg... | 37.6 | 100 | 0.683178 | from widgetastic_patternfly4 import PatternflyTable
from widgetastic.widget import View, Text
from testsuite.ui.views.admin.product import BaseProductView
from testsuite.ui.widgets.buttons import ThreescaleDeleteButton, ThreescaleEditButton
from testsuite.ui.widgets import ActiveDocV2Section, ActiveDocV3Section
from t... | true | true |
790e1ba9e0cfe7cddaa642de2929f900f3df40f2 | 2,954 | py | Python | hypernets/tests/tabular/tb_cuml/drift_detection_test.py | lyhue1991/Hypernets | d726bd297869eacb0cba84376fbac30206bbb60a | [
"Apache-2.0"
] | 3 | 2022-03-25T23:27:44.000Z | 2022-03-27T01:32:28.000Z | hypernets/tests/tabular/tb_cuml/drift_detection_test.py | lyhue1991/Hypernets | d726bd297869eacb0cba84376fbac30206bbb60a | [
"Apache-2.0"
] | null | null | null | hypernets/tests/tabular/tb_cuml/drift_detection_test.py | lyhue1991/Hypernets | d726bd297869eacb0cba84376fbac30206bbb60a | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
"""
"""
import pandas as pd
from pandas.util import hash_pandas_object
from hypernets.tabular.datasets.dsutils import load_bank
from . import if_cuml_ready, is_cuml_installed
if is_cuml_installed:
import cudf
from hypernets.tabular.cuml_ex import CumlToolBox
dd_selector = CumlTool... | 35.590361 | 114 | 0.603927 |
import pandas as pd
from pandas.util import hash_pandas_object
from hypernets.tabular.datasets.dsutils import load_bank
from . import if_cuml_ready, is_cuml_installed
if is_cuml_installed:
import cudf
from hypernets.tabular.cuml_ex import CumlToolBox
dd_selector = CumlToolBox.feature_selector_with_drift... | true | true |
790e1cd9944d798b9c162f3585b8ab6c63580cc5 | 11,096 | py | Python | byol_pytorch/byol_pytorch.py | mariodoebler/byol-pytorch | 4c1b6d27d86e0a9a39ecef6f6888038355943cd0 | [
"MIT"
] | null | null | null | byol_pytorch/byol_pytorch.py | mariodoebler/byol-pytorch | 4c1b6d27d86e0a9a39ecef6f6888038355943cd0 | [
"MIT"
] | null | null | null | byol_pytorch/byol_pytorch.py | mariodoebler/byol-pytorch | 4c1b6d27d86e0a9a39ecef6f6888038355943cd0 | [
"MIT"
] | null | null | null | import copy
from functools import wraps
import numpy as np
import wandb
import torchvision
import torch
import torch.nn.functional as F
from kornia import enhance, filters
from torchvision.transforms import RandomApply, RandomChoice
from atariari.methods.utils import EarlyStopping
from torch import nn
from torch.u... | 34.246914 | 244 | 0.620944 | import copy
from functools import wraps
import numpy as np
import wandb
import torchvision
import torch
import torch.nn.functional as F
from kornia import enhance, filters
from torchvision.transforms import RandomApply, RandomChoice
from atariari.methods.utils import EarlyStopping
from torch import nn
from torch.u... | true | true |
790e204c1dd4df66b9a6f2ed01c7e67e72752f5d | 19,098 | py | Python | tests/components/unifi/test_config_flow.py | sneakythr0ws/core | 048f36c77ec488eee058df93efe76929054204ca | [
"Apache-2.0"
] | 1 | 2021-02-04T15:08:04.000Z | 2021-02-04T15:08:04.000Z | tests/components/unifi/test_config_flow.py | sneakythr0ws/core | 048f36c77ec488eee058df93efe76929054204ca | [
"Apache-2.0"
] | 32 | 2021-02-19T07:21:28.000Z | 2022-03-31T06:06:39.000Z | tests/components/unifi/test_config_flow.py | sneakythr0ws/core | 048f36c77ec488eee058df93efe76929054204ca | [
"Apache-2.0"
] | null | null | null | """Test UniFi config flow."""
from unittest.mock import patch
import aiounifi
from homeassistant import config_entries, data_entry_flow, setup
from homeassistant.components.unifi.const import (
CONF_ALLOW_BANDWIDTH_SENSORS,
CONF_ALLOW_UPTIME_SENSORS,
CONF_BLOCK_CLIENT,
CONF_CONTROLLER,
CONF_DETECT... | 31.936455 | 88 | 0.60221 | from unittest.mock import patch
import aiounifi
from homeassistant import config_entries, data_entry_flow, setup
from homeassistant.components.unifi.const import (
CONF_ALLOW_BANDWIDTH_SENSORS,
CONF_ALLOW_UPTIME_SENSORS,
CONF_BLOCK_CLIENT,
CONF_CONTROLLER,
CONF_DETECTION_TIME,
CONF_DPI_RESTRIC... | true | true |
790e2088846b5164ace41ef7c8aefc6f52e063c5 | 4,244 | py | Python | activity/womail/dailyTask.py | haygcao/UnicomDailyTask | 08bb6c7de320a9355dfff066ebff9bf72d7619b4 | [
"MIT"
] | 148 | 2021-09-13T03:20:28.000Z | 2022-03-30T02:45:44.000Z | activity/womail/dailyTask.py | haygcao/UnicomDailyTask | 08bb6c7de320a9355dfff066ebff9bf72d7619b4 | [
"MIT"
] | 91 | 2021-09-13T03:20:05.000Z | 2022-03-31T16:57:17.000Z | activity/womail/dailyTask.py | haygcao/UnicomDailyTask | 08bb6c7de320a9355dfff066ebff9bf72d7619b4 | [
"MIT"
] | 88 | 2021-09-14T09:33:42.000Z | 2022-03-30T14:31:37.000Z | # -*- coding: utf8 -*-
import json
from activity.womail.womail import WoMail
class DailySign(WoMail):
def __init__(self, mobile, openId):
super(DailySign, self).__init__(mobile, openId)
self.session.headers.update({
# 'Origin': 'https://nyan.mail.wo.cn',
'Referer': 'https:... | 36.273504 | 340 | 0.545476 |
import json
from activity.womail.womail import WoMail
class DailySign(WoMail):
def __init__(self, mobile, openId):
super(DailySign, self).__init__(mobile, openId)
self.session.headers.update({
'Referer': 'https://nyan.mail.wo.cn/cn/sign/wap/index.html',
'User... | true | true |
790e213f39a5e51fd0b29b215b73aaff94186dbc | 4,135 | py | Python | prepare_datasets_DRIVE.py | Hacker-007/E2 | efb829da84734abfc6ac10e1ea20b5dcfd99c7f1 | [
"MIT"
] | null | null | null | prepare_datasets_DRIVE.py | Hacker-007/E2 | efb829da84734abfc6ac10e1ea20b5dcfd99c7f1 | [
"MIT"
] | null | null | null | prepare_datasets_DRIVE.py | Hacker-007/E2 | efb829da84734abfc6ac10e1ea20b5dcfd99c7f1 | [
"MIT"
] | null | null | null | #==========================================================
#
# This prepare the hdf5 datasets of the DRIVE database
#
#============================================================
import os
import h5py
import numpy as np
from PIL import Image
#content/add2/E2/DRIVE_datasets_training_testing
def write_hdf5(arr,outf... | 44.462366 | 139 | 0.662636 |
import os
import h5py
import numpy as np
from PIL import Image
def write_hdf5(arr,outfile):
with h5py.File(outfile,"w") as f:
f.create_dataset("image", data=arr, dtype=arr.dtype)
original_imgs_train = "/content/add2/E2/training/images/"
groundTruth_imgs_train = "/content/add2/E2/training/1st_manual/"... | true | true |
790e22238d6b930f0cab30d29405c0884e850539 | 1,659 | py | Python | src/Simple_Fraud_Detection/solution/01_fill_fraud_db_with_nodes.py | LFeret/masterseminar | 9ec038f7a5b1dc9725ef0c460b147ee26dd6ab2b | [
"MIT"
] | null | null | null | src/Simple_Fraud_Detection/solution/01_fill_fraud_db_with_nodes.py | LFeret/masterseminar | 9ec038f7a5b1dc9725ef0c460b147ee26dd6ab2b | [
"MIT"
] | null | null | null | src/Simple_Fraud_Detection/solution/01_fill_fraud_db_with_nodes.py | LFeret/masterseminar | 9ec038f7a5b1dc9725ef0c460b147ee26dd6ab2b | [
"MIT"
] | null | null | null | import os
import sys
sys.path.append(
os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
)
from src.DbHelper import DbHelper
persons = [
'Lucy',
'Franz',
'Susanne',
'Jonathan',
'Max',
'Stephan',
'Julian',
'Frederike',
'Amy',
'Miriam... | 28.118644 | 139 | 0.614225 | import os
import sys
sys.path.append(
os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
)
from src.DbHelper import DbHelper
persons = [
'Lucy',
'Franz',
'Susanne',
'Jonathan',
'Max',
'Stephan',
'Julian',
'Frederike',
'Amy',
'Miriam... | true | true |
790e239bb26417d30d76967fc7b1f92fb0be852f | 10,953 | py | Python | theano/sandbox/neighbourhoods.py | jych/Theano | d7d722faa96aac95c19f460bf60e8e8654ff58df | [
"BSD-3-Clause"
] | null | null | null | theano/sandbox/neighbourhoods.py | jych/Theano | d7d722faa96aac95c19f460bf60e8e8654ff58df | [
"BSD-3-Clause"
] | null | null | null | theano/sandbox/neighbourhoods.py | jych/Theano | d7d722faa96aac95c19f460bf60e8e8654ff58df | [
"BSD-3-Clause"
] | null | null | null | """WARNING: This code is not recommanded. It is not finished, it is
slower then the version in sandbox/neighbours.py, and it do not work
on the GPU.
We only keep this version here as it is a little bit more generic, so
it cover more cases. But thoses cases aren't needed frequently, so you
probably don't want to use th... | 40.869403 | 84 | 0.570711 | import numpy
from six.moves import xrange
import six.moves.builtins as builtins
import theano
from theano import gof, Op
class NeighbourhoodsFromImages(Op):
__props__ = ("n_dims_before", "dims_neighbourhoods", "strides",
"ignore_border", "inverse")
def __init__(self, n_dims_before, dims_ne... | true | true |
790e23d8e2490e23b11407aae9aee8c5fd2d1e05 | 69,292 | py | Python | verticapy/learn/tsa.py | afard/VerticaPy | ecbee0027a208ba53b31438e5b2f4577af95a07e | [
"Apache-2.0"
] | 52 | 2020-06-29T12:31:14.000Z | 2022-03-31T20:24:23.000Z | verticapy/learn/tsa.py | afard/VerticaPy | ecbee0027a208ba53b31438e5b2f4577af95a07e | [
"Apache-2.0"
] | 175 | 2020-07-13T18:16:28.000Z | 2022-03-31T14:01:45.000Z | verticapy/learn/tsa.py | afard/VerticaPy | ecbee0027a208ba53b31438e5b2f4577af95a07e | [
"Apache-2.0"
] | 21 | 2020-07-07T22:53:10.000Z | 2022-03-04T11:30:48.000Z | # (c) Copyright [2018-2021] Micro Focus or one of its affiliates.
# 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 applicabl... | 37.536295 | 200 | 0.462391 |
import math, warnings
from typing import Union
from verticapy.learn.vmodel import *
from verticapy.learn.linear_model import LinearRegression
from verticapy import vDataFrame
from verticapy.plot import gen_colors
from verticapy.learn.tools import *
from dateutil.pa... | true | true |
790e24a58f0f165be07f8d3ab876fe28026896ef | 2,501 | py | Python | tensorflow_io/hadoop/python/ops/hadoop_dataset_ops.py | jiachengxu/io | 0ef0f21193d7a48c50f8cddeaa1f0fb3056040ea | [
"Apache-2.0"
] | 1 | 2019-10-10T06:11:23.000Z | 2019-10-10T06:11:23.000Z | tensorflow_io/hadoop/python/ops/hadoop_dataset_ops.py | jiachengxu/io | 0ef0f21193d7a48c50f8cddeaa1f0fb3056040ea | [
"Apache-2.0"
] | null | null | null | tensorflow_io/hadoop/python/ops/hadoop_dataset_ops.py | jiachengxu/io | 0ef0f21193d7a48c50f8cddeaa1f0fb3056040ea | [
"Apache-2.0"
] | 1 | 2019-10-10T06:11:24.000Z | 2019-10-10T06:11:24.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 32.480519 | 80 | 0.708517 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tensorflow import dtypes
from tensorflow.compat.v1 import data
from tensorflow_io.core.python.ops import _load_library
hadoop_ops = _load_library('_hadoop_ops.so')
c... | true | true |
790e257dcd48872f99f2a5b30ace865b4698aae7 | 2,177 | py | Python | kchart/charts/views.py | pmrowla/kchart | 23c2003281614ce6d2de38ca977c53ce631507e4 | [
"MIT"
] | 2 | 2016-09-02T05:59:16.000Z | 2021-05-08T01:21:49.000Z | kchart/charts/views.py | pmrowla/kchart | 23c2003281614ce6d2de38ca977c53ce631507e4 | [
"MIT"
] | null | null | null | kchart/charts/views.py | pmrowla/kchart | 23c2003281614ce6d2de38ca977c53ce631507e4 | [
"MIT"
] | 1 | 2016-09-02T05:59:16.000Z | 2016-09-02T05:59:16.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from datetime import datetime
from django.contrib import messages
from django.db.models import Count
from django.views.generic import (
DetailView,
TemplateView,
)
from .models import (
AggregateHourlySongChart,
HourlySo... | 34.555556 | 101 | 0.66881 |
from __future__ import absolute_import, unicode_literals
from datetime import datetime
from django.contrib import messages
from django.db.models import Count
from django.views.generic import (
DetailView,
TemplateView,
)
from .models import (
AggregateHourlySongChart,
HourlySongChart,
HourlySong... | true | true |
790e259abafc3b78efd22c4e49725337604761c5 | 55 | py | Python | src/__init__.py | codespacedot/CodeSpaceAPI | 22b457088aa592c4fb9111718810075d2643d9ca | [
"Apache-2.0"
] | 3 | 2021-07-05T17:28:14.000Z | 2021-12-07T10:08:14.000Z | src/__init__.py | git-vish/CodeSpaceAPI | 7ad4327e0eef3019098730358c4a23312bc85615 | [
"Apache-2.0"
] | 2 | 2021-07-29T13:55:15.000Z | 2021-07-31T16:49:03.000Z | src/__init__.py | git-vish/CodeSpaceAPI | 7ad4327e0eef3019098730358c4a23312bc85615 | [
"Apache-2.0"
] | 3 | 2021-07-01T16:32:20.000Z | 2021-07-05T04:50:30.000Z | """FastAPI Project for CodeSpace.
https://csdot.ml
"""
| 13.75 | 33 | 0.690909 | true | true | |
790e25c4d5b74218ebf3024bbf700dd23d8d987e | 229 | py | Python | about/views.py | nicolas-costa/univ-pweb2-django-institutional | be61d1b02a207dc6d40847f44e3504a268e9bc18 | [
"WTFPL"
] | null | null | null | about/views.py | nicolas-costa/univ-pweb2-django-institutional | be61d1b02a207dc6d40847f44e3504a268e9bc18 | [
"WTFPL"
] | null | null | null | about/views.py | nicolas-costa/univ-pweb2-django-institutional | be61d1b02a207dc6d40847f44e3504a268e9bc18 | [
"WTFPL"
] | null | null | null | from django.http import HttpResponse
from django.template import loader
# Create your views here.
def index(request):
templ = loader.get_template('about/index.html')
return HttpResponse(templ.render(request=request))
| 20.818182 | 54 | 0.768559 | from django.http import HttpResponse
from django.template import loader
def index(request):
templ = loader.get_template('about/index.html')
return HttpResponse(templ.render(request=request))
| true | true |
790e25dee299e98cceaa4a8112d570f33ec279e9 | 677 | py | Python | taskcat/_cli_modules/generate_iam_policy.py | sirhc/taskcat | 22e4bf0fa2b13363eca87cfbb3f3061247fa63c3 | [
"Apache-2.0"
] | 920 | 2016-12-03T01:41:25.000Z | 2021-11-04T13:52:21.000Z | taskcat/_cli_modules/generate_iam_policy.py | sirhc/taskcat | 22e4bf0fa2b13363eca87cfbb3f3061247fa63c3 | [
"Apache-2.0"
] | 544 | 2017-02-23T22:41:25.000Z | 2021-11-03T23:02:25.000Z | taskcat/_cli_modules/generate_iam_policy.py | sirhc/taskcat | 22e4bf0fa2b13363eca87cfbb3f3061247fa63c3 | [
"Apache-2.0"
] | 225 | 2016-12-11T13:36:21.000Z | 2021-11-04T14:43:53.000Z | import logging
from pathlib import Path
from taskcat._config import Config
from taskcat.iam_policy.policy import CFNPolicyGenerator
LOG = logging.getLogger(__name__)
class GenerateIAMPolicy:
"""
[ALPHA] Introspects CFN Template(s) and generates an IAM policy necessary to successfully launch the template(s)
... | 27.08 | 116 | 0.725258 | import logging
from pathlib import Path
from taskcat._config import Config
from taskcat.iam_policy.policy import CFNPolicyGenerator
LOG = logging.getLogger(__name__)
class GenerateIAMPolicy:
CLINAME = "generate-iam-policy"
def __init__(
self, output_file: str = "./cfn_stack_policy.json", project_r... | true | true |
790e26a11754a9d70167dbcc6e4019648c229da6 | 73,932 | py | Python | src/config/common/cfgm_common/vnc_cassandra.py | atsgen/tf-controller | 9321889cdd3d7108980cc88937b2e82956502cc5 | [
"Apache-2.0"
] | null | null | null | src/config/common/cfgm_common/vnc_cassandra.py | atsgen/tf-controller | 9321889cdd3d7108980cc88937b2e82956502cc5 | [
"Apache-2.0"
] | null | null | null | src/config/common/cfgm_common/vnc_cassandra.py | atsgen/tf-controller | 9321889cdd3d7108980cc88937b2e82956502cc5 | [
"Apache-2.0"
] | 1 | 2020-12-18T18:22:53.000Z | 2020-12-18T18:22:53.000Z | from __future__ import absolute_import
from __future__ import unicode_literals
#
# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
#
from builtins import next
from builtins import chr
from builtins import str
from builtins import range
from builtins import object
import copy
import os
import gevent
fro... | 42.319405 | 100 | 0.542985 | from __future__ import absolute_import
from __future__ import unicode_literals
from builtins import next
from builtins import chr
from builtins import str
from builtins import range
from builtins import object
import copy
import os
import gevent
from pprint import pformat
import six
from vnc_api import vnc_api
fr... | true | true |
790e26be3128ca0358ecc4721ef38ca8373a9407 | 2,496 | py | Python | source/engine/steps/config_model.py | Borrk/DeepLearning-Engine | 54f6cdb8a76e76d9f439f8562652f545e4dbc02e | [
"MIT"
] | null | null | null | source/engine/steps/config_model.py | Borrk/DeepLearning-Engine | 54f6cdb8a76e76d9f439f8562652f545e4dbc02e | [
"MIT"
] | null | null | null | source/engine/steps/config_model.py | Borrk/DeepLearning-Engine | 54f6cdb8a76e76d9f439f8562652f545e4dbc02e | [
"MIT"
] | null | null | null | from engine.steps.IStep import IStep
from keras.models import Model
from keras import backend as K
from keras.preprocessing.image import ImageDataGenerator
from keras.optimizers import Adam
class config_model(IStep):
"""config model"""
create_Optimizer_func = None
create_loss_func = None
def __init... | 33.28 | 89 | 0.654647 | from engine.steps.IStep import IStep
from keras.models import Model
from keras import backend as K
from keras.preprocessing.image import ImageDataGenerator
from keras.optimizers import Adam
class config_model(IStep):
create_Optimizer_func = None
create_loss_func = None
def __init__(self, output_channel... | true | true |
790e275df8597c6b16772b5c3a832d566d6ed222 | 2,461 | py | Python | sdk/keyvault/azure-keyvault/azure/keyvault/v7_3_preview/models/sas_definition_create_parameters.py | mccoyp/azure-keyvault-7.3-preview | da351753a9d3d2bf97c27566865cd88bae7faa55 | [
"MIT"
] | null | null | null | sdk/keyvault/azure-keyvault/azure/keyvault/v7_3_preview/models/sas_definition_create_parameters.py | mccoyp/azure-keyvault-7.3-preview | da351753a9d3d2bf97c27566865cd88bae7faa55 | [
"MIT"
] | null | null | null | sdk/keyvault/azure-keyvault/azure/keyvault/v7_3_preview/models/sas_definition_create_parameters.py | mccoyp/azure-keyvault-7.3-preview | da351753a9d3d2bf97c27566865cd88bae7faa55 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 43.175439 | 94 | 0.650549 |
from msrest.serialization import Model
class SasDefinitionCreateParameters(Model):
_validation = {
'template_uri': {'required': True},
'sas_type': {'required': True},
'validity_period': {'required': True},
}
_attribute_map = {
'template_uri': {'key': 'templateU... | true | true |
790e28b2a29b6a3f90c09296edb60423a6e6516e | 3,785 | py | Python | analysis_figure_code/SuppFig2/SuppFig2.py | chrisroadmap/Near_term_warming | 7fc712fdcbf135bc3a73027b1c7b5a3504c5ea5e | [
"Apache-2.0"
] | 2 | 2021-01-20T03:18:15.000Z | 2022-01-25T18:47:27.000Z | analysis_figure_code/SuppFig2/SuppFig2.py | chrisroadmap/Near_term_warming | 7fc712fdcbf135bc3a73027b1c7b5a3504c5ea5e | [
"Apache-2.0"
] | null | null | null | analysis_figure_code/SuppFig2/SuppFig2.py | chrisroadmap/Near_term_warming | 7fc712fdcbf135bc3a73027b1c7b5a3504c5ea5e | [
"Apache-2.0"
] | 3 | 2020-07-31T14:51:39.000Z | 2020-10-29T22:30:54.000Z | import numpy as np
import numpy.ma as npma
from scipy import stats
import matplotlib.pyplot as plt
import baspy as bp
import fnmatch
"""
Created on Wed Nov 27 18:34 2019
@author: Christine McKenna
========================================================================
Purpose: Plots Supp Fig 2, a pdf of all possibl... | 33.495575 | 75 | 0.573844 | import numpy as np
import numpy.ma as npma
from scipy import stats
import matplotlib.pyplot as plt
import baspy as bp
import fnmatch
loaddir_CMIP = 'Priestley-Centre/Near_term_warming/analysis_figure_code/'+\
'SuppFig2/saved_arrays'
savedir = 'Priestley-Centre/Near_term_warming/analysis_figure_code/'... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.