hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | 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 209 | max_forks_repo_name stringlengths 5 121 | 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 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dbcaddd126925caf34132904b77e4e858bb11b0f | 467 | py | Python | 015_LatticePaths.py | joetache4/ProjectEuler | f101e927d73dbafa11af1b208992bf0d830c88b1 | [
"MIT"
] | null | null | null | 015_LatticePaths.py | joetache4/ProjectEuler | f101e927d73dbafa11af1b208992bf0d830c88b1 | [
"MIT"
] | null | null | null | 015_LatticePaths.py | joetache4/ProjectEuler | f101e927d73dbafa11af1b208992bf0d830c88b1 | [
"MIT"
] | null | null | null | '''
Joe Walter
difficulty: 5%
run time: 0:00
answer: 137846528820
***
015 Lattice Paths
Starting in the top left corner of a 2×2 grid, and only being able to move to the right and down, there are exactly 6 routes to the bottom right corner.
How many such routes are there through a 20×20 grid?
'''
# perm(n)... | 17.296296 | 152 | 0.674518 |
8a25807a92a529be3d4308e2fe03aae462c343eb | 999 | py | Python | ZeroMQ/filecode/examples/Python/tornado_ioloop/pathosub.py | JailbreakFox/LightWeightRepository | 710dc8cacf934930b8f91b2cfe93cba0f1765094 | [
"BSD-2-Clause"
] | null | null | null | ZeroMQ/filecode/examples/Python/tornado_ioloop/pathosub.py | JailbreakFox/LightWeightRepository | 710dc8cacf934930b8f91b2cfe93cba0f1765094 | [
"BSD-2-Clause"
] | null | null | null | ZeroMQ/filecode/examples/Python/tornado_ioloop/pathosub.py | JailbreakFox/LightWeightRepository | 710dc8cacf934930b8f91b2cfe93cba0f1765094 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
"""
synopsis:
Pathological subscriber
Subscribes to one random topic and prints received messages
usage:
python pathosub.py
"""
import sys
import zmq
from zmq.eventloop.future import Context, Poller
from zmq.eventloop.ioloop import IOLoop
from tornado import gen
Url = 'tcp://127.0.... | 20.387755 | 63 | 0.65966 |
e0193cfb4e5adc6e70aecea82f794908e78aca46 | 98,502 | py | Python | stompy/model/hydro_model.py | rustychris/stompy | 4efb78824804edc68555bced275e37842f98ba1f | [
"MIT"
] | 17 | 2017-10-12T14:53:25.000Z | 2022-02-26T01:24:52.000Z | stompy/model/hydro_model.py | rustychris/stompy | 4efb78824804edc68555bced275e37842f98ba1f | [
"MIT"
] | 6 | 2018-03-12T12:43:14.000Z | 2021-09-04T17:44:31.000Z | stompy/model/hydro_model.py | rustychris/stompy | 4efb78824804edc68555bced275e37842f98ba1f | [
"MIT"
] | 6 | 2017-09-29T21:20:11.000Z | 2020-09-28T21:29:23.000Z | """
Base class for managing hydrodynamic model runs
"""
import os,shutil,glob,inspect
import six
import logging
log=logging.getLogger('HydroModel')
import copy
import numpy as np
import xarray as xr
from shapely import geometry
import stompy.model.delft.io as dio
from stompy import xr_utils
from stompy.io.local imp... | 38.522487 | 123 | 0.590272 |
f4302aca139802e99d80bfd4e1fc27e353abdfbb | 7,437 | py | Python | research/delf/delf/python/training/model/export_model_utils.py | haruiz/models | 4dfcf48f7e15646dca2089a0e9f583d24661924c | [
"Apache-2.0"
] | 153 | 2020-10-25T13:58:04.000Z | 2022-03-07T06:01:54.000Z | research/delf/delf/python/training/model/export_model_utils.py | HirataYurina/models | 2db2501bc9928f68e225282f3884b81680a9cccb | [
"Apache-2.0"
] | 11 | 2020-07-13T08:29:00.000Z | 2022-03-24T07:21:09.000Z | research/delf/delf/python/training/model/export_model_utils.py | HirataYurina/models | 2db2501bc9928f68e225282f3884b81680a9cccb | [
"Apache-2.0"
] | 23 | 2020-10-25T14:44:47.000Z | 2021-03-31T02:12:13.000Z | # Lint as: python3
# Copyright 2020 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 ... | 43.238372 | 80 | 0.70593 |
5147cda63a6b5a30c3c454bca87d23a018bb406a | 192 | py | Python | mjml/elements/head/mj_title.py | ESA-CCI-ODP/mjml-stub | ffd824923de85f3c02fca7f83ef6b540be048414 | [
"MIT"
] | 23 | 2020-10-02T14:52:21.000Z | 2022-03-24T16:05:21.000Z | mjml/elements/head/mj_title.py | ESA-CCI-ODP/mjml-stub | ffd824923de85f3c02fca7f83ef6b540be048414 | [
"MIT"
] | 17 | 2020-10-07T14:48:06.000Z | 2022-03-18T13:56:11.000Z | mjml/elements/head/mj_title.py | ESA-CCI-ODP/mjml-stub | ffd824923de85f3c02fca7f83ef6b540be048414 | [
"MIT"
] | 8 | 2021-01-13T11:54:41.000Z | 2022-03-10T15:50:55.000Z |
from ._head_base import HeadComponent
__all__ = ['MjTitle']
class MjTitle(HeadComponent):
def handler(self):
add = self.context['add']
add('title', self.getContent())
| 16 | 39 | 0.651042 |
01fdb3d4c3ccc53c2cf9cb8bfd2a974596871b73 | 71,915 | py | Python | h2o-py/h2o/grid/grid_search.py | jancijen/h2o-3 | 08b11fb8987656ce9b6b598b4832fd04605f5437 | [
"Apache-2.0"
] | null | null | null | h2o-py/h2o/grid/grid_search.py | jancijen/h2o-3 | 08b11fb8987656ce9b6b598b4832fd04605f5437 | [
"Apache-2.0"
] | 1 | 2020-05-10T15:33:07.000Z | 2020-05-10T15:33:07.000Z | h2o-py/h2o/grid/grid_search.py | jancijen/h2o-3 | 08b11fb8987656ce9b6b598b4832fd04605f5437 | [
"Apache-2.0"
] | 1 | 2020-04-17T13:06:26.000Z | 2020-04-17T13:06:26.000Z | # -*- encoding: utf-8 -*-
from __future__ import division, print_function, absolute_import, unicode_literals
import itertools
import h2o
from h2o.base import Keyed
from h2o.job import H2OJob
from h2o.frame import H2OFrame
from h2o.exceptions import H2OValueError
from h2o.estimators.estimator_base import H2OEstimator
... | 46.456718 | 181 | 0.606077 |
0a6b2063cb270e279fa41cec6709ca1229abaf98 | 1,260 | py | Python | PyFile/__init__.py | malcolmraine/PyFile | 933454f22362392adac049d099dad03b5384f9e8 | [
"MIT"
] | null | null | null | PyFile/__init__.py | malcolmraine/PyFile | 933454f22362392adac049d099dad03b5384f9e8 | [
"MIT"
] | 1 | 2020-05-11T02:13:17.000Z | 2020-05-11T02:13:17.000Z | PyFile/__init__.py | malcolmraine/PyFile | 933454f22362392adac049d099dad03b5384f9e8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
File: __init__.py
Description:
Author: Malcolm Hall
Version: 1
MIT License
Copyright (c) 2020 Malcolm Hall
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restr... | 36 | 78 | 0.788095 |
cba4d67a0ff946d74291404fdee59515897d4875 | 4,223 | py | Python | contest/serializers.py | custoj/CustOJ-Backend | 5451ebb3541a0376f50235896ac4e28124cc41d7 | [
"MIT"
] | 1 | 2019-10-16T11:25:41.000Z | 2019-10-16T11:25:41.000Z | contest/serializers.py | custoj/CustOJ-Backend | 5451ebb3541a0376f50235896ac4e28124cc41d7 | [
"MIT"
] | 4 | 2021-03-19T03:28:48.000Z | 2022-03-11T23:58:02.000Z | contest/serializers.py | custoj/CustOJ-Backend | 5451ebb3541a0376f50235896ac4e28124cc41d7 | [
"MIT"
] | null | null | null | from utils.api import UsernameSerializer, serializers
from .models import Contest, ContestAnnouncement, ContestRuleType
from .models import ACMContestRank, OIContestRank
class CreateConetestSeriaizer(serializers.Serializer):
title = serializers.CharField(max_length=128)
description = serializers.CharField()
... | 34.333333 | 137 | 0.749941 |
120e87f710a8257d84abc06f5ce93e117dc60166 | 155 | py | Python | 189. Rotate Array.py | Into-Y0u/Github-Baby | 5e4e6b02f49c2c99533289be9d49911006cad919 | [
"MIT"
] | null | null | null | 189. Rotate Array.py | Into-Y0u/Github-Baby | 5e4e6b02f49c2c99533289be9d49911006cad919 | [
"MIT"
] | null | null | null | 189. Rotate Array.py | Into-Y0u/Github-Baby | 5e4e6b02f49c2c99533289be9d49911006cad919 | [
"MIT"
] | null | null | null | class Solution:
def rotate(self, nums: List[int], k: int) -> None:
k = k%(len(nums))
nums[:] = nums[len(nums)-k:] + nums[:len(nums)-k]
| 31 | 57 | 0.529032 |
83661a1d0b87ca7439fec051ed317260616b935c | 8,121 | py | Python | lithops/storage/backends/infinispan/infinispan.py | aitorarjona/lithops | d872177b0dbb411456af47db7e383d71c28fb257 | [
"Apache-2.0"
] | 1 | 2021-05-21T13:27:08.000Z | 2021-05-21T13:27:08.000Z | lithops/storage/backends/infinispan/infinispan.py | aitorarjona/lithops | d872177b0dbb411456af47db7e383d71c28fb257 | [
"Apache-2.0"
] | null | null | null | lithops/storage/backends/infinispan/infinispan.py | aitorarjona/lithops | d872177b0dbb411456af47db7e383d71c28fb257 | [
"Apache-2.0"
] | null | null | null | #
# (C) Copyright IBM Corp. 2019
#
# 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 writi... | 37.772093 | 106 | 0.610762 |
37fbf1bf9d3872ff1e30f9f99c9f3b961da8d4f4 | 1,377 | py | Python | towhee/dag/variable_repr.py | krishnakatyal/towhee | c5e043aa1509cf46644ca6b53f691d6ed2647212 | [
"Apache-2.0"
] | 365 | 2021-07-13T09:21:46.000Z | 2022-03-31T19:54:30.000Z | towhee/dag/variable_repr.py | Nydclky/towhee | 7cad1b64a44ccfedb18f3064dd33e44eac88ac65 | [
"Apache-2.0"
] | 911 | 2021-07-14T05:05:31.000Z | 2022-03-31T14:11:59.000Z | towhee/dag/variable_repr.py | jennyli-z/towhee | 55c55fd961229575b75eae269b55090c839f8dcd | [
"Apache-2.0"
] | 199 | 2021-07-13T08:40:43.000Z | 2022-03-31T19:10:23.000Z | # Copyright 2021 Zilliz. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 31.295455 | 87 | 0.66594 |
e0be36a805e028888bb1eee16a4b07530d355c71 | 11,456 | py | Python | src/cops_and_robots/map_tools/map_elements.py | COHRINT/cops_and_robots | 1df99caa1e38bde1b5ce2d04389bc232a68938d6 | [
"Apache-2.0"
] | 3 | 2016-01-19T17:54:51.000Z | 2019-10-21T12:09:03.000Z | src/cops_and_robots/map_tools/map_elements.py | COHRINT/cops_and_robots | 1df99caa1e38bde1b5ce2d04389bc232a68938d6 | [
"Apache-2.0"
] | null | null | null | src/cops_and_robots/map_tools/map_elements.py | COHRINT/cops_and_robots | 1df99caa1e38bde1b5ce2d04389bc232a68938d6 | [
"Apache-2.0"
] | 5 | 2015-02-19T02:53:24.000Z | 2019-03-05T20:29:12.000Z | #!/usr/bin/env python
"""Defines physical and non-physical objects used in the map environment.
``map_obj`` extends Shapely's geometry objects (generally polygons) to
be used in a robotics environmnt. Map objects can be physical,
representing walls, or non-physical, representing camera viewcones.
The visibility of an... | 36.368254 | 84 | 0.58118 |
d4d35611df9ade3fa6bbd60c04320bec05194d1d | 2,007 | py | Python | modules/image/object_detection/yolov3_resnet50_vd_coco2017/data_feed.py | AK391/PaddleHub | a51ab7447e089776766becb3297e560dfed98573 | [
"Apache-2.0"
] | 8,360 | 2019-01-18T10:46:45.000Z | 2022-03-31T14:50:02.000Z | modules/image/object_detection/yolov3_resnet50_vd_coco2017/data_feed.py | AK391/PaddleHub | a51ab7447e089776766becb3297e560dfed98573 | [
"Apache-2.0"
] | 1,158 | 2019-04-11T09:22:43.000Z | 2022-03-31T12:12:09.000Z | modules/image/object_detection/yolov3_resnet50_vd_coco2017/data_feed.py | AK391/PaddleHub | a51ab7447e089776766becb3297e560dfed98573 | [
"Apache-2.0"
] | 1,677 | 2019-04-09T15:07:40.000Z | 2022-03-31T06:41:10.000Z | # coding=utf-8
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import os
import cv2
import numpy as np
__all__ = ['reader']
def reader(paths=[], images=None):
"""
data generator
Args:
paths (list[str]): paths to images.
image... | 27.875 | 80 | 0.577479 |
afd5abe6d87baba519ddab795a5f3bb79ec5d3ac | 12,433 | py | Python | tests/kubernetes/test_pod_generator.py | InigoSJ/airflow | 8b97a387dc30d8c88390d500ec99333798c20f1c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2019-09-06T09:55:18.000Z | 2019-09-06T09:55:18.000Z | tests/kubernetes/test_pod_generator.py | InigoSJ/airflow | 8b97a387dc30d8c88390d500ec99333798c20f1c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | tests/kubernetes/test_pod_generator.py | InigoSJ/airflow | 8b97a387dc30d8c88390d500ec99333798c20f1c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.790274 | 81 | 0.419529 |
1435568d1c2fbeb3961f8818877095c0e3fbdf9c | 8,933 | py | Python | WeatherStationSensorsReader/main/main_class.py | weather-station-project/weather-station-sensors-reader | cda7902ee382248b41d14b9a2c0543817decbb4a | [
"MIT"
] | null | null | null | WeatherStationSensorsReader/main/main_class.py | weather-station-project/weather-station-sensors-reader | cda7902ee382248b41d14b9a2c0543817decbb4a | [
"MIT"
] | null | null | null | WeatherStationSensorsReader/main/main_class.py | weather-station-project/weather-station-sensors-reader | cda7902ee382248b41d14b9a2c0543817decbb4a | [
"MIT"
] | null | null | null | import logging
from controllers.air_measurement_controller import AirMeasurementController
from controllers.ambient_temperature_controller import AmbientTemperatureController
from controllers.fake_controller import FakeController
from controllers.ground_temperature_controller import GroundTemperatureController
from co... | 46.284974 | 146 | 0.692153 |
c8c24f886863835c23254414d81d1955775e62f2 | 5,213 | py | Python | docs/conf.py | brentru/Adafruit_CircuitPython_hashlib | 5210b90a8b2b51b0b0f59982e1af06773b66e960 | [
"MIT"
] | null | null | null | docs/conf.py | brentru/Adafruit_CircuitPython_hashlib | 5210b90a8b2b51b0b0f59982e1af06773b66e960 | [
"MIT"
] | null | null | null | docs/conf.py | brentru/Adafruit_CircuitPython_hashlib | 5210b90a8b2b51b0b0f59982e1af06773b66e960 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
# -- General configuration ------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extens... | 32.378882 | 146 | 0.684826 |
a0ee821f78243939eec74546b03f879a4b9b02ac | 82,442 | py | Python | python/ccxt/base/exchange.py | MMeSports/ccxt | 175229eae57e46f90ad531650abcea4d666514f7 | [
"MIT"
] | 1 | 2021-07-07T14:56:56.000Z | 2021-07-07T14:56:56.000Z | python/ccxt/base/exchange.py | MMeSports/ccxt | 175229eae57e46f90ad531650abcea4d666514f7 | [
"MIT"
] | null | null | null | python/ccxt/base/exchange.py | MMeSports/ccxt | 175229eae57e46f90ad531650abcea4d666514f7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Base exchange class"""
# -----------------------------------------------------------------------------
__version__ = '1.42.16'
# -----------------------------------------------------------------------------
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import NetworkEr... | 39.408222 | 208 | 0.596965 |
55c50d1cfce3e01fec764595085ace27690911b5 | 945 | py | Python | setup.py | datasig-ac-uk/pysegments | 6bbc9714f5c9dd9181f96e6994427618dc81ac06 | [
"MIT"
] | 1 | 2021-01-18T17:45:46.000Z | 2021-01-18T17:45:46.000Z | setup.py | datasig-ac-uk/pysegments | 6bbc9714f5c9dd9181f96e6994427618dc81ac06 | [
"MIT"
] | null | null | null | setup.py | datasig-ac-uk/pysegments | 6bbc9714f5c9dd9181f96e6994427618dc81ac06 | [
"MIT"
] | 1 | 2021-01-18T17:45:48.000Z | 2021-01-18T17:45:48.000Z | import os
from glob import glob as _glob
from setuptools import setup, Extension
def glob(*parts):
return _glob(os.path.join(*parts))
segments_ext = Extension(
"pysegments._segments",
language = "c++",
sources = glob("src", "*.cpp"),
depends = glob("src", "*.h"),
include_dirs = ["Include"],... | 23.04878 | 68 | 0.65291 |
cab91610f6d7893f846ff5ffe2d28d303d85956b | 10,364 | py | Python | tests/test_single_document.py | syntheorem/LSP | 753f8675452c1a4056c606c92a6ad8d26281e138 | [
"MIT"
] | null | null | null | tests/test_single_document.py | syntheorem/LSP | 753f8675452c1a4056c606c92a6ad8d26281e138 | [
"MIT"
] | null | null | null | tests/test_single_document.py | syntheorem/LSP | 753f8675452c1a4056c606c92a6ad8d26281e138 | [
"MIT"
] | null | null | null | from copy import deepcopy
from LSP.plugin.core.url import filename_to_uri
from LSP.plugin.hover import _test_contents
from setup import TextDocumentTestCase, TIMEOUT_TIME
import os
import sublime
try:
from typing import Generator, Optional, Iterable, Tuple, List
assert Generator and Optional and Iterable and T... | 38.962406 | 115 | 0.605172 |
567b71348ed14443fbc1c2052446983d8b4772bf | 874 | py | Python | Monte-Carlo-Attacks/Monte-Carlo-MNIST_GAN/test.py | SAP-samples/security-research-mi-gen-nn | 15627f73fcc497c87a67f41957f6b82881dff353 | [
"Apache-2.0"
] | 5 | 2020-02-21T15:13:57.000Z | 2021-08-05T15:18:40.000Z | Monte-Carlo-Attacks/Monte-Carlo-MNIST_GAN/test.py | SAP-samples/security-research-membership-inference-against-generative-networks | 15627f73fcc497c87a67f41957f6b82881dff353 | [
"Apache-2.0"
] | null | null | null | Monte-Carlo-Attacks/Monte-Carlo-MNIST_GAN/test.py | SAP-samples/security-research-membership-inference-against-generative-networks | 15627f73fcc497c87a67f41957f6b82881dff353 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
import numpy as np
import ais
import matplotlib.pyplot as plt
from priors import NormalPrior
from kernels import ParsenDensityEstimator
from scipy.stats import norm
class Generator(object):
def __init__(self, input_dim, output_dim):
self.input_dim = input_dim
self.output_di... | 23 | 85 | 0.700229 |
3ac36aecf7fc7a0ecb7f9c205cf4c1e92ce99d3e | 3,185 | py | Python | symupy/runtime/logic/sorted_frozen_set.py | licit-lab/symupy | 942a17ee78cd12a363a4cd7b7f8363e239ccf7fe | [
"MIT"
] | 2 | 2021-11-10T14:33:09.000Z | 2022-03-03T09:23:03.000Z | symupy/runtime/logic/sorted_frozen_set.py | licit-lab/symupy | 942a17ee78cd12a363a4cd7b7f8363e239ccf7fe | [
"MIT"
] | 33 | 2021-01-18T13:59:01.000Z | 2021-11-29T13:21:10.000Z | symupy/runtime/logic/sorted_frozen_set.py | licit-lab/symupy | 942a17ee78cd12a363a4cd7b7f8363e239ccf7fe | [
"MIT"
] | null | null | null | """
This is a class describing a sorted frozen set. This is a collection implementation for a set of ordered elements that establish specific protocols for iteration, information access, element identification.
"""
# ============================================================================
# STANDARD IMPORTS
#... | 29.490741 | 210 | 0.55887 |
8939262cd968bd39b1c97e795f3703f8a1021659 | 8,669 | py | Python | alphamap/pdflib.py | MarcSkovMadsen/alphamap | ef3774c3ef693a9d772615cc019c90943a752cdf | [
"Apache-2.0"
] | 28 | 2021-07-24T20:39:43.000Z | 2022-03-21T11:52:25.000Z | alphamap/pdflib.py | MarcSkovMadsen/alphamap | ef3774c3ef693a9d772615cc019c90943a752cdf | [
"Apache-2.0"
] | 19 | 2021-07-21T12:10:15.000Z | 2022-02-23T07:04:47.000Z | alphamap/pdflib.py | MarcSkovMadsen/alphamap | ef3774c3ef693a9d772615cc019c90943a752cdf | [
"Apache-2.0"
] | 6 | 2021-07-23T15:15:41.000Z | 2021-12-25T07:15:30.000Z | #!/usr/bin/env python
# coding: utf-8
# This script has kindly been provided by Julia Schessner.
from io import BytesIO
from reportlab.pdfgen import canvas
from reportlab.lib.utils import ImageReader
from reportlab.platypus import Paragraph
from pdfrw import PdfReader, PdfDict
from pdfrw.buildxobj import pagexobj
f... | 37.855895 | 157 | 0.581382 |
db14b2a68ad23bb6248af2d97383c7f67a065446 | 5,005 | py | Python | dnc/dnc.py | Munyola/dnc | d3d94b3b1f1efc282481910054f82047caf37f65 | [
"Apache-2.0"
] | 2,697 | 2017-04-19T14:05:38.000Z | 2022-03-28T02:56:29.000Z | dnc/dnc.py | Munyola/dnc | d3d94b3b1f1efc282481910054f82047caf37f65 | [
"Apache-2.0"
] | 41 | 2017-04-21T12:37:29.000Z | 2022-03-06T11:48:40.000Z | dnc/dnc.py | Munyola/dnc | d3d94b3b1f1efc282481910054f82047caf37f65 | [
"Apache-2.0"
] | 539 | 2017-04-19T14:08:22.000Z | 2022-03-14T01:30:00.000Z | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 35 | 103 | 0.692707 |
d7426969268a998302bebd29d8f0e6f93cdc2f93 | 2,775 | py | Python | examples/yara_matches.py | kwBrandenWagner/zat | b6e76af2d59313db4d3818986183689ebf559ad8 | [
"Apache-2.0"
] | null | null | null | examples/yara_matches.py | kwBrandenWagner/zat | b6e76af2d59313db4d3818986183689ebf559ad8 | [
"Apache-2.0"
] | null | null | null | examples/yara_matches.py | kwBrandenWagner/zat | b6e76af2d59313db4d3818986183689ebf559ad8 | [
"Apache-2.0"
] | null | null | null | """Run a set of Yara Rule matches on Extracted Files
Note: Download yara rules from their repo and give index file as arg
$ git clone https://github.com/Yara-Rules/rules rules
$ python yara_matches -r /path/to/rules/index.yar -e /path/to/zeek/extract_files
"""
from __future__ import pri... | 37 | 160 | 0.684324 |
a41f07c8e0f558597dfd6ed1c580c0393144a591 | 8,755 | py | Python | setup.py | PlaidCloud/sqlalchemy-views | 669913848a36a6795cd4a32c8bdf1d23737fa959 | [
"MIT"
] | null | null | null | setup.py | PlaidCloud/sqlalchemy-views | 669913848a36a6795cd4a32c8bdf1d23737fa959 | [
"MIT"
] | null | null | null | setup.py | PlaidCloud/sqlalchemy-views | 669913848a36a6795cd4a32c8bdf1d23737fa959 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import imp
import subprocess
## Python 2.6 subprocess.check_output compatibility. Thanks Greg Hewgill!
if 'check_output' not in dir(subprocess):
def check_output(cmd_args, *args, **kwargs):
proc = subprocess.Popen(
... | 31.606498 | 113 | 0.672073 |
adf5cc0a9a25f52c488f97fb0533d348478dad89 | 2,508 | py | Python | test.py | VishnuBhaarath/Tabular-AutoML | 9f6259c8764bbc409244af49661757700b1c5b0c | [
"MIT"
] | null | null | null | test.py | VishnuBhaarath/Tabular-AutoML | 9f6259c8764bbc409244af49661757700b1c5b0c | [
"MIT"
] | null | null | null | test.py | VishnuBhaarath/Tabular-AutoML | 9f6259c8764bbc409244af49661757700b1c5b0c | [
"MIT"
] | null | null | null | """
This file is for testing the integration of the library classes and functions.
"""
from tab_automl.automl.datasets import Iris, Wine
from tab_automl.automl.training import Trainer
from tab_automl.automl.processing import PreProcessing
from tab_automl.automl.fet_engineering import FeatureEngineering
from tab_automl.... | 33.891892 | 109 | 0.729665 |
09ab82085479422612d157dfa3338679bb88fe8f | 266 | py | Python | etc/untitled5.py | zhangbo2008/facenet | 4dfabcb5cf14f99622dbe5f9f12f0539821c169c | [
"MIT"
] | null | null | null | etc/untitled5.py | zhangbo2008/facenet | 4dfabcb5cf14f99622dbe5f9f12f0539821c169c | [
"MIT"
] | 7 | 2019-12-16T22:10:01.000Z | 2022-02-10T00:27:35.000Z | etc/untitled5.py | zhangbo2008/facenet | 4dfabcb5cf14f99622dbe5f9f12f0539821c169c | [
"MIT"
] | null | null | null |
a=type([1,2])
print(a)
print(type(a))
b={}.get(a)
print(b)
import numpy as np
x = np.arange(16).reshape(-1,4)
print(np.where(x>5))
#(array([1, 1, 2, 2, 2, 2, 3, 3, 3, 3], dtype=int64), array([2, 3, 0, 1, 2, 3, 0, 1, 2, 3], dtype=int64))
#注意这里是坐标是前面的一维的坐标,后面是二维的坐标
| 20.461538 | 105 | 0.590226 |
dcf34530e5e702b480e9bd571c1b55eeebf81df0 | 634 | py | Python | examples/run_bea.py | rhododendrom/NiaPy | 873037e4337474bb75714f1c2be273c97de3eded | [
"MIT"
] | 1 | 2020-03-16T11:15:43.000Z | 2020-03-16T11:15:43.000Z | examples/run_bea.py | rhododendrom/NiaPy | 873037e4337474bb75714f1c2be273c97de3eded | [
"MIT"
] | null | null | null | examples/run_bea.py | rhododendrom/NiaPy | 873037e4337474bb75714f1c2be273c97de3eded | [
"MIT"
] | null | null | null | # encoding=utf8
# This is temporary fix to import module from parent folder
# It will be removed when package is published on PyPI
from NiaPy.benchmarks import Sphere
from NiaPy.task.task import StoppingTask, OptimizationType
from NiaPy.algorithms.basic import BeesAlgorithm
import sys
sys.path.append('../')
# End of f... | 33.368421 | 96 | 0.728707 |
ab69d097da84116e2fc1ac74f21204c37d2a6109 | 712 | py | Python | python/478.generate-random-point-in-a-circle.py | fengbaoheng/leetcode | 2b6ec9adea383503acc23622ca5623161f7ca520 | [
"MIT"
] | 1 | 2019-04-11T12:34:55.000Z | 2019-04-11T12:34:55.000Z | python/478.generate-random-point-in-a-circle.py | fengbaoheng/leetcode | 2b6ec9adea383503acc23622ca5623161f7ca520 | [
"MIT"
] | null | null | null | python/478.generate-random-point-in-a-circle.py | fengbaoheng/leetcode | 2b6ec9adea383503acc23622ca5623161f7ca520 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode.cn id=478 lang=python3
#
# [478] 在圆内随机生成点
#
from typing import List
from random import uniform
import math
class Solution:
def __init__(self, radius: float, x_center: float, y_center: float):
self.r = radius
self.x = x_center
self.y = y_center
self.r2 = radius ... | 22.967742 | 72 | 0.598315 |
49030fdd0e518c7d9ccba1a27e472fe5405f767b | 5,658 | py | Python | scripts/add_metadata.py | hsandt/pico-boots | 1e0e7e48f42e27496a1af5535e3782ae4830a323 | [
"MIT"
] | 6 | 2020-06-30T21:07:01.000Z | 2021-02-14T07:41:19.000Z | scripts/add_metadata.py | hsandt/pico-boots | 1e0e7e48f42e27496a1af5535e3782ae4830a323 | [
"MIT"
] | null | null | null | scripts/add_metadata.py | hsandt/pico-boots | 1e0e7e48f42e27496a1af5535e3782ae4830a323 | [
"MIT"
] | 1 | 2020-09-14T02:22:38.000Z | 2020-09-14T02:22:38.000Z | #!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
import argparse
import os
import shutil, tempfile
# This script does 3 things:
# 1. Add game title and author a.k.a. "header" at the top of source code for .p8.png
# 2. Add __label__ section from separate file for .p8.png if label_filepath is not '-' (to make up for the... | 39.84507 | 150 | 0.587487 |
cc593f43a9d002793063379abd3215c72aca2b7c | 2,784 | py | Python | app/models.py | lozog95/scrapper-graphic-cards | c1dbf2257764b4593910c791b67a5e024c9ef1da | [
"MIT"
] | null | null | null | app/models.py | lozog95/scrapper-graphic-cards | c1dbf2257764b4593910c791b67a5e024c9ef1da | [
"MIT"
] | null | null | null | app/models.py | lozog95/scrapper-graphic-cards | c1dbf2257764b4593910c791b67a5e024c9ef1da | [
"MIT"
] | null | null | null | """
Definition of models.
"""
from django.db import models
import json
import os
import app.utils as utils
from datetime import datetime
#json reader model to read output json files
def json_reader(json_path):
with open(f"app/{json_path}") as w:
try:
output = json.loads(w.read())
excep... | 34.37037 | 110 | 0.647629 |
63f746951eb9b02c84e752303153534ec6638183 | 381 | py | Python | src/test/data/pa3/AdditionalTestCase/UnitTest/Object_Method.py | Leo-Enrique-Wu/chocopy_compiler_code_generation | 4606be0531b3de77411572aae98f73169f46b3b9 | [
"BSD-2-Clause"
] | null | null | null | src/test/data/pa3/AdditionalTestCase/UnitTest/Object_Method.py | Leo-Enrique-Wu/chocopy_compiler_code_generation | 4606be0531b3de77411572aae98f73169f46b3b9 | [
"BSD-2-Clause"
] | null | null | null | src/test/data/pa3/AdditionalTestCase/UnitTest/Object_Method.py | Leo-Enrique-Wu/chocopy_compiler_code_generation | 4606be0531b3de77411572aae98f73169f46b3b9 | [
"BSD-2-Clause"
] | null | null | null | class A(object):
a:int = 1
x:str = "x in A"
def set_a(self:"A",b:int):
self.a = b
def get_a(self:"A") -> int:
return self.a
def set_x(self:"A",b:str):
self.x = b
def get_x(self:"A") -> str:
return self.x
a:A = None
a = A()
print(a.get_a())
print(a.get_x())
a.set_a... | 18.142857 | 31 | 0.52231 |
c82278d93b475dc02da31031a55404305fff9fde | 838 | py | Python | config.py | nowindxdw/flask_base | 44963513a3945ebf6cd7c4dcd7fbd67d6d8c5641 | [
"MIT"
] | null | null | null | config.py | nowindxdw/flask_base | 44963513a3945ebf6cd7c4dcd7fbd67d6d8c5641 | [
"MIT"
] | 2 | 2020-04-22T11:26:13.000Z | 2020-04-22T11:26:20.000Z | config.py | nowindxdw/flask_base | 44963513a3945ebf6cd7c4dcd7fbd67d6d8c5641 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
import os
basedir = os.path.abspath(os.path.dirname(__file__))
BASEDIR = basedir
DEBUG = False
SECRET_KEY = 'This is a secret key forexample'
# not end with else throw AttributeError: 'tuple' object has no attribute 'drivername'
SQLALCHEMY_DATABASE_URI = "mysql+pymysql://root:r... | 34.916667 | 98 | 0.745823 |
97bb15bdb693d4dacf6e0fda13f6f281263718e3 | 11,189 | py | Python | tact/classifiers.py | brunel-physics/mva_scikit | b0182da89efa466461aaf2cff4387c821df1758b | [
"BSD-3-Clause"
] | null | null | null | tact/classifiers.py | brunel-physics/mva_scikit | b0182da89efa466461aaf2cff4387c821df1758b | [
"BSD-3-Clause"
] | null | null | null | tact/classifiers.py | brunel-physics/mva_scikit | b0182da89efa466461aaf2cff4387c821df1758b | [
"BSD-3-Clause"
] | 2 | 2020-05-18T19:52:32.000Z | 2022-01-24T10:07:35.000Z | # -*- coding: utf-8 -*-
"""
This module contains functions which create and train classifiers, as well as
saving them to and reading them from disk.
A classifier function takes a DataFrame containing training data, a list
describing preprocessing steps, and a list of features. It will return a
trained scikit-learn Pi... | 29.062338 | 79 | 0.682813 |
51b69e2eba017658a7a40b090527245fc074cbbd | 12,572 | py | Python | python/ccxt/async_support/base/exchange.py | amalcaraz/ccxt | 54857b3514b857ba3b26542f7f8ca49bad7b7bb6 | [
"MIT"
] | null | null | null | python/ccxt/async_support/base/exchange.py | amalcaraz/ccxt | 54857b3514b857ba3b26542f7f8ca49bad7b7bb6 | [
"MIT"
] | null | null | null | python/ccxt/async_support/base/exchange.py | amalcaraz/ccxt | 54857b3514b857ba3b26542f7f8ca49bad7b7bb6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
__version__ = '1.28.77'
# -----------------------------------------------------------------------------
import asyncio
import concurrent
import socket
import certifi
import aiohttp
import ssl
import sys
import ya... | 41.906667 | 355 | 0.61287 |
bc02bbc38e04d660e3f2636f026843811357cd19 | 2,405 | py | Python | APIScripts/News API/News_API.py | tanvi355/Awesome_Python_Scripts | dd906dff3c311e260851f8720cbce77d7398be43 | [
"MIT"
] | 3 | 2021-06-22T07:12:31.000Z | 2022-02-27T18:40:16.000Z | APIScripts/News API/News_API.py | tanvi355/Awesome_Python_Scripts | dd906dff3c311e260851f8720cbce77d7398be43 | [
"MIT"
] | null | null | null | APIScripts/News API/News_API.py | tanvi355/Awesome_Python_Scripts | dd906dff3c311e260851f8720cbce77d7398be43 | [
"MIT"
] | 2 | 2021-10-03T16:22:08.000Z | 2021-10-03T17:35:14.000Z | from newsapi import NewsApiClient # pip install newsapi-python
import pycountry # pip install pycountry
# Fucntion to check whether Country is exists or not.
def Check(input_countries):
input_countries = [input_countries.strip()]
countries = {}
for country in pycountry.countries:
# store all th... | 40.083333 | 143 | 0.592931 |
9f2cd558c4cc0f49037bb8ec1e2064afab8bd9cc | 119 | py | Python | nachbarstrom/inference/roof_provider/__init__.py | tomasruizt/python-nachbarstrom-dl-segmentation | 7b6f6fa28ab078e372def5549c7e0a5826b208dd | [
"Apache-2.0"
] | null | null | null | nachbarstrom/inference/roof_provider/__init__.py | tomasruizt/python-nachbarstrom-dl-segmentation | 7b6f6fa28ab078e372def5549c7e0a5826b208dd | [
"Apache-2.0"
] | null | null | null | nachbarstrom/inference/roof_provider/__init__.py | tomasruizt/python-nachbarstrom-dl-segmentation | 7b6f6fa28ab078e372def5549c7e0a5826b208dd | [
"Apache-2.0"
] | null | null | null | from .roof_provider import RoofProvider, MockRoofProvider
from .tensorflow_roof_provider import TensorFlowRoofProvider
| 39.666667 | 60 | 0.89916 |
a38ae5552cb01810fdf8ad98b764d3097c6f1a49 | 18,989 | py | Python | astropy/io/fits/tests/test_fitstime.py | Chelwin/astropy | 8e5bf8d93da935b4414ecc94384088171c4fb00e | [
"BSD-3-Clause"
] | null | null | null | astropy/io/fits/tests/test_fitstime.py | Chelwin/astropy | 8e5bf8d93da935b4414ecc94384088171c4fb00e | [
"BSD-3-Clause"
] | null | null | null | astropy/io/fits/tests/test_fitstime.py | Chelwin/astropy | 8e5bf8d93da935b4414ecc94384088171c4fb00e | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from . import FitsTestCase
from astropy.io.fits.fitstime import GLOBAL_TIME_INFO, time_to_fits, is_time_column_keyword
from astropy.coordinates import EarthLocation
from astropy.io import fits
from astropy.table import T... | 42.961538 | 92 | 0.586339 |
70f5fbdfad920909d244fc8df3bcff6048a44c68 | 2,918 | py | Python | Plugins/UnrealEnginePython/Binaries/Win64/Lib/site-packages/tensorflow/python/estimator/estimator_lib.py | JustinACoder/H22-GR3-UnrealAI | 361eb9ef1147f8a2991e5f98c4118cd823184adf | [
"MIT"
] | 6 | 2022-02-04T18:12:24.000Z | 2022-03-21T23:57:12.000Z | Lib/site-packages/tensorflow/python/estimator/estimator_lib.py | shfkdroal/Robot-Learning-in-Mixed-Adversarial-and-Collaborative-Settings | 1fa4cd6a566c8745f455fc3d2273208f21f88ced | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/tensorflow/python/estimator/estimator_lib.py | shfkdroal/Robot-Learning-in-Mixed-Adversarial-and-Collaborative-Settings | 1fa4cd6a566c8745f455fc3d2273208f21f88ced | [
"bzip2-1.0.6"
] | 1 | 2022-02-08T03:53:23.000Z | 2022-02-08T03:53:23.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 56.115385 | 95 | 0.817341 |
d0c80e93f8774f0b9ff6d74d345a08edde422a0a | 7,747 | py | Python | cirq/google/devices/known_devices_test.py | jeffreygrover/Cirq | 17d94cf45f6b09ddf40048ddbb173e50fa293995 | [
"Apache-2.0"
] | null | null | null | cirq/google/devices/known_devices_test.py | jeffreygrover/Cirq | 17d94cf45f6b09ddf40048ddbb173e50fa293995 | [
"Apache-2.0"
] | null | null | null | cirq/google/devices/known_devices_test.py | jeffreygrover/Cirq | 17d94cf45f6b09ddf40048ddbb173e50fa293995 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 19.128395 | 77 | 0.603459 |
e95933b4111f5549213f8cd9703f976ed05c71d6 | 9,652 | py | Python | reconcile/ocp_release_ecr_mirror.py | aproddut/qontract-reconcile | 3516426d9aa0151e32c560090afa9e04e7d31871 | [
"Apache-2.0"
] | null | null | null | reconcile/ocp_release_ecr_mirror.py | aproddut/qontract-reconcile | 3516426d9aa0151e32c560090afa9e04e7d31871 | [
"Apache-2.0"
] | null | null | null | reconcile/ocp_release_ecr_mirror.py | aproddut/qontract-reconcile | 3516426d9aa0151e32c560090afa9e04e7d31871 | [
"Apache-2.0"
] | null | null | null | import base64
import logging
import sys
from urllib.parse import urlparse
from sretoolbox.container import Image
from utils.oc import OC
from utils.oc import OC_Map
from utils.ocm import OCMMap
from reconcile import queries
from utils.aws_api import AWSApi
from reconcile.status import ExitCodes
QONTRACT_INTEGRATI... | 37.266409 | 89 | 0.57097 |
b1b2d66ea4a608303ccb74d3fcca66bbe4215c6e | 19,527 | py | Python | src/transformers/tokenization_dpr.py | abufadl/transformers | c84bb6eb92b654e04a82fada26417fcdab45f3af | [
"Apache-2.0"
] | 4 | 2021-02-28T11:58:18.000Z | 2022-02-03T03:26:45.000Z | src/transformers/tokenization_dpr.py | abufadl/transformers | c84bb6eb92b654e04a82fada26417fcdab45f3af | [
"Apache-2.0"
] | 2 | 2022-03-16T13:57:37.000Z | 2022-03-16T14:00:51.000Z | src/transformers/tokenization_dpr.py | abufadl/transformers | c84bb6eb92b654e04a82fada26417fcdab45f3af | [
"Apache-2.0"
] | 1 | 2021-11-08T06:57:35.000Z | 2021-11-08T06:57:35.000Z | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# 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... | 47.510949 | 242 | 0.690275 |
a6e85c505ba111e4358880b01ba8b709363a48a7 | 1,212 | py | Python | location/International/ISO-CID/iso_alpha_3.py | vishalbelsare/classifications | e16dbc9b625ff7e233be30bfb3d432f7b026facd | [
"BSD-3-Clause"
] | 16 | 2016-02-05T22:05:55.000Z | 2022-02-18T12:23:22.000Z | location/International/ISO-CID/iso_alpha_3.py | vishalbelsare/classifications | e16dbc9b625ff7e233be30bfb3d432f7b026facd | [
"BSD-3-Clause"
] | 2 | 2018-04-06T18:07:01.000Z | 2018-11-01T21:19:42.000Z | location/International/ISO-CID/iso_alpha_3.py | vishalbelsare/classifications | e16dbc9b625ff7e233be30bfb3d432f7b026facd | [
"BSD-3-Clause"
] | 5 | 2015-04-09T01:39:00.000Z | 2020-12-27T03:02:25.000Z | # Wikipedia parser, from:
# http://gis.stackexchange.com/questions/1047/full-list-of-iso-alpha-2-and-iso-alpha-3-country-codes/151571#151571
import csv
import urllib2
from BeautifulSoup import BeautifulSoup
opener = urllib2.build_opener()
opener.addheaders = [("User-agent", "Mozilla/5.0")]
url = "http://en.wikipedia... | 33.666667 | 114 | 0.707921 |
bc94ba777ef1705443dc51220cd1597fd1077ef2 | 1,020 | py | Python | cvat/apps/dataset_repo/migrations/0001_initial.py | adasdevops/ADAS_UPDATE_STABLE | 306202b4e291b5876e3dd4fdd201c761e9d182f0 | [
"Intel",
"MIT"
] | null | null | null | cvat/apps/dataset_repo/migrations/0001_initial.py | adasdevops/ADAS_UPDATE_STABLE | 306202b4e291b5876e3dd4fdd201c761e9d182f0 | [
"Intel",
"MIT"
] | null | null | null | cvat/apps/dataset_repo/migrations/0001_initial.py | adasdevops/ADAS_UPDATE_STABLE | 306202b4e291b5876e3dd4fdd201c761e9d182f0 | [
"Intel",
"MIT"
] | 1 | 2022-03-04T09:18:30.000Z | 2022-03-04T09:18:30.000Z | # Generated by Django 3.2.12 on 2022-02-14 16:39
import cvat.apps.dataset_repo.models
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('engine', '0001_initial'),
]
operations = [
migrat... | 34 | 145 | 0.613725 |
91327d401b67be05aee292dc5ac483b660c054eb | 550 | py | Python | python/ray/serve/__init__.py | janblumenkamp/ray | 304e31b7e56ebd33f7099d97233e3feb37f495c9 | [
"Apache-2.0"
] | 1 | 2021-01-22T20:30:15.000Z | 2021-01-22T20:30:15.000Z | python/ray/serve/__init__.py | janblumenkamp/ray | 304e31b7e56ebd33f7099d97233e3feb37f495c9 | [
"Apache-2.0"
] | 3 | 2021-06-08T21:46:35.000Z | 2022-03-12T00:35:21.000Z | python/ray/serve/__init__.py | lzt-pro/ray | cc93fee4a47dc9b9f754d0b53ae2f1e4f598aeb1 | [
"Apache-2.0"
] | null | null | null | from ray.serve.policy import RoutePolicy
from ray.serve.api import (init, create_backend, delete_backend,
create_endpoint, delete_endpoint, set_traffic,
get_handle, stat, update_backend_config,
get_backend_config, accept_batch) # noqa: E4... | 42.307692 | 74 | 0.650909 |
0eb99df42485bf76c1abd1d0d45d2dfb823ef226 | 7,457 | py | Python | src/simple_template_copy/core.py | ZX1209/simple_template_copy | 8fbe783fc3a2f1ddec53da92a742b3312b1842d3 | [
"MIT"
] | null | null | null | src/simple_template_copy/core.py | ZX1209/simple_template_copy | 8fbe783fc3a2f1ddec53da92a742b3312b1842d3 | [
"MIT"
] | null | null | null | src/simple_template_copy/core.py | ZX1209/simple_template_copy | 8fbe783fc3a2f1ddec53da92a742b3312b1842d3 | [
"MIT"
] | null | null | null | from pathlib import Path
import os
from typing import Dict, List
from fuzzywuzzy import fuzz
from fuzzywuzzy import process
import shutil
import logging
def order_match(str1, str2):
"""order_match"""
l1 = len(str1)
l2 = len(str2)
i = 0
j = 0
if l1 > l2:
return 0
while i < l1 and ... | 28.033835 | 81 | 0.577444 |
9a5fccb83c2997481811e79b5be0c2adc39a6e91 | 94 | py | Python | mach_eval/analyzers/spm/__init__.py | Severson-Group/MachEval | dbb7999188133f8744636da53cab475ae538ce80 | [
"BSD-3-Clause"
] | 6 | 2021-11-02T20:12:32.000Z | 2021-11-13T10:50:35.000Z | mach_eval/analyzers/spm/__init__.py | Severson-Group/MachEval | dbb7999188133f8744636da53cab475ae538ce80 | [
"BSD-3-Clause"
] | 18 | 2021-11-29T20:14:55.000Z | 2022-03-02T07:17:37.000Z | mach_eval/analyzers/spm/__init__.py | Severson-Group/MachEval | dbb7999188133f8744636da53cab475ae538ce80 | [
"BSD-3-Clause"
] | 1 | 2022-01-29T00:52:38.000Z | 2022-01-29T00:52:38.000Z | # -*- coding: utf-8 -*-
"""
Created on Mon May 30 11:02:22 2022
@author: Martin Johnson
"""
| 11.75 | 35 | 0.595745 |
bb4723f5aa13f2675f9441b54118a8c5ec9120f2 | 4,069 | py | Python | agegendernet.py | duongntbk/AgeGenderNet | f5d05e54a06a76697ef710cf7f6ccc30dc574ca5 | [
"MIT"
] | 1 | 2021-03-17T07:39:27.000Z | 2021-03-17T07:39:27.000Z | agegendernet.py | duongntbk/AgeGenderNet | f5d05e54a06a76697ef710cf7f6ccc30dc574ca5 | [
"MIT"
] | 8 | 2020-09-25T22:34:53.000Z | 2022-02-10T01:37:29.000Z | agegendernet.py | duongntbk/AgeGenderNet | f5d05e54a06a76697ef710cf7f6ccc30dc574ca5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import copy
from keras.layers import Concatenate, Dense, Dropout, Flatten, Input
from keras.models import Model
class AgeGenderNet:
'''
This class is used to build AgeGenderNet model.
It does not perform any training or evaluation.
AgeGenderNet is based on VGG19 architecture,... | 36.990909 | 90 | 0.640452 |
5cdc5bb1ff1b57a1c168a9f240b2928e063bea64 | 228 | py | Python | 0x0B-python-input_output/10-main_2.py | ricardo1470/holbertonschool-higher_level_programming | aab73c8efee665b0215958ee7b338871f13634bc | [
"CNRI-Python"
] | 1 | 2019-05-21T09:34:41.000Z | 2019-05-21T09:34:41.000Z | 0x0B-python-input_output/10-main_2.py | ricardo1470/holbertonschool-higher_level_programming | aab73c8efee665b0215958ee7b338871f13634bc | [
"CNRI-Python"
] | null | null | null | 0x0B-python-input_output/10-main_2.py | ricardo1470/holbertonschool-higher_level_programming | aab73c8efee665b0215958ee7b338871f13634bc | [
"CNRI-Python"
] | 1 | 2020-09-25T17:54:36.000Z | 2020-09-25T17:54:36.000Z | #!/usr/bin/python3
MyClass = __import__('10-my_class_2').MyClass
class_to_json = __import__('10-class_to_json').class_to_json
m = MyClass("John")
m.win()
print(type(m))
print(m)
mj = class_to_json(m)
print(type(mj))
print(mj)
| 17.538462 | 60 | 0.72807 |
5f0cb49bfbde079e078d775cee2c7bc3cf8948c6 | 8,236 | py | Python | tensorflow_datasets/object_detection/lvis/lvis.py | shubhamkumaR630/datasets | fe9ee91849cefed0953141ea3588f73b7def78fd | [
"Apache-2.0"
] | 2 | 2022-02-14T09:51:39.000Z | 2022-02-14T13:27:49.000Z | tensorflow_datasets/object_detection/lvis/lvis.py | shubhamkumaR630/datasets | fe9ee91849cefed0953141ea3588f73b7def78fd | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/object_detection/lvis/lvis.py | shubhamkumaR630/datasets | fe9ee91849cefed0953141ea3588f73b7def78fd | [
"Apache-2.0"
] | 1 | 2020-12-13T22:11:33.000Z | 2020-12-13T22:11:33.000Z | # coding=utf-8
# Copyright 2022 The TensorFlow Datasets 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 appl... | 32.68254 | 110 | 0.637445 |
6a239919b5def9a7a78127b46aa0676c481febe2 | 1,927 | py | Python | build/lib/pyostie/utils.py | anirudhpnbb/Pyostie | c9ef56529ff7938262ee7df2b88bad8016dec857 | [
"MIT"
] | 3 | 2021-04-19T13:48:40.000Z | 2021-08-05T14:53:29.000Z | build/lib/pyostie/utils.py | anirudhpnbb/Pyostie | c9ef56529ff7938262ee7df2b88bad8016dec857 | [
"MIT"
] | 33 | 2021-04-20T09:58:47.000Z | 2021-09-30T12:34:10.000Z | pyostie/utils.py | anirudhpnbb/Pyostie | c9ef56529ff7938262ee7df2b88bad8016dec857 | [
"MIT"
] | 6 | 2021-04-29T21:50:42.000Z | 2022-02-10T22:03:53.000Z | import os
import shutil
import datetime
import tempfile
import pydub
extensions = {"jpeg": "jpg", "tiff":"jpg", "tif": "jpg", "png": "jpg", "":"txt", "log":"txt", "xls": "xlsx", "mp3":"wav"}
def process_files(file_list, output_path, folder_name):
try:
if os.path.isdir(folder_name):
x = dateti... | 29.646154 | 121 | 0.606642 |
27a9a22676d49d6133170ce2ac3f1649a846e2ae | 896 | py | Python | profile/forms.py | all-out/all-out-website | 99e1faee7aaceb311a784ec874e02d0338ae1c37 | [
"Apache-2.0"
] | null | null | null | profile/forms.py | all-out/all-out-website | 99e1faee7aaceb311a784ec874e02d0338ae1c37 | [
"Apache-2.0"
] | 1 | 2015-07-28T17:56:53.000Z | 2015-07-31T04:29:32.000Z | profile/forms.py | all-out/all-out-website | 99e1faee7aaceb311a784ec874e02d0338ae1c37 | [
"Apache-2.0"
] | null | null | null | from django import forms
from django.contrib.auth import get_user_model
from profile.models import Character
class UserModelForm(forms.ModelForm):
main_character = forms.ModelChoiceField(
queryset=Character.objects.filter(main_user=None),
required=False)
characters = forms.ModelMult... | 29.866667 | 70 | 0.683036 |
62abdb4b9402c2644cfdd585f974fa4a1795625e | 13,787 | py | Python | members/meeting_invites.py | louking/members | ee204211812e00945f9e2b09cfa130cc9d3e6558 | [
"Apache-2.0"
] | 1 | 2020-12-07T02:52:01.000Z | 2020-12-07T02:52:01.000Z | members/meeting_invites.py | louking/members | ee204211812e00945f9e2b09cfa130cc9d3e6558 | [
"Apache-2.0"
] | 496 | 2020-02-12T15:48:26.000Z | 2022-03-23T11:17:27.000Z | members/meeting_invites.py | louking/members | ee204211812e00945f9e2b09cfa130cc9d3e6558 | [
"Apache-2.0"
] | null | null | null | """
meeting_invites - support for meeting invitation management
====================================================================================
"""
# standard
from uuid import uuid4
from datetime import datetime
# pypi
from flask import g, render_template
import inflect
# homegrown
from .model import db
from .mo... | 41.032738 | 137 | 0.674403 |
6b2acff5eb83631fc165d30afc0961389a22f340 | 1,606 | py | Python | tapdance/install_helper.py | dataops-tk/tapdance | 9ba09ab1625bb3bb49ca7cc4fe659402280b038f | [
"MIT"
] | 8 | 2020-04-23T05:45:38.000Z | 2020-08-29T23:26:58.000Z | tapdance/install_helper.py | aaronsteers/tapdance | 9ba09ab1625bb3bb49ca7cc4fe659402280b038f | [
"MIT"
] | 7 | 2020-05-11T17:36:59.000Z | 2021-02-10T20:48:30.000Z | tapdance/install_helper.py | dataops-tk/tapdance | 9ba09ab1625bb3bb49ca7cc4fe659402280b038f | [
"MIT"
] | null | null | null | """tapdance.install_helper - functions to help install plugins."""
# TODO: Deprecate this module in favor of using pipx.
import os
import uio
import runnow
from logless import logged, get_logger
from tapdance import config
logging = get_logger("tapdance")
@logged(
"installing '{plugin_name}' as '{alias or p... | 30.884615 | 85 | 0.66127 |
f66b70ef55a441386636b18a215704a411c6b353 | 98,950 | py | Python | superset/views/core.py | gauravbansal2000/incubator-superset | fdc51fbd01651245033eb1cbc3a8c7f9750313b4 | [
"Apache-2.0"
] | 1 | 2019-08-13T07:46:58.000Z | 2019-08-13T07:46:58.000Z | superset/views/core.py | gauravbansal2000/incubator-superset | fdc51fbd01651245033eb1cbc3a8c7f9750313b4 | [
"Apache-2.0"
] | 5 | 2022-02-01T00:55:15.000Z | 2022-03-29T22:29:10.000Z | superset/views/core.py | gauravbansal2000/incubator-superset | fdc51fbd01651245033eb1cbc3a8c7f9750313b4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from datetime import datetime, timedelta
import json
import logging
import os
import re
import time
import traceback
from urllib import parse
fro... | 35.812523 | 90 | 0.579101 |
979233a8b18b5256d8a642c9e871d5c1c049ddf3 | 69,148 | py | Python | s2s-ft/s2s_ft/modeling_decoding.py | gregbugaj/unilm | 75c4a158ac7b0ea2dccc949e7fbd1313ae8b30f4 | [
"MIT"
] | 1 | 2021-11-07T00:30:05.000Z | 2021-11-07T00:30:05.000Z | s2s-ft/s2s_ft/modeling_decoding.py | maxpark/unilm | cd0cc7e7207dd029db9c8f11e3568fb385be6a29 | [
"MIT"
] | null | null | null | s2s-ft/s2s_ft/modeling_decoding.py | maxpark/unilm | cd0cc7e7207dd029db9c8f11e3568fb385be6a29 | [
"MIT"
] | null | null | null | # coding=utf-8
"""PyTorch BERT model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import copy
import json
import math
import logging
import tarfile
import tempfile
import shutil
import numpy as np
import torch
from torch import nn
from tor... | 46.376928 | 139 | 0.613525 |
20437982e5914558b0460ae58e3923fe5f1d8e8c | 638 | py | Python | mfr_pdb/render.py | erinspace/modular-file-renderer | acbc1ea188173832dd9d0e037b55653557a04704 | [
"Apache-2.0"
] | null | null | null | mfr_pdb/render.py | erinspace/modular-file-renderer | acbc1ea188173832dd9d0e037b55653557a04704 | [
"Apache-2.0"
] | null | null | null | mfr_pdb/render.py | erinspace/modular-file-renderer | acbc1ea188173832dd9d0e037b55653557a04704 | [
"Apache-2.0"
] | null | null | null | import os
import mfr
from mfr.core import RenderResult, get_assets_from_list
# assets must be loaded in this order
JS_ASSETS = [
"jquery-1.7.min.js",
"Three49custom.js",
"GLmol.js",
]
HERE = os.path.dirname(os.path.abspath(__file__))
TEMPLATE = os.path.join(HERE, 'templates', 'pdb.html')
def render_html... | 22.785714 | 68 | 0.681818 |
3ea7236e8206695d40fcff0e9369235e7095da9f | 660 | py | Python | contacts/migrations/0003_alter_organisation_type.py | nogalliance/aid_coordinator | 9af6413982e6f56914440c227949ce2f1cb4ebcf | [
"BSD-3-Clause"
] | null | null | null | contacts/migrations/0003_alter_organisation_type.py | nogalliance/aid_coordinator | 9af6413982e6f56914440c227949ce2f1cb4ebcf | [
"BSD-3-Clause"
] | null | null | null | contacts/migrations/0003_alter_organisation_type.py | nogalliance/aid_coordinator | 9af6413982e6f56914440c227949ce2f1cb4ebcf | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 4.0.3 on 2022-03-18 03:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contacts', '0002_alter_organisation_type'),
]
operations = [
migrations.AlterField(
model_name='organisation',
name=... | 34.736842 | 314 | 0.625758 |
a47c6a3759ea77fb09cc54f4a423d25fe069b4bf | 2,021 | py | Python | _sadm/plugin/os/user/debian/check.py | jrmsdev/pysadm | 0d6b3f0c8d870d83ab499c8d9487ec8e3a89fc37 | [
"BSD-3-Clause"
] | 1 | 2019-10-15T08:37:56.000Z | 2019-10-15T08:37:56.000Z | _sadm/plugin/os/user/debian/check.py | jrmsdev/pysadm | 0d6b3f0c8d870d83ab499c8d9487ec8e3a89fc37 | [
"BSD-3-Clause"
] | null | null | null | _sadm/plugin/os/user/debian/check.py | jrmsdev/pysadm | 0d6b3f0c8d870d83ab499c8d9487ec8e3a89fc37 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Jeremías Casteglione <jrmsdev@gmail.com>
# See LICENSE file.
from collections import deque
from os import devnull
# TODO: move pwd package funcs to utils so we can mock it for tests
from pwd import getpwnam
from _sadm.utils.cmd import call, callOutput
__all__ = ['check']
def check(env):
diff = deq... | 27.684932 | 79 | 0.624938 |
daaabf6d88b7faff27788734ce320b208447d3c0 | 3,713 | py | Python | test/functional/rpc_createmultisig.py | winnie-chaintope/tapyrus-core | 9924fd6fbb832ea6ae71f33cad19efeea3cc126d | [
"MIT"
] | null | null | null | test/functional/rpc_createmultisig.py | winnie-chaintope/tapyrus-core | 9924fd6fbb832ea6ae71f33cad19efeea3cc126d | [
"MIT"
] | null | null | null | test/functional/rpc_createmultisig.py | winnie-chaintope/tapyrus-core | 9924fd6fbb832ea6ae71f33cad19efeea3cc126d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Core developers
# Copyright (c) 2019 Chaintope Inc.
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test transaction signing using the signrawtransaction* RPCs."""
fr... | 37.505051 | 160 | 0.635874 |
32b21dcea712fb98bdb48290fecf2df848183bab | 1,995 | py | Python | support/oauth/login.py | VanMenoz92/msh | b2a1b71083065ec3ebb097c05f58e79073578ecf | [
"Apache-2.0"
] | 1 | 2021-11-29T07:46:29.000Z | 2021-11-29T07:46:29.000Z | support/oauth/login.py | VanMenoz92/msh | b2a1b71083065ec3ebb097c05f58e79073578ecf | [
"Apache-2.0"
] | null | null | null | support/oauth/login.py | VanMenoz92/msh | b2a1b71083065ec3ebb097c05f58e79073578ecf | [
"Apache-2.0"
] | 1 | 2019-05-07T22:37:26.000Z | 2019-05-07T22:37:26.000Z | from webapp3 import RequestHandler
from logging import info, exception
from json import loads
from oauth2client.client import OAuth2WebServerFlow
from module.xml_reader import XmlReader
from urllib import request
from module.dbmanager import DbManager
class Login(RequestHandler):
def get(self):
info("%s %... | 46.395349 | 139 | 0.573935 |
dcb5ec6ca3599ad79337d149db586d25d304a5fa | 3,851 | py | Python | src/model/ImpulsoNet.py | pystokes/telop_detection | a94ad87db57a0944c5060162a51f47ded784d23e | [
"Xnet",
"X11"
] | 2 | 2019-07-16T05:04:47.000Z | 2019-08-24T13:43:41.000Z | src/model/ImpulsoNet.py | pystokes/telop_detection | a94ad87db57a0944c5060162a51f47ded784d23e | [
"Xnet",
"X11"
] | null | null | null | src/model/ImpulsoNet.py | pystokes/telop_detection | a94ad87db57a0944c5060162a51f47ded784d23e | [
"Xnet",
"X11"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import os
from ..lib import optimizer
import keras
from keras.layers import Input, Dense, Flatten, BatchNormalization
from keras.layers import Conv2D, MaxPooling2D
from keras.models import Model
from keras.layers.core import Dropout
from keras import optimizers
import t... | 35.657407 | 103 | 0.618021 |
552126ccafd77e6c5f9a2adaf0ac5fac0939c239 | 2,882 | py | Python | pygcn/utils.py | darnbi/pygcn | 0201fba38c4157b3748771b6c1cea30a181d9a73 | [
"MIT"
] | null | null | null | pygcn/utils.py | darnbi/pygcn | 0201fba38c4157b3748771b6c1cea30a181d9a73 | [
"MIT"
] | null | null | null | pygcn/utils.py | darnbi/pygcn | 0201fba38c4157b3748771b6c1cea30a181d9a73 | [
"MIT"
] | null | null | null | import numpy as np
import scipy.sparse as sp
import torch
def encode_onehot(labels):
classes = np.unique(labels)
# classes = set(labels)
classes_dict = {c: np.identity(len(classes))[i, :] for i, c in enumerate(classes)}
labels_onehot = np.array(list(map(classes_dict.get, labels)),
... | 34.309524 | 98 | 0.649549 |
e56bdb8500008a6a9c4720584bd592b8d38d1c9d | 6,142 | py | Python | kairon/api/app/routers/history.py | ash-pramila/chiron | ed207d52766fcce48ebc884ac97185b2901161d4 | [
"Apache-2.0"
] | null | null | null | kairon/api/app/routers/history.py | ash-pramila/chiron | ed207d52766fcce48ebc884ac97185b2901161d4 | [
"Apache-2.0"
] | 1 | 2021-01-29T22:20:59.000Z | 2021-01-29T22:20:59.000Z | kairon/api/app/routers/history.py | ash-pramila/chiron | ed207d52766fcce48ebc884ac97185b2901161d4 | [
"Apache-2.0"
] | null | null | null | from fastapi import APIRouter
from kairon.api.auth import Authentication
from kairon.data_processor.history import ChatHistory
from kairon.api.models import Response, User, HistoryMonth
from fastapi import Depends
from typing import Text
router = APIRouter()
auth = Authentication()
@router.get("/users", response_mo... | 37.91358 | 116 | 0.731032 |
80cc7797863d711b67a9a712ac04024ce17b4c83 | 4,010 | py | Python | inference_mp4_4x_parallel.py | a1600012888/arXiv2020-RIFE | b17c6ba426da90129941ac7d6ba3287eef10b6bf | [
"MIT"
] | null | null | null | inference_mp4_4x_parallel.py | a1600012888/arXiv2020-RIFE | b17c6ba426da90129941ac7d6ba3287eef10b6bf | [
"MIT"
] | null | null | null | inference_mp4_4x_parallel.py | a1600012888/arXiv2020-RIFE | b17c6ba426da90129941ac7d6ba3287eef10b6bf | [
"MIT"
] | null | null | null | import os
import cv2
import torch
import argparse
import numpy as np
from tqdm import tqdm
from torch.nn import functional as F
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
if torch.cuda.is_available():
torch.set_grad_enabled(False)
torch.backends.cudnn.enabled = True
torch.backend... | 40.505051 | 147 | 0.600499 |
92bfd946b4c4ab5933d21f134f2c4ae4de43cd6c | 9,735 | py | Python | evaluator_graph_case.py | SparkJiao/LARCH | 93e2e103ff5e134f5a7d3501b46f510167fb99d5 | [
"Apache-2.0"
] | 5 | 2021-05-08T04:59:41.000Z | 2022-03-12T14:22:57.000Z | evaluator_graph_case.py | SparkJiao/LARCH | 93e2e103ff5e134f5a7d3501b46f510167fb99d5 | [
"Apache-2.0"
] | 1 | 2022-02-22T07:04:53.000Z | 2022-03-04T08:33:16.000Z | evaluator_graph_case.py | SparkJiao/LARCH | 93e2e103ff5e134f5a7d3501b46f510167fb99d5 | [
"Apache-2.0"
] | null | null | null | import gc
import random
import torch
import torch.backends.cudnn
from torch.utils.data import DataLoader
from tqdm import tqdm
import numpy as np
import constants
from constants import DUMP_DIR, DEVICE, TEST_BATCH_SIZE, TOT_IMG_NUM, TEST_SUB_BATCH_SIZE, TEST_DATA_LOAD_WORKERS
from datasets.eval_dataset_case_study imp... | 45.490654 | 119 | 0.564355 |
365bdbcb4f557ee63f155d5e2a6608327d73e711 | 8,239 | py | Python | homeassistant/components/apns/notify.py | maexono/home-assistant | c174b83f5408124fc7834e8282969a1e8f9cca16 | [
"Apache-2.0"
] | 2 | 2019-07-31T16:09:15.000Z | 2019-09-05T08:07:12.000Z | homeassistant/components/apns/notify.py | maexono/home-assistant | c174b83f5408124fc7834e8282969a1e8f9cca16 | [
"Apache-2.0"
] | 4 | 2021-02-08T20:31:45.000Z | 2022-03-11T23:48:46.000Z | homeassistant/components/apns/notify.py | maexono/home-assistant | c174b83f5408124fc7834e8282969a1e8f9cca16 | [
"Apache-2.0"
] | 3 | 2019-04-28T16:35:45.000Z | 2020-05-28T15:21:59.000Z | """APNS Notification platform."""
import logging
import os
import voluptuous as vol
from homeassistant.config import load_yaml_config_file
from homeassistant.const import ATTR_NAME, CONF_NAME, CONF_PLATFORM
from homeassistant.helpers import template as template_helper
import homeassistant.helpers.config_validation as... | 31.326996 | 79 | 0.622042 |
b71c209d1375acf8f5f755d756db0cb1da2c9aed | 64,006 | py | Python | nova/scheduler/utils.py | jiangbiaoah/nova | 16074287c0c60aa5b0a02ba8d03bf78a184a95fb | [
"Apache-2.0"
] | null | null | null | nova/scheduler/utils.py | jiangbiaoah/nova | 16074287c0c60aa5b0a02ba8d03bf78a184a95fb | [
"Apache-2.0"
] | null | null | null | nova/scheduler/utils.py | jiangbiaoah/nova | 16074287c0c60aa5b0a02ba8d03bf78a184a95fb | [
"Apache-2.0"
] | null | null | null | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 44.325485 | 154 | 0.669656 |
755ed878615f3116b872583908680ca36d6a33d3 | 1,298 | py | Python | xanthus/utils/benchmarking/core.py | markdouthwaite/xanthus | 8d4e64bd49e4bdec1e640d72ecffbc0a9d0f0c01 | [
"MIT"
] | 4 | 2020-07-15T21:02:46.000Z | 2020-07-17T16:35:03.000Z | xanthus/utils/benchmarking/core.py | markdouthwaite/xanthus | 8d4e64bd49e4bdec1e640d72ecffbc0a9d0f0c01 | [
"MIT"
] | 2 | 2021-11-10T19:52:54.000Z | 2022-02-10T02:11:33.000Z | xanthus/utils/benchmarking/core.py | markdouthwaite/xanthus | 8d4e64bd49e4bdec1e640d72ecffbc0a9d0f0c01 | [
"MIT"
] | null | null | null | import uuid
import json
import logging
from pathlib import Path
from datetime import datetime
import pandas as pd
TIMESTAMP_FORMAT = "%H:%M:%S.%f %y-%m-%d"
def benchmark(manager, epochs, **kwargs):
logger = logging.getLogger(f"Benchmark ({manager.name}|{kwargs})")
start = datetime.now()
records = []
... | 25.45098 | 78 | 0.639445 |
2222861312de87ea47c85dee70147889a8f0f705 | 5,050 | py | Python | scripts/tweet_scraper.py | ubclaunchpad/mimic | a5cee4e96d726d8d91f344ad86428501b63b1320 | [
"MIT"
] | 4 | 2019-02-08T06:25:29.000Z | 2020-02-12T04:29:40.000Z | scripts/tweet_scraper.py | ubclaunchpad/mimic | a5cee4e96d726d8d91f344ad86428501b63b1320 | [
"MIT"
] | 62 | 2019-02-02T22:35:38.000Z | 2022-02-26T10:17:19.000Z | scripts/tweet_scraper.py | ubclaunchpad/mimic | a5cee4e96d726d8d91f344ad86428501b63b1320 | [
"MIT"
] | 1 | 2019-07-11T22:33:49.000Z | 2019-07-11T22:33:49.000Z | """Scrapes tweets from the Twitter advanced search page."""
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.c... | 32.792208 | 79 | 0.606535 |
3e84f8db3182cd4e954b32d6863ebf64d90bbf46 | 82 | py | Python | servidor/machine_learning/turn_into_matrix.py | FelipeLimaM/ItsMyLife-Framework | c1d1ce89db1882a2594b126ac6407fca6d9255aa | [
"MIT"
] | null | null | null | servidor/machine_learning/turn_into_matrix.py | FelipeLimaM/ItsMyLife-Framework | c1d1ce89db1882a2594b126ac6407fca6d9255aa | [
"MIT"
] | null | null | null | servidor/machine_learning/turn_into_matrix.py | FelipeLimaM/ItsMyLife-Framework | c1d1ce89db1882a2594b126ac6407fca6d9255aa | [
"MIT"
] | null | null | null | # codigo legado que transforma o csv original em matriz binaria e pdf de gabrito
| 41 | 81 | 0.792683 |
784ae26036f8e69c5fe080f675f5e4a838690951 | 86 | py | Python | tests/periodicities/Business_Day/Cycle_Business_Day_400_B_5.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/periodicities/Business_Day/Cycle_Business_Day_400_B_5.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/periodicities/Business_Day/Cycle_Business_Day_400_B_5.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.tests.periodicities.period_test as per
per.buildModel((5 , 'B' , 400));
| 17.2 | 50 | 0.72093 |
193345160933aedc451907d204cdfc27e0a58274 | 724 | py | Python | tests/python/rotate_pil.py | fffy2366/image-processing | e1170b3f670e23e5728caa2716c96b90216ce4b3 | [
"MIT"
] | 38 | 2017-03-08T14:21:51.000Z | 2022-02-23T07:14:24.000Z | tests/python/rotate_pil.py | haigemsa/image-processing | e1170b3f670e23e5728caa2716c96b90216ce4b3 | [
"MIT"
] | null | null | null | tests/python/rotate_pil.py | haigemsa/image-processing | e1170b3f670e23e5728caa2716c96b90216ce4b3 | [
"MIT"
] | 16 | 2016-07-20T01:40:21.000Z | 2022-02-23T07:14:26.000Z | #!bin/evn python
# -*-coding:utf8-*-
from PIL import Image
'''
Python 之 使用 PIL 库做图像处理
http://www.cnblogs.com/way_testlife/archive/2011/04/17/2019013.html
'''
im = Image.open("/Users/fengxuting/Downloads/1463815812385A98C108.jpg")
print im.format, im.size, im.mode
out = im.rotate(45) ##逆时针旋转 45 度角。
#out = out.resize((... | 32.909091 | 71 | 0.685083 |
6ef26d4978afc498e5c695be3ab2d6a3b6fc5eb3 | 163 | py | Python | apps/announcements/apps.py | Ev1dentSnow/ArtemisAPI_django | ca7ef0ccc97114f2c5439b7b1bbc0e635facf020 | [
"MIT"
] | null | null | null | apps/announcements/apps.py | Ev1dentSnow/ArtemisAPI_django | ca7ef0ccc97114f2c5439b7b1bbc0e635facf020 | [
"MIT"
] | null | null | null | apps/announcements/apps.py | Ev1dentSnow/ArtemisAPI_django | ca7ef0ccc97114f2c5439b7b1bbc0e635facf020 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class AnnouncementsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'apps.announcements'
| 23.285714 | 56 | 0.779141 |
cb190892e9d67b6b5479c15696ec596ce34ed86d | 6,096 | py | Python | test/test_Collator.py | SethMMorton/pyicu | 910a75ebac6f6a4ee38f997320d0325230595e83 | [
"MIT"
] | 140 | 2015-04-16T02:43:31.000Z | 2022-03-08T11:52:52.000Z | test/test_Collator.py | SethMMorton/pyicu | 910a75ebac6f6a4ee38f997320d0325230595e83 | [
"MIT"
] | 140 | 2015-04-17T01:56:36.000Z | 2021-04-08T23:13:36.000Z | test/test_Collator.py | SethMMorton/pyicu | 910a75ebac6f6a4ee38f997320d0325230595e83 | [
"MIT"
] | 81 | 2015-04-16T20:17:05.000Z | 2021-09-14T06:33:00.000Z | # ====================================================================
# Copyright (c) 2005-2018 Open Source Applications Foundation.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without... | 37.62963 | 78 | 0.627625 |
e862647dcbb0c17828eef9f263a3fd5a5bfa1e9d | 1,568 | py | Python | vanitynumbers/get_word_rankings.py | Greg-s-Tutorials/vanity-numbers | 9f31f16ba7c51e704b6b0da839a47c16fe772449 | [
"MIT"
] | null | null | null | vanitynumbers/get_word_rankings.py | Greg-s-Tutorials/vanity-numbers | 9f31f16ba7c51e704b6b0da839a47c16fe772449 | [
"MIT"
] | null | null | null | vanitynumbers/get_word_rankings.py | Greg-s-Tutorials/vanity-numbers | 9f31f16ba7c51e704b6b0da839a47c16fe772449 | [
"MIT"
] | 1 | 2021-12-02T00:05:13.000Z | 2021-12-02T00:05:13.000Z | def get_word_rankings(word_groups, country_code, area_code, phone_number, number_map):
""" Takes in word groups and returns a list of all vanity numbers ranked by longest word.
Vanity numbers are returned in the form: +1-area_code-vanity_number
If there are less than five vanity numbers, random letters (p... | 30.153846 | 95 | 0.667092 |
0aa89ec1c402fafa78467d03184e56bc654b6414 | 1,989 | py | Python | examples/scheduledNotebook.py | helbonygaard/DataAppTest | eefc9e968d8fbf330458a3deff69c2cc743d79e5 | [
"Apache-2.0"
] | null | null | null | examples/scheduledNotebook.py | helbonygaard/DataAppTest | eefc9e968d8fbf330458a3deff69c2cc743d79e5 | [
"Apache-2.0"
] | null | null | null | examples/scheduledNotebook.py | helbonygaard/DataAppTest | eefc9e968d8fbf330458a3deff69c2cc743d79e5 | [
"Apache-2.0"
] | null | null | null | import time
import papermill as pm
from datetime import datetime
import json, sys
import os
def install(package):
os.system(str("python3 -m pip install " + package))
def job(): # parameterize job - naturally!
with open("subscriptionConfig.json") as jsonfile:
dictionary = json.load(jsonfile)
pm.... | 40.591837 | 277 | 0.740573 |
5ff71f42aa22e94536f515ecb4d96c60bb1f0871 | 229,312 | py | Python | src/plugins/gbp/test/test_gbp.py | 5G-Center-Chinatelecom/vpp | 63aafbbc2b2de65bf2839d59ca3a715df2e4a03f | [
"Apache-2.0"
] | 44 | 2018-12-10T09:43:46.000Z | 2022-03-18T13:30:10.000Z | src/plugins/gbp/test/test_gbp.py | 5G-Center-Chinatelecom/vpp | 63aafbbc2b2de65bf2839d59ca3a715df2e4a03f | [
"Apache-2.0"
] | 63 | 2018-06-11T09:48:35.000Z | 2021-01-05T09:11:03.000Z | src/plugins/gbp/test/test_gbp.py | 5G-Center-Chinatelecom/vpp | 63aafbbc2b2de65bf2839d59ca3a715df2e4a03f | [
"Apache-2.0"
] | 30 | 2018-03-15T09:56:48.000Z | 2021-07-13T01:58:00.000Z | #!/usr/bin/env python3
from socket import AF_INET, AF_INET6, inet_pton, inet_ntop
import unittest
from ipaddress import ip_address, IPv4Network, IPv6Network
from scapy.packet import Raw
from scapy.layers.l2 import Ether, ARP, Dot1Q
from scapy.layers.inet import IP, UDP, ICMP
from scapy.layers.inet6 import IPv6, ICMPv... | 39.005273 | 79 | 0.512856 |
1836d88cad0148297954cd1c0ac20284bc384a64 | 62 | py | Python | reamber/sm/SMMine.py | Eve-ning/reamber_base_py | 6d19c84f2c110b60e633b82b73e0516396466f56 | [
"MIT"
] | 10 | 2020-06-28T11:16:36.000Z | 2021-08-09T21:41:43.000Z | reamber/sm/SMMine.py | Eve-ning/reamberPy | 6d19c84f2c110b60e633b82b73e0516396466f56 | [
"MIT"
] | 35 | 2020-06-18T13:05:50.000Z | 2022-02-18T10:13:35.000Z | reamber/sm/SMMine.py | Eve-ning/reamber_base_py | 6d19c84f2c110b60e633b82b73e0516396466f56 | [
"MIT"
] | 2 | 2021-05-26T17:05:06.000Z | 2021-06-12T18:42:13.000Z | from reamber.base.Hit import Hit
class SMMine(Hit):
...
| 10.333333 | 32 | 0.66129 |
00d0086628827564b10910166fc8f530c03f6150 | 1,148 | py | Python | tp/tp03/solutions/4-mcat/mcat.py | UPB-FILS/sde | 7c02249b6ff4aaf0efef23d35b0a842f44903015 | [
"Apache-2.0"
] | 5 | 2020-03-09T15:53:16.000Z | 2021-03-02T08:11:19.000Z | tp/tp03/solutions/4-mcat/mcat.py | UPB-FILS/sde | 7c02249b6ff4aaf0efef23d35b0a842f44903015 | [
"Apache-2.0"
] | 101 | 2019-02-17T15:32:03.000Z | 2020-05-20T17:43:54.000Z | tp/tp03/solutions/4-mcat/mcat.py | UPB-FILS/sde | 7c02249b6ff4aaf0efef23d35b0a842f44903015 | [
"Apache-2.0"
] | 2 | 2019-04-01T11:33:54.000Z | 2020-04-02T07:39:11.000Z | import os
import sys
BUFSIZE = 10
# len (sys.argv) - the number of arguments (command line) that the program received
# sys.argv - array of strings with the arguments
# sys.argv[0] - program name
# sys.argv[1] - first argument
argc = len (sys.argv)
if (argc < 2 or argc > 3):
print ("Usage:\n\t " + sys.argv[0]+ " s... | 23.916667 | 83 | 0.605401 |
82f0f0cafe71a234e4687d8b64b4aff8cd11b72b | 7,348 | py | Python | sympy/assumptions/facts.py | nihirag/sympy | 0a2f378e73f6e1f1f992aab63b2516b12439b728 | [
"BSD-3-Clause"
] | null | null | null | sympy/assumptions/facts.py | nihirag/sympy | 0a2f378e73f6e1f1f992aab63b2516b12439b728 | [
"BSD-3-Clause"
] | null | null | null | sympy/assumptions/facts.py | nihirag/sympy | 0a2f378e73f6e1f1f992aab63b2516b12439b728 | [
"BSD-3-Clause"
] | 1 | 2018-08-25T08:05:00.000Z | 2018-08-25T08:05:00.000Z | """
Known facts in assumptions module.
This module defines the facts in ``get_known_facts()``, and supports functions
to generate the contents in ``sympy.assumptions.ask_generated`` file.
"""
from sympy.core.cache import cacheit
from sympy.assumptions import Q
from sympy.assumptions.cnf import CNF
from sympy.logic.bo... | 35.497585 | 132 | 0.645346 |
0474a5a0ccdf93da21d52fb25c881c3c3e8df9c2 | 18,382 | py | Python | test/functional/feature_bip68_sequence.py | vivuscoin/vivuscoin | ba0db89712234bf68b2d6b63ef2c420d65c7c25d | [
"MIT"
] | null | null | null | test/functional/feature_bip68_sequence.py | vivuscoin/vivuscoin | ba0db89712234bf68b2d6b63ef2c420d65c7c25d | [
"MIT"
] | null | null | null | test/functional/feature_bip68_sequence.py | vivuscoin/vivuscoin | ba0db89712234bf68b2d6b63ef2c420d65c7c25d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Copyright (c) 2021 The Vivuscoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test BIP68 implementation."""
import time
from tes... | 45.5 | 152 | 0.639811 |
3a1169e7afb607b2b4fc30cfb0a89f33666e2273 | 1,529 | py | Python | S7/augment.py | madhucharan/EVA6 | 3d5f54cfa2862bef6d6619614290c9e22e7d08bc | [
"MIT"
] | 1 | 2021-05-04T16:31:04.000Z | 2021-05-04T16:31:04.000Z | S7/augment.py | madhucharan/EVA6 | 3d5f54cfa2862bef6d6619614290c9e22e7d08bc | [
"MIT"
] | null | null | null | S7/augment.py | madhucharan/EVA6 | 3d5f54cfa2862bef6d6619614290c9e22e7d08bc | [
"MIT"
] | 6 | 2021-04-24T23:50:13.000Z | 2022-02-17T07:53:53.000Z | import albumentations as A
from albumentations.pytorch import ToTensorV2
def get_train_transform(mu, sigma):
"""
Args:
tensor (Tensor): Tensor image of size (C, H, W) to be normalized.
Returns:
Tensor: Normalized image.
"""
train_transform = A.Compose([
... | 29.980392 | 73 | 0.395029 |
a68a867656fb6f704ecf48135cf9c8078e322639 | 42,055 | py | Python | odoo/addons/website_sale/controllers/main.py | tuanquanghpvn/odoo8-tutorial | 52d25f1ca5f233c431cb9d3b24b79c3b4fb5127e | [
"MIT"
] | 1 | 2019-12-29T11:53:56.000Z | 2019-12-29T11:53:56.000Z | odoo/addons/website_sale/controllers/main.py | tuanquanghpvn/odoo8-tutorial | 52d25f1ca5f233c431cb9d3b24b79c3b4fb5127e | [
"MIT"
] | null | null | null | odoo/addons/website_sale/controllers/main.py | tuanquanghpvn/odoo8-tutorial | 52d25f1ca5f233c431cb9d3b24b79c3b4fb5127e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import werkzeug
from openerp import SUPERUSER_ID
from openerp import http
from openerp.http import request
from openerp.tools.translate import _
from openerp.addons.website.models.website import slug
from openerp.addons.web.controllers.main import login_redirect
PPG = 20 # Products Per Page
PP... | 44.834755 | 164 | 0.602307 |
0a43a3e223b2f5914d94320b59bd86a3518e27a7 | 11,938 | py | Python | Deprecated Working Pair/CLIENT/main.py | albert752/PBE | 3ea7c1659df77f338f31e4d16b2323afdb26d53d | [
"MIT"
] | null | null | null | Deprecated Working Pair/CLIENT/main.py | albert752/PBE | 3ea7c1659df77f338f31e4d16b2323afdb26d53d | [
"MIT"
] | 1 | 2018-11-14T15:40:11.000Z | 2018-11-14T15:40:11.000Z | Deprecated Working Pair/CLIENT/main.py | albert752/PBE | 3ea7c1659df77f338f31e4d16b2323afdb26d53d | [
"MIT"
] | null | null | null | from ReaderThread import ReaderThread
from query.QueryThread import QueryThreader
import gi, os, sys
gi.require_version('Gtk', '3.0')
from gi.repository import GLib, Gtk, GObject, GdkPixbuf, Gdk
from pprint import pprint as pp
WORKINGDIR = os.getcwd()
tickPath = os.path.join(WORKINGDIR, "styles", "icons", "tick.png"... | 38.140575 | 119 | 0.636455 |
d1f4c48dddad0af40f739c187f1761bcc57c828e | 65,002 | py | Python | Config.py | Crimdahl/timespinnerbingo | 66199cea2553eab114c2421373f36dec99d04fe3 | [
"MIT"
] | 1 | 2021-03-23T15:25:07.000Z | 2021-03-23T15:25:07.000Z | Config.py | Crimdahl/timespinnerbingo | 66199cea2553eab114c2421373f36dec99d04fe3 | [
"MIT"
] | 10 | 2021-03-20T21:58:06.000Z | 2021-08-29T05:56:47.000Z | Config.py | Crimdahl/timespinnerbingo | 66199cea2553eab114c2421373f36dec99d04fe3 | [
"MIT"
] | null | null | null | import os
import json
import codecs
import sys
from time import time
from tkinter import messagebox
if getattr(sys, "frozen", False):
CONFIG_PATH = os.path.join(os.path.dirname(sys.executable), "config.txt")
elif __file__:
CONFIG_PATH = os.path.join(os.path.dirname(__file__), "config.txt")
class Config(objec... | 34.085999 | 117 | 0.267484 |
db6cb4fdf7d52db969364979520c5d20b205df9b | 1,908 | py | Python | RaiderFetch/__init__.py | frc5024/RaiderFetch | 20c816eedd9d9860291a46acea43af2ecc787c21 | [
"MIT"
] | 2 | 2018-10-09T13:56:19.000Z | 2018-10-09T13:56:21.000Z | RaiderFetch/__init__.py | frc5024/RaiderFetch | 20c816eedd9d9860291a46acea43af2ecc787c21 | [
"MIT"
] | null | null | null | RaiderFetch/__init__.py | frc5024/RaiderFetch | 20c816eedd9d9860291a46acea43af2ecc787c21 | [
"MIT"
] | null | null | null | import requests
import feedparser
class Fetcher(object):
"""(optional) Pass in a github account"""
def __init__(self, account="frc5024"):
self.account = str(account)
self.feed = None
## PUBLIC ##
def fetch(self):
self.feed = feedparser.parse("https://github.com/" + self.account + ".atom")
def getFeed(... | 33.473684 | 420 | 0.666143 |
aac6a7f584513ea85a3c201e7b05a5f22c8ca4b5 | 4,221 | py | Python | tests/test_sockets_message.py | marcusrbrown/aspen | 5229bef0d9c76ec1c990532e8d4f8e8a858d3724 | [
"MIT"
] | 1 | 2021-07-07T11:49:35.000Z | 2021-07-07T11:49:35.000Z | tests/test_sockets_message.py | marcusrbrown/aspen | 5229bef0d9c76ec1c990532e8d4f8e8a858d3724 | [
"MIT"
] | null | null | null | tests/test_sockets_message.py | marcusrbrown/aspen | 5229bef0d9c76ec1c990532e8d4f8e8a858d3724 | [
"MIT"
] | null | null | null | from aspen.sockets.message import Message
from aspen.testing import assert_raises, attach_teardown
def test_message_can_be_instantiated_from_bytes():
expected = Message
actual = Message.from_bytes('3:::').__class__
assert actual is expected, actual
def test_from_bytes_too_few_colons_raises_SyntaxError():... | 34.040323 | 79 | 0.657427 |
5e18e31eca0b6350084ec39d6b930c1c93ec2be5 | 20,071 | py | Python | goblet/resources/routes.py | davidyum/goblet | 11a0bdf2dcdd3e951e5106902e9551051d4e3227 | [
"Apache-2.0"
] | null | null | null | goblet/resources/routes.py | davidyum/goblet | 11a0bdf2dcdd3e951e5106902e9551051d4e3227 | [
"Apache-2.0"
] | null | null | null | goblet/resources/routes.py | davidyum/goblet | 11a0bdf2dcdd3e951e5106902e9551051d4e3227 | [
"Apache-2.0"
] | null | null | null | from collections import OrderedDict
from time import sleep
from marshmallow.schema import Schema
from ruamel import yaml
import base64
import logging
import re
from typing import get_type_hints
from apispec import APISpec
from apispec.ext.marshmallow import MarshmallowPlugin
import goblet
from goblet.handler import Ha... | 35.461131 | 125 | 0.559663 |
fcc4645f49b23afa4f29a3f723772740bf9979e8 | 4,877 | py | Python | demo.py | xintao222/PoseDetect | 409fe7dc56f96771044fcf8a90fad1d771c53b78 | [
"BSD-3-Clause"
] | 6 | 2020-12-27T01:59:31.000Z | 2022-03-26T03:34:46.000Z | demo.py | xintao222/PoseDetect | 409fe7dc56f96771044fcf8a90fad1d771c53b78 | [
"BSD-3-Clause"
] | null | null | null | demo.py | xintao222/PoseDetect | 409fe7dc56f96771044fcf8a90fad1d771c53b78 | [
"BSD-3-Clause"
] | 5 | 2020-11-11T08:19:17.000Z | 2022-03-10T07:50:14.000Z | import torch
from torch.autograd import Variable
import torch.nn.functional as F
import torchvision.transforms as transforms
import torch.nn as nn
import torch.utils.data
import numpy as np
from opt import opt
from dataloader import ImageLoader, DetectionLoader, DetectionProcessor, DataWriter, Mscoco
from yolo.util i... | 36.125926 | 148 | 0.57925 |
3c4ac18d847fd1fa36c2073d2d8591e17788b583 | 4,393 | py | Python | Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/holiday_parser_config.py | XiaoxiaoMa0815/Recognizers-Text | d9a4bc939348bd79b5982345255961dff5f356c6 | [
"MIT"
] | 1 | 2020-12-02T03:35:04.000Z | 2020-12-02T03:35:04.000Z | Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/holiday_parser_config.py | XiaoxiaoMa0815/Recognizers-Text | d9a4bc939348bd79b5982345255961dff5f356c6 | [
"MIT"
] | 76 | 2018-11-09T18:19:44.000Z | 2019-08-20T20:29:53.000Z | Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/holiday_parser_config.py | XiaoxiaoMa0815/Recognizers-Text | d9a4bc939348bd79b5982345255961dff5f356c6 | [
"MIT"
] | 6 | 2017-05-04T17:24:59.000Z | 2019-07-23T15:48:44.000Z | from typing import List, Dict, Callable
from datetime import datetime
from recognizers_text.utilities import RegExpUtility
from ..utilities import DateUtils, HolidayFunctions
from ..base_holiday import BaseHolidayParserConfiguration
from ...resources.spanish_date_time import SpanishDateTime
class SpanishHolidayParse... | 38.2 | 129 | 0.689051 |
7c5566ecc73162c53c9ec893bd93dc1858e337e7 | 55,624 | py | Python | uvtools/plot.py | LBJ-Wade/uvtools | b1bbe5fd8cff06354bed6ca4ab195bf82b8db976 | [
"MIT"
] | null | null | null | uvtools/plot.py | LBJ-Wade/uvtools | b1bbe5fd8cff06354bed6ca4ab195bf82b8db976 | [
"MIT"
] | 122 | 2017-06-26T21:09:41.000Z | 2022-03-29T17:36:09.000Z | uvtools/plot.py | LBJ-Wade/uvtools | b1bbe5fd8cff06354bed6ca4ab195bf82b8db976 | [
"MIT"
] | 1 | 2018-01-27T06:58:54.000Z | 2018-01-27T06:58:54.000Z | import numpy as np
import warnings
from astropy import units
from scipy.stats import binned_statistic_2d
from . import utils
def data_mode(data, mode='abs'):
"""
Apply filter to data according to a chosen plotting mode.
Parameters
----------
data : array_like
Array of data to be plotted (... | 38.203297 | 90 | 0.612469 |
5e19a61cae76534b81a3cca26eaff1acc4152739 | 798 | py | Python | hotword/run_with_gui.py | WqVoon/PythonHomework | ed72b36101beb01065d8d46056fa1b9bdf78bc49 | [
"MIT"
] | null | null | null | hotword/run_with_gui.py | WqVoon/PythonHomework | ed72b36101beb01065d8d46056fa1b9bdf78bc49 | [
"MIT"
] | 1 | 2021-01-08T12:39:19.000Z | 2021-01-08T12:39:19.000Z | hotword/run_with_gui.py | WqVoon/PythonHomework | ed72b36101beb01065d8d46056fa1b9bdf78bc49 | [
"MIT"
] | null | null | null | from backend.cp import ContentProvider as CP
from frontend.ui import ClsChooser, FormChooser
from frontend.drawers import Drawers
from utils import Loger, SUPPORTED_KEYS
import tkinter as tk
Loger.is_debug_mode = True
def gen_btn_action(c, f):
"""
利用闭包生成一个绑定了 ClsChooser 和 FormChooser 的动作函数
"""
def inner_func():
... | 20.461538 | 68 | 0.733083 |
bfa0b22cbb67268874cfb57d2601df22620b5611 | 122 | py | Python | src/tictactoe/urls.py | kardandon/ChatAPP_websockets | fe1e567253774332b12527c73f4c51785d4c67a0 | [
"MIT"
] | null | null | null | src/tictactoe/urls.py | kardandon/ChatAPP_websockets | fe1e567253774332b12527c73f4c51785d4c67a0 | [
"MIT"
] | null | null | null | src/tictactoe/urls.py | kardandon/ChatAPP_websockets | fe1e567253774332b12527c73f4c51785d4c67a0 | [
"MIT"
] | null | null | null | from django.urls import path, re_path
from . import views
urlpatterns = [
path('', views.index, name='tictactoe'),
] | 17.428571 | 44 | 0.688525 |
12bbbfe679a33bed6131ca53a2fe16c1858b50b7 | 311 | py | Python | data/multilingual/Cyrl.TYV/Sun-ExtA_16/pdf_to_json_test_Cyrl.TYV_Sun-ExtA_16.py | antoinecarme/pdf_to_json_tests | d57a024fde862e698d916a1178f285883d7a3b2f | [
"BSD-3-Clause"
] | 1 | 2021-09-19T19:47:35.000Z | 2021-09-19T19:47:35.000Z | data/multilingual/Cyrl.TYV/Sun-ExtA_16/pdf_to_json_test_Cyrl.TYV_Sun-ExtA_16.py | antoinecarme/pdf_to_json_tests | d57a024fde862e698d916a1178f285883d7a3b2f | [
"BSD-3-Clause"
] | null | null | null | data/multilingual/Cyrl.TYV/Sun-ExtA_16/pdf_to_json_test_Cyrl.TYV_Sun-ExtA_16.py | antoinecarme/pdf_to_json_tests | d57a024fde862e698d916a1178f285883d7a3b2f | [
"BSD-3-Clause"
] | null | null | null | import pdf_to_json as p2j
import json
url = "file:data/multilingual/Cyrl.TYV/Sun-ExtA_16/udhr_Cyrl.TYV_Sun-ExtA_16.pdf"
lConverter = p2j.pdf_to_json.pdf_to_json_converter()
lConverter.mImageHashOnly = True
lDict = lConverter.convert(url)
print(json.dumps(lDict, indent=4, ensure_ascii=False, sort_keys=True))
| 31.1 | 81 | 0.810289 |
aa5fb2d41e9f21155d2004e873f019d01776ea4c | 7,167 | py | Python | yum/cli.py | HalfDeadPie/Yum4FIT | e47ae12f9da037c5c56277ae3e58d8d29b9692d0 | [
"MIT"
] | 1 | 2018-02-12T15:48:59.000Z | 2018-02-12T15:48:59.000Z | yum/cli.py | HalfDeadPie/Yum4FIT | e47ae12f9da037c5c56277ae3e58d8d29b9692d0 | [
"MIT"
] | 1 | 2018-02-11T09:36:21.000Z | 2018-02-11T09:36:21.000Z | yum/cli.py | HalfDeadPie/Yum4FIT | e47ae12f9da037c5c56277ae3e58d8d29b9692d0 | [
"MIT"
] | null | null | null | import click
import yum.Parser as Parser
import yum.account as acc
import yum.state as state
import yum.yum as yum
from yum import connector, gui
from flask import json
import yum.CONSTANTS as CONST
@click.group('yum')
@click.option('--config', '-c', default='config.cfg',
help='Path of the auth config f... | 38.12234 | 150 | 0.635831 |
ffa793eb9ed0928c0463de593473b42788cec054 | 3,646 | py | Python | tools/python/boutiques/puller.py | joeyzhou98/boutiques | 2ec2e9f2df61c63a64330bb0786f5b3ba90352fe | [
"MIT"
] | 2 | 2016-11-01T15:08:37.000Z | 2018-09-07T20:56:43.000Z | tools/python/boutiques/puller.py | joeyzhou98/boutiques | 2ec2e9f2df61c63a64330bb0786f5b3ba90352fe | [
"MIT"
] | null | null | null | tools/python/boutiques/puller.py | joeyzhou98/boutiques | 2ec2e9f2df61c63a64330bb0786f5b3ba90352fe | [
"MIT"
] | 1 | 2018-03-20T15:51:00.000Z | 2018-03-20T15:51:00.000Z | import requests
import urllib
import os
from boutiques.logger import raise_error, print_info
from boutiques.searcher import Searcher
from boutiques.zenodoHelper import ZenodoError
try:
# Python 3
from urllib.request import urlopen
from urllib.request import urlretrieve
except ImportError:
# Python 2
... | 41.431818 | 79 | 0.518651 |
271c7a5901e5d4bbee6fb3be6375c57d8030ac76 | 698 | py | Python | dai05shou/code5-8.py | naoshige314/workshop01 | 5c7be08f99eb164b7901628de26cecfd04fa926f | [
"MIT"
] | null | null | null | dai05shou/code5-8.py | naoshige314/workshop01 | 5c7be08f99eb164b7901628de26cecfd04fa926f | [
"MIT"
] | null | null | null | dai05shou/code5-8.py | naoshige314/workshop01 | 5c7be08f99eb164b7901628de26cecfd04fa926f | [
"MIT"
] | 2 | 2021-06-10T11:53:02.000Z | 2021-06-20T15:43:39.000Z | def chmin(a, b):
if a > b:
return b
else:
return a
S = list("logistic")
T = list("algorithm")
INF = 1000000000000000000000
dp = [[INF for j in range(len(T) + 1)] for i in range(len(S) + 1)]
dp[0][0] = 0
for i in range(len(S) + 1):
for j in range(len(T) + 1):
if i > 0 and j > 0:
... | 25.851852 | 66 | 0.408309 |
f071c8e2949607474e0a7acede5014f9b67492bf | 25,125 | py | Python | terracotta/globals/manager.py | kvshamray/terracota | 8f6419693a2add12c0cd27005e6f58f8295ad7e6 | [
"Apache-2.0"
] | 1 | 2020-01-21T11:31:39.000Z | 2020-01-21T11:31:39.000Z | terracotta/globals/manager.py | kvshamray/terracota | 8f6419693a2add12c0cd27005e6f58f8295ad7e6 | [
"Apache-2.0"
] | null | null | null | terracotta/globals/manager.py | kvshamray/terracota | 8f6419693a2add12c0cd27005e6f58f8295ad7e6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 Anton Beloglazov
#
# 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,... | 38.893189 | 79 | 0.608995 |
2f84b4ac77f17db4911e46a6b3ece511d5d72154 | 3,143 | py | Python | src/modules/powerswitch.py | mpember/aiyprojects-raspbian | 0fab1d56b278a07fb64a99ecbc4838ffdbca813a | [
"Apache-2.0"
] | null | null | null | src/modules/powerswitch.py | mpember/aiyprojects-raspbian | 0fab1d56b278a07fb64a99ecbc4838ffdbca813a | [
"Apache-2.0"
] | null | null | null | src/modules/powerswitch.py | mpember/aiyprojects-raspbian | 0fab1d56b278a07fb64a99ecbc4838ffdbca813a | [
"Apache-2.0"
] | 2 | 2019-01-22T11:16:16.000Z | 2019-04-13T05:46:48.000Z | import configparser
import logging
import aiy.audio
import requests
import json
from modules.mqtt import Mosquitto
# PowerSwitch: Send MQTT command to control remote devices
# ================================
#
class PowerSwitch(object):
""" Control power sockets"""
def __init__(self, configPath, remotePa... | 29.933333 | 113 | 0.562202 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.