hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3f372f778c46e09e9295a501d1163b5145f2f35e | 6,535 | py | Python | update-version.py | JOCKCERJON/TEMP | 3fa77e0cf5c8b9cdec36f916759ae8ea46076537 | [
"BSD-3-Clause"
] | 1,402 | 2015-01-23T02:50:26.000Z | 2022-03-26T09:42:31.000Z | update-version.py | snobalfyte/HashCheck | 3fa77e0cf5c8b9cdec36f916759ae8ea46076537 | [
"BSD-3-Clause"
] | 68 | 2015-08-29T17:10:23.000Z | 2021-09-27T16:33:09.000Z | update-version.py | snobalfyte/HashCheck | 3fa77e0cf5c8b9cdec36f916759ae8ea46076537 | [
"BSD-3-Clause"
] | 214 | 2015-02-04T04:17:50.000Z | 2022-03-31T11:43:01.000Z | #!/usr/bin/python3
#
# Version updater
# Copyright (C) 2016 Christopher Gurnee. All rights reserved.
#
# Please refer to readme.md for information about this source code.
# Please refer to license.txt for details about distribution and modification.
#
# Updates various version constants based on HASHCHECK_VERS... | 44.455782 | 126 | 0.605662 | #!/usr/bin/python3
#
# Version updater
# Copyright (C) 2016 Christopher Gurnee. All rights reserved.
#
# Please refer to readme.md for information about this source code.
# Please refer to license.txt for details about distribution and modification.
#
# Updates various version constants based on HASHCHECK_VERS... | 0 | 589 | 0 | 0 | 0 | 62 | 0 | 12 | 46 |
a3ebfa1c510844dfb90ae19113ead659e155cc9b | 2,337 | py | Python | youtube_dl_cli/download_youtube_video.py | CarsonSlovoka/youtube-dl-cli | 80de0ef2500f58292723532d372b740a964635f5 | [
"Apache-2.0"
] | 1 | 2020-10-26T13:51:39.000Z | 2020-10-26T13:51:39.000Z | youtube_dl_cli/download_youtube_video.py | CarsonSlovoka/youtube-dl-cli | 80de0ef2500f58292723532d372b740a964635f5 | [
"Apache-2.0"
] | null | null | null | youtube_dl_cli/download_youtube_video.py | CarsonSlovoka/youtube-dl-cli | 80de0ef2500f58292723532d372b740a964635f5 | [
"Apache-2.0"
] | 1 | 2020-04-02T07:26:49.000Z | 2020-04-02T07:26:49.000Z | __all__ = ('YoutubeKeeper', 'YLFormat')
from .structured import YLFormat
from tkinter import Tk
if 'withdraw tk':
try:
Tk().withdraw()
except:
...
| 35.953846 | 129 | 0.521181 | __all__ = ('YoutubeKeeper', 'YLFormat')
import youtube_dl
import os
from sys import stderr
from pathlib import Path
from .structured import YLFormat
from typing import List, Tuple, Sequence, Iterable
from tkinter.messagebox import askokcancel
from tkinter import Tk
if 'withdraw tk':
try:
Tk().withdraw(... | 0 | 1,895 | 0 | 72 | 0 | 0 | 0 | 38 | 159 |
1df9a7cb640b2a0805ab34095d6a3e9d2d288e1e | 4,778 | py | Python | data/convert_data_ukbb2964.py | vukadinovic936/ukbb_cardiac | ea2840fca2df2ba4ca6c6d386a2493c3d8c92bde | [
"Apache-2.0"
] | 82 | 2018-04-07T19:29:25.000Z | 2022-03-03T02:48:17.000Z | data/convert_data_ukbb2964.py | vukadinovic936/ukbb_cardiac | ea2840fca2df2ba4ca6c6d386a2493c3d8c92bde | [
"Apache-2.0"
] | 12 | 2018-04-03T09:43:15.000Z | 2021-11-17T20:04:29.000Z | data/convert_data_ukbb2964.py | vukadinovic936/ukbb_cardiac | ea2840fca2df2ba4ca6c6d386a2493c3d8c92bde | [
"Apache-2.0"
] | 42 | 2018-01-07T18:55:30.000Z | 2022-02-24T13:55:31.000Z | # Copyright 2017, Wenjia Bai. 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 ... | 47.78 | 106 | 0.589787 | # Copyright 2017, Wenjia Bai. 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 ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -26 | 110 |
38a6c61c2b962bdeef42096f6686ad596fe0b0bc | 757 | py | Python | a-practical-introduction-to-python-programming-brian-heinold/chapter-02/exercise-09.py | elarabyelaidy19/awesome-reading | 5c01a4272ba58e4f7ea665aab14b4c0aa252ea89 | [
"MIT"
] | 31 | 2021-11-02T19:51:13.000Z | 2022-02-17T10:55:26.000Z | a-practical-introduction-to-python-programming-brian-heinold/chapter-02/exercise-09.py | MosTafaHoSamm/awesome-reading | 469408fefc049d78ed53a2b2331b5d5cecdc6c06 | [
"MIT"
] | 1 | 2022-01-18T12:27:54.000Z | 2022-01-18T12:27:54.000Z | a-practical-introduction-to-python-programming-brian-heinold/chapter-02/exercise-09.py | MosTafaHoSamm/awesome-reading | 469408fefc049d78ed53a2b2331b5d5cecdc6c06 | [
"MIT"
] | 3 | 2022-01-11T05:01:34.000Z | 2022-02-05T14:36:29.000Z | # The Fibonacci numbers are the sequence below, where the first two numbers are 1, and each
# number thereafter is the sum of the two preceding numbers. Write a program that asks the
# user how many Fibonacci numbers to print and then prints that many.
# 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 ...
# How... | 28.037037 | 91 | 0.632761 | # The Fibonacci numbers are the sequence below, where the first two numbers are 1, and each
# number thereafter is the sum of the two preceding numbers. Write a program that asks the
# user how many Fibonacci numbers to print and then prints that many.
# 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 ...
# How... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
dbfd2b863ebf8a65643357ce4ed11a1cf0283a7d | 60,178 | py | Python | src/qdyn/pulse.py | goerz/qdynpylib | 89f76cdb07e149435fcdd7153afe3156b444b9a8 | [
"BSD-3-Clause"
] | 3 | 2016-05-09T03:21:32.000Z | 2018-04-12T08:42:50.000Z | src/qdyn/pulse.py | qucontrol/qdynpylib | 89f76cdb07e149435fcdd7153afe3156b444b9a8 | [
"BSD-3-Clause"
] | 10 | 2019-04-19T16:22:10.000Z | 2021-01-19T04:37:03.000Z | src/qdyn/pulse.py | qucontrol/qdynpylib | 89f76cdb07e149435fcdd7153afe3156b444b9a8 | [
"BSD-3-Clause"
] | 1 | 2019-06-28T18:47:32.000Z | 2019-06-28T18:47:32.000Z | """Module containing the :class:`Pulse` class and functions for initializing
pulse shapes."""
import numpy as np
from .units import UnitConvert, UnitFloat
def pulse_tgrid(T, nt, t0=0.0):
"""Return a pulse time grid suitable for an equidistant time grid of the
states between t0 and T with nt intervals. The v... | 37.10111 | 79 | 0.548057 | """Module containing the :class:`Pulse` class and functions for initializing
pulse shapes."""
import logging
import re
from collections.abc import MutableMapping
import matplotlib.pyplot as plt
import numpy as np
import scipy.fftpack
from matplotlib.gridspec import GridSpec
from numpy.fft import fft, fftfreq
from scip... | 0 | 11,485 | 0 | 38,354 | 0 | 0 | 0 | 98 | 336 |
580fe2ae21bafab826eedcd80fc69eafda308613 | 1,950 | py | Python | towhee/dag/utils/callstack.py | jeffoverflow/towhee | c576d22a4cdfc3909a3323b0d1decab87e83d26c | [
"Apache-2.0"
] | 1 | 2021-08-31T12:32:26.000Z | 2021-08-31T12:32:26.000Z | towhee/dag/utils/callstack.py | jeffoverflow/towhee | c576d22a4cdfc3909a3323b0d1decab87e83d26c | [
"Apache-2.0"
] | null | null | null | towhee/dag/utils/callstack.py | jeffoverflow/towhee | c576d22a4cdfc3909a3323b0d1decab87e83d26c | [
"Apache-2.0"
] | null | null | null | # 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... | 29.545455 | 87 | 0.618974 | # 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... | 0 | 0 | 0 | 1,334 | 0 | 0 | 0 | 0 | 23 |
5ad644287dc5486c8f56f3950ef25fd87286b222 | 81 | py | Python | juliaset/__init__.py | PageotD/juliaset | 7c1f98020eeff291fcf040cfcdf25a89e72f46a9 | [
"BSD-3-Clause"
] | null | null | null | juliaset/__init__.py | PageotD/juliaset | 7c1f98020eeff291fcf040cfcdf25a89e72f46a9 | [
"BSD-3-Clause"
] | null | null | null | juliaset/__init__.py | PageotD/juliaset | 7c1f98020eeff291fcf040cfcdf25a89e72f46a9 | [
"BSD-3-Clause"
] | 1 | 2021-08-09T06:45:43.000Z | 2021-08-09T06:45:43.000Z |
__version__ = "0.3.0" | 20.25 | 30 | 0.777778 | from .juliaset import julia
from .juliaset import JuliaSet
__version__ = "0.3.0" | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 44 |
e8d570012d3d6f62ce2e2349d25b09b740429217 | 24,567 | py | Python | src/oci/opsi/models/host_configuration_summary.py | ezequielramos/oci-python-sdk | cc4235cf217beaf9feed75760e9ce82610222762 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/opsi/models/host_configuration_summary.py | ezequielramos/oci-python-sdk | cc4235cf217beaf9feed75760e9ce82610222762 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/opsi/models/host_configuration_summary.py | ezequielramos/oci-python-sdk | cc4235cf217beaf9feed75760e9ce82610222762 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 34.073509 | 245 | 0.666138 | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 0 | 24,036 | 0 | 0 | 0 | 0 | 0 | 105 | 82 |
7bc96d131fe36d89c52069b4fce808a34c1e9e63 | 2,220 | py | Python | tests/DealtHandTests.py | cjrgreen/Bridge | c87c5f3f853f0dfbea9b41e2f7847dd4ef4f5410 | [
"MIT"
] | null | null | null | tests/DealtHandTests.py | cjrgreen/Bridge | c87c5f3f853f0dfbea9b41e2f7847dd4ef4f5410 | [
"MIT"
] | null | null | null | tests/DealtHandTests.py | cjrgreen/Bridge | c87c5f3f853f0dfbea9b41e2f7847dd4ef4f5410 | [
"MIT"
] | null | null | null | import unittest
runner = unittest.TextTestRunner()
suite = DealtHandsUnitTestSuite()
runner.run(suite)
| 50.454545 | 153 | 0.588288 | from context import Card
import unittest
from functools import reduce
class DealtHandsUnitTests(unittest.TestCase):
def setUp(self):
self.deck = Card.ShuffledDeck()
def allCardsInDeck(self):
self.assert_(len(self.deck.cards) == 52, "not 52 cards in deck")
def allCardsInHands(self)... | 0 | 0 | 0 | 1,997 | 0 | 0 | 0 | 10 | 96 |
4bbb5e6467c534130112f7f6d603cc901dbf5787 | 3,661 | py | Python | tests/test_models_functional.py | jic-dtool/dtool-gui-tk | 05b73daad05ad20f2f18b692051b257384f61698 | [
"MIT"
] | 1 | 2020-08-28T00:30:23.000Z | 2020-08-28T00:30:23.000Z | tests/test_models_functional.py | jic-dtool/dtool-gui | 05b73daad05ad20f2f18b692051b257384f61698 | [
"MIT"
] | 27 | 2020-12-17T11:33:15.000Z | 2021-02-24T14:37:34.000Z | tests/test_models_functional.py | jic-dtool/dtool-gui | 05b73daad05ad20f2f18b692051b257384f61698 | [
"MIT"
] | null | null | null | "Functional tests showing how models can be used to create/edit datasets."
| 34.214953 | 92 | 0.738596 | "Functional tests showing how models can be used to create/edit datasets."
import os
import dtoolcore.utils
from . import tmp_dir_fixture # NOQA
import pytest
def test_create_dataset(tmp_dir_fixture): # NOQA
import dtool_gui_tk.models
input_directory = os.path.join(tmp_dir_fixture, "input_directory")
... | 0 | 0 | 0 | 0 | 0 | 3,473 | 0 | -11 | 123 |
4a57f1a0ebb098b2a3935364cf2712e889e042e0 | 3,912 | py | Python | CLI_tool/cloudwatch.py | Juniper/vSRX-AWS | a9179d8b115229b1f26aec166a85261fd2352b14 | [
"Apache-2.0"
] | 18 | 2017-07-03T22:45:19.000Z | 2021-04-04T16:51:28.000Z | CLI_tool/cloudwatch.py | Juniper/vSRX-AWS | a9179d8b115229b1f26aec166a85261fd2352b14 | [
"Apache-2.0"
] | 13 | 2017-10-25T18:22:22.000Z | 2021-09-15T00:09:54.000Z | CLI_tool/cloudwatch.py | Juniper/vSRX-AWS | a9179d8b115229b1f26aec166a85261fd2352b14 | [
"Apache-2.0"
] | 23 | 2017-07-20T03:29:25.000Z | 2021-02-24T20:27:05.000Z |
line_widget_x = 0
line_widget_y = 0
| 39.918367 | 90 | 0.695297 | import sys
import os
import boto3
from botocore.exceptions import ClientError
import click
import json
import datetime
import time
import re
from util import *
line_widget_x = 0
line_widget_y = 0
def get_line_widget(stacked, metrics, region):
global line_widget_x
global line_widget_y
widget = {}
widg... | 0 | 0 | 0 | 0 | 0 | 3,640 | 0 | -60 | 294 |
a516b4bd6ffcc75cae9128c7509055239e67111c | 643 | py | Python | pyfiles/11_5808.py | StevenPZChan/pythonchallenge | 84c0e7458189f6d74e2cfbd169d854dae11d07a9 | [
"MIT"
] | null | null | null | pyfiles/11_5808.py | StevenPZChan/pythonchallenge | 84c0e7458189f6d74e2cfbd169d854dae11d07a9 | [
"MIT"
] | null | null | null | pyfiles/11_5808.py | StevenPZChan/pythonchallenge | 84c0e7458189f6d74e2cfbd169d854dae11d07a9 | [
"MIT"
] | null | null | null | from io import BytesIO
import requests
from PIL import Image
header = {'Authorization': 'Basic aHVnZTpmaWxl', }
response = requests.get('http://www.pythonchallenge.com/pc/return/cave.jpg', headers=header)
img = Image.open(BytesIO(response.content))
width, height = img.size
img_new = Image.new('RGB', (width // 2, hei... | 29.227273 | 92 | 0.62986 | from io import BytesIO
import requests
from PIL import Image
header = {'Authorization': 'Basic aHVnZTpmaWxl', }
response = requests.get('http://www.pythonchallenge.com/pc/return/cave.jpg', headers=header)
img = Image.open(BytesIO(response.content))
width, height = img.size
img_new = Image.new('RGB', (width // 2, hei... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ce348970688385f43caa2da6afef7a2e7ea9bf77 | 31,556 | py | Python | AmapFunctions/AdministrativeDistrictEnquiry.py | Gaoyifei1011/AmapProgram | d45a27abf9f508d922f37abc34f00da6d0aab4a0 | [
"MIT"
] | 1 | 2021-05-19T02:48:49.000Z | 2021-05-19T02:48:49.000Z | AmapFunctions/AdministrativeDistrictEnquiry.py | Gaoyifei1011/AmapProgram | d45a27abf9f508d922f37abc34f00da6d0aab4a0 | [
"MIT"
] | 1 | 2021-05-18T16:01:56.000Z | 2021-05-20T02:14:52.000Z | AmapFunctions/AdministrativeDistrictEnquiry.py | Gaoyifei1011/AmapProgram | d45a27abf9f508d922f37abc34f00da6d0aab4a0 | [
"MIT"
] | 1 | 2021-06-04T06:39:57.000Z | 2021-06-04T06:39:57.000Z | # -*- coding:utf-8 -*-
#
| 49.93038 | 141 | 0.414881 | # -*- coding:utf-8 -*-
# 导入的库
import inspect
import json
import time
from typing import Any
import requests
from SelfExpection.CustomExpection import CustomExpection
from SelfExpection.OfficialException import OfficialException
from logrecord.WriteLog import WriteLog
class AdministrativeDistrictEnquir... | 3,798 | 0 | 0 | 29,985 | 0 | 0 | 0 | 62 | 213 |
a6172a279a003d0b8205d4cd3bbc4af0f3ab9a0e | 1,089 | py | Python | sysdescrparser/cisco_ios.py | datadope-io/sysdescrparser | c57d595707fec902f7a5bbf2a52089f6448610c4 | [
"MIT"
] | 12 | 2015-05-12T09:07:04.000Z | 2021-11-19T13:22:54.000Z | sysdescrparser/cisco_ios.py | datadope-io/sysdescrparser | c57d595707fec902f7a5bbf2a52089f6448610c4 | [
"MIT"
] | 3 | 2020-05-10T09:59:08.000Z | 2021-02-22T17:48:26.000Z | sysdescrparser/cisco_ios.py | datadope-io/sysdescrparser | c57d595707fec902f7a5bbf2a52089f6448610c4 | [
"MIT"
] | 6 | 2018-03-04T21:51:15.000Z | 2022-02-21T16:26:54.000Z | # -*- coding: utf-8 -*-
"""sysdescrparser.cisco_ios."""
# pylint: disable=no-member
| 23.170213 | 70 | 0.520661 | # -*- coding: utf-8 -*-
"""sysdescrparser.cisco_ios."""
import re
from cisco import Cisco
# pylint: disable=no-member
class CiscoIOS(Cisco):
"""Class CiscoIOS.
SNMP sysDescr for CiscoIOS.
"""
def __init__(self, raw):
"""Constructor."""
super(CiscoIOS, self).__init__(raw)
... | 0 | 0 | 0 | 944 | 0 | 0 | 0 | -10 | 67 |
542263394693276337544bc6c2cf5359c6011319 | 1,736 | py | Python | auto_generated_scripts/discrete_prob_dist_plot.py | patel-zeel/pyprobml-fork | 4b1757c41223c36a8e7bcef729a220a23b7c5217 | [
"MIT"
] | null | null | null | auto_generated_scripts/discrete_prob_dist_plot.py | patel-zeel/pyprobml-fork | 4b1757c41223c36a8e7bcef729a220a23b7c5217 | [
"MIT"
] | 5 | 2022-03-23T12:03:49.000Z | 2022-03-24T12:18:17.000Z | auto_generated_scripts/discrete_prob_dist_plot.py | patel-zeel/pyprobml-fork | 4b1757c41223c36a8e7bcef729a220a23b7c5217 | [
"MIT"
] | 1 | 2022-03-23T06:02:01.000Z | 2022-03-23T06:02:01.000Z | #!/usr/bin/env python
# coding: utf-8
# # Discrete Probability Distribution Plot
# In[1]:
import os
try:
import jax
except:
get_ipython().run_line_magic('pip', 'install jax jaxlib')
import jax.numpy as jnp
try:
import matplotlib.pyplot as plt
except:
get_ipython().run_line_magic('pip', 'install ma... | 19.505618 | 102 | 0.678571 | #!/usr/bin/env python
# coding: utf-8
# # Discrete Probability Distribution Plot
# In[1]:
import os
try:
import jax
except:
get_ipython().run_line_magic('pip', 'install jax jaxlib')
import jax
import jax.numpy as jnp
try:
import matplotlib.pyplot as plt
except:
get_ipython().run_line_magic('pi... | 0 | 183 | 0 | 0 | 0 | 305 | 0 | 16 | 173 |
ca647cb6e242d99f50c820962c61ad7177ab3ebb | 3,241 | py | Python | bin/pwd_.py | kis87988/pybashish | c75587dc16a412e0cfaf9586da20252225ff5a08 | [
"CNRI-Python"
] | null | null | null | bin/pwd_.py | kis87988/pybashish | c75587dc16a412e0cfaf9586da20252225ff5a08 | [
"CNRI-Python"
] | null | null | null | bin/pwd_.py | kis87988/pybashish | c75587dc16a412e0cfaf9586da20252225ff5a08 | [
"CNRI-Python"
] | null | null | null | #!/usr/bin/env python3
"""
usage: pwd_.py [-h] [-P] [--brief] [--home]
show the os.environ["PWD"], by default just its "os.path.abspath"
optional arguments:
-h, --help show this help message and exit
-P, --physical show the "realpath"s, not "abspath"s, of sym links
--brief show the briefest abspa... | 26.785124 | 99 | 0.653502 | #!/usr/bin/env python3
"""
usage: pwd_.py [-h] [-P] [--brief] [--home]
show the os.environ["PWD"], by default just its "os.path.abspath"
optional arguments:
-h, --help show this help message and exit
-P, --physical show the "realpath"s, not "abspath"s, of sym links
--brief show the briefest abspa... | 0 | 0 | 0 | 0 | 0 | 1,042 | 0 | -8 | 68 |
6c0bf1ebef607bf5bf28dbf570a0813f5cc4cdcb | 279 | py | Python | snippets/popular_libraries/click-lib/intermediate-features/app_dirs.py | melvio/python3-examples | 5340fe17e0a5001a81cf195e63f825b77dc16fca | [
"Apache-2.0"
] | null | null | null | snippets/popular_libraries/click-lib/intermediate-features/app_dirs.py | melvio/python3-examples | 5340fe17e0a5001a81cf195e63f825b77dc16fca | [
"Apache-2.0"
] | null | null | null | snippets/popular_libraries/click-lib/intermediate-features/app_dirs.py | melvio/python3-examples | 5340fe17e0a5001a81cf195e63f825b77dc16fca | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import click
app_name = "myappname"
config_file_name = "myconf.ini"
app_dir_name = click.get_app_dir(app_name)
click.echo(app_dir_name)
# ./app_dirs.py
# /home/melv/.config/myappname
# XDG_CONFIG_HOME=/home/melv/ ./app_dirs.py
# /home/melv/myappname
| 16.411765 | 43 | 0.749104 | #!/usr/bin/env python3
import click
app_name = "myappname"
config_file_name = "myconf.ini"
app_dir_name = click.get_app_dir(app_name)
click.echo(app_dir_name)
# ./app_dirs.py
# /home/melv/.config/myappname
# XDG_CONFIG_HOME=/home/melv/ ./app_dirs.py
# /home/melv/myappname
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9b7929b6eca5ceecd90a6ca47f628f3cb1a32ca7 | 249 | py | Python | agpy/test_doc.py | keflavich/agpy | fb3a42d9909b7cd1ba74247530bcc8742f5aaeb1 | [
"MIT"
] | 16 | 2015-05-08T11:14:26.000Z | 2021-11-19T19:05:16.000Z | agpy/test_doc.py | keflavich/agpy | fb3a42d9909b7cd1ba74247530bcc8742f5aaeb1 | [
"MIT"
] | 3 | 2016-05-12T16:27:14.000Z | 2020-12-27T01:14:24.000Z | agpy/test_doc.py | keflavich/agpy | fb3a42d9909b7cd1ba74247530bcc8742f5aaeb1 | [
"MIT"
] | 19 | 2015-03-30T22:34:14.000Z | 2020-11-25T23:29:53.000Z | import pylab
import agpy.test_doc
print "beta.__module__:",beta.__module__
for k,v in pylab.__dict__.iteritems():
if hasattr(v,'__module__'):
if v.__module__ is None:
locals()[k].__module__ = 'pylab'
| 20.75 | 44 | 0.670683 | from pylab import *
import pylab
import agpy.test_doc
print "beta.__module__:",beta.__module__
for k,v in pylab.__dict__.iteritems():
if hasattr(v,'__module__'):
if v.__module__ is None:
locals()[k].__module__ = 'pylab'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 22 |
84f0b9b86abb65e10f3d5faa2d8140d0f4d0412a | 2,321 | py | Python | fix_voc_label.py | Dai-z/label-converters | 0da9bfa620c6ab222ed97b82c256401fcb5804cf | [
"MIT"
] | 1 | 2020-11-16T17:11:43.000Z | 2020-11-16T17:11:43.000Z | fix_voc_label.py | Dai-z/label-converters | 0da9bfa620c6ab222ed97b82c256401fcb5804cf | [
"MIT"
] | null | null | null | fix_voc_label.py | Dai-z/label-converters | 0da9bfa620c6ab222ed97b82c256401fcb5804cf | [
"MIT"
] | null | null | null | from os import listdir
import argparse
# classes = [
# "aeroplane", "bicycle", "bird", "boat", "bottle", "bus", "car", "cat",
# "chair", "cow", "diningtable", "dog", "horse", "motorbike", "person",
# "pottedplant", "sheep", "sofa", "train", "tvmonitor"
# ]
classes = []
if __name__ == "__main__":
pa... | 26.678161 | 76 | 0.557087 | import xml.etree.ElementTree as ET
import os
from os import listdir, getcwd
from os.path import join
import argparse
# classes = [
# "aeroplane", "bicycle", "bird", "boat", "bottle", "bus", "car", "cat",
# "chair", "cow", "diningtable", "dog", "horse", "motorbike", "person",
# "pottedplant", "sheep", "sof... | 0 | 0 | 0 | 0 | 0 | 1,386 | 0 | 12 | 135 |
4871c7891c9c79ec3d3449ce676340ebbba4c089 | 2,716 | py | Python | WearChristmasHat/wear_hat_cv.py | TitusWongCN/WeChatSubscriptionArticles | 7076ec764269a6d5df2075e860940ac39128a052 | [
"MIT"
] | 9 | 2020-02-26T14:06:55.000Z | 2022-01-13T13:59:58.000Z | WearChristmasHat/wear_hat_cv.py | Tomcqueen/WeChatSubscriptionArticles | b2b45f3d0a204209b30944cf28945b794515c434 | [
"MIT"
] | null | null | null | WearChristmasHat/wear_hat_cv.py | Tomcqueen/WeChatSubscriptionArticles | b2b45f3d0a204209b30944cf28945b794515c434 | [
"MIT"
] | 6 | 2020-02-26T14:09:19.000Z | 2022-01-13T14:00:00.000Z | # -*- coding=utf-8 -*-
import cv2
from PIL import Image
image_path = './face1.png'
human_img = Image.open(image_path)
human_img = human_img.convert('RGBA')
#
hat_img = Image.open("./hat.png")
hat_brim_length = 175.0
hat_height_buffer = 25.0
hat_img = hat_img.convert('RGBA')
# load image:
image = cv2.imread(image_p... | 30.863636 | 83 | 0.732327 | # -*- coding=utf-8 -*-
import cv2
from PIL import Image
import math
def get_distance(point1, point2):
return int(math.sqrt((point1[0] - point2[0])**2 + (point1[1] - point2[1])**2))
image_path = './face1.png'
human_img = Image.open(image_path)
human_img = human_img.convert('RGBA')
# 圣诞帽相关参数
hat_img = Image.open(... | 39 | 0 | 0 | 0 | 0 | 95 | 0 | -10 | 45 |
3cb54cc59f97c8f3f99e4a6438331cafd5f35199 | 5,464 | py | Python | python/itypes/struct/data_struct.py | eddy-ilg/itypes | eaf1c4a86576c77caa34148c0fdc6b2e012119ff | [
"MIT"
] | null | null | null | python/itypes/struct/data_struct.py | eddy-ilg/itypes | eaf1c4a86576c77caa34148c0fdc6b2e012119ff | [
"MIT"
] | null | null | null | python/itypes/struct/data_struct.py | eddy-ilg/itypes | eaf1c4a86576c77caa34148c0fdc6b2e012119ff | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
| 33.115152 | 119 | 0.517387 | #!/usr/bin/env python3
from ..type import is_list, is_dict
from .struct import Struct
from .helper import _common_keys
class DataStruct(Struct):
def __init__(self, *args, dims=None, **kwargs):
super().__init__(*args, **kwargs)
if dims is not None:
self.dims = dims
def clone_type(... | 0 | 0 | 0 | 5,320 | 0 | 0 | 0 | 30 | 90 |
48a0794b51a6c5c4453618ae132fe4019225282a | 2,114 | py | Python | Python/getdata.py | SanjaykrishnaanH/Beacon_RD | c2c6084499520b2d7b545562e87f05ab1ad8a426 | [
"Apache-2.0"
] | null | null | null | Python/getdata.py | SanjaykrishnaanH/Beacon_RD | c2c6084499520b2d7b545562e87f05ab1ad8a426 | [
"Apache-2.0"
] | null | null | null | Python/getdata.py | SanjaykrishnaanH/Beacon_RD | c2c6084499520b2d7b545562e87f05ab1ad8a426 | [
"Apache-2.0"
] | null | null | null | import firebase_admin
import csv
import time
from firebase_admin import credentials
from firebase_admin import firestore
cred = credentials.Certificate('beacon-dddae-firebase-adminsdk-2qj4p-4ab2ce47dd.json')
firebase_admin.initialize_app(cred)
flag=0
# print(u'{} => {}'.format(doc.id, doc.to_dict()))
while(flag==0... | 36.448276 | 98 | 0.502838 | import firebase_admin
import csv
import time
from firebase_admin import credentials
from firebase_admin import firestore
cred = credentials.Certificate('beacon-dddae-firebase-adminsdk-2qj4p-4ab2ce47dd.json')
firebase_admin.initialize_app(cred)
flag=0
# print(u'{} => {}'.format(doc.id, doc.to_dict()))
while(flag==0... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
00cbc558f577adcc477d1fa77c2ebd1010c4b13d | 34,744 | py | Python | JJ_measurements/GV_Vbias.py | QNLSydney/JJ_measurements | cad43a2dc1231ed856ede39bedb726232c772b0f | [
"MIT"
] | null | null | null | JJ_measurements/GV_Vbias.py | QNLSydney/JJ_measurements | cad43a2dc1231ed856ede39bedb726232c772b0f | [
"MIT"
] | null | null | null | JJ_measurements/GV_Vbias.py | QNLSydney/JJ_measurements | cad43a2dc1231ed856ede39bedb726232c772b0f | [
"MIT"
] | null | null | null | # GV Vbias
# Alexis Jouan 13/10/2019
# Reading AC current and AC voltage with two lockins
| 34.129666 | 113 | 0.622093 | # GV Vbias
# Alexis Jouan 13/10/2019
# Reading AC current and AC voltage with two lockins
import numpy as np
import time
from qcodes.dataset.measurements import Measurement
from qcodes.dataset.plotting import plot_by_id
from datetime import datetime
import qcodes_measurements as qcm
from qcodes_measurements.tools.mea... | 0 | 0 | 0 | 0 | 0 | 34,221 | 0 | 114 | 317 |
2d25dff6c968fa1e168d218e9f8863856d19bfa5 | 277 | py | Python | spiral.py | itspuneet/itspuneet | d44f78afcff275aa56f03bba738ac3e4f2c30843 | [
"bzip2-1.0.6"
] | null | null | null | spiral.py | itspuneet/itspuneet | d44f78afcff275aa56f03bba738ac3e4f2c30843 | [
"bzip2-1.0.6"
] | null | null | null | spiral.py | itspuneet/itspuneet | d44f78afcff275aa56f03bba738ac3e4f2c30843 | [
"bzip2-1.0.6"
] | null | null | null | for i in range (1,6):
for j in range(1,6):
print("(",i,",",j,")",end='')
print()
a=[[1,2,3,4,5],[6,7,8,9,10],[11,12,13,14,15],[16,17,18,19,20],[21,22,23,24,25]]
print(a)
n=1
for i in range (1,6):
for j in range(1,6):
print()
| 19.785714 | 80 | 0.440433 | for i in range (1,6):
for j in range(1,6):
print("(",i,",",j,")",end='')
print()
a=[[1,2,3,4,5],[6,7,8,9,10],[11,12,13,14,15],[16,17,18,19,20],[21,22,23,24,25]]
print(a)
n=1
for i in range (1,6):
for j in range(1,6):
print()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c2b9fe0498043d576c71d4299795d9efbbc5aaa3 | 2,278 | py | Python | SublimeBot.py | gearbolt/SublimeBot-ShopifyScraper | e88336b24cfec03818332da39b6803ac3536e80b | [
"MIT"
] | 10 | 2017-07-18T23:36:20.000Z | 2021-06-05T14:20:58.000Z | SublimeBot.py | gearbolt/SublimeBot-ShopifyScraper | e88336b24cfec03818332da39b6803ac3536e80b | [
"MIT"
] | null | null | null | SublimeBot.py | gearbolt/SublimeBot-ShopifyScraper | e88336b24cfec03818332da39b6803ac3536e80b | [
"MIT"
] | 1 | 2017-08-21T05:43:00.000Z | 2017-08-21T05:43:00.000Z | # Import dependencies
import time
import json
import tweepy
import urllib2
from fake_useragent import UserAgent
from datetime import datetime
print("Loading Configuration Files...")
with open('config.json') as json_data_file:
data = json.load(json_data_file)
# Access and authorize Twitter credentials
consumer_k... | 34 | 132 | 0.694469 | # Import dependencies
import time
import json
import tweepy
import urllib2
import feedparser
from fake_useragent import UserAgent
from datetime import datetime, timedelta
from credentials import *
print("Loading Configuration Files...")
with open('config.json') as json_data_file:
data = json.load(json_data_file)... | 0 | 0 | 0 | 0 | 0 | 208 | 0 | 11 | 66 |
439820f94d41a3f831e906b693f5e2ab2143b422 | 1,119 | py | Python | UpdateFunction/Ggnn.py | nadeemkajla/siamese_ged | 134808dea802b57ad41c5cfb38984e7bb22ddfb8 | [
"MIT"
] | 8 | 2018-07-06T17:00:01.000Z | 2021-09-06T15:15:42.000Z | UpdateFunction/Ggnn.py | nadeemkajla/siamese_ged | 134808dea802b57ad41c5cfb38984e7bb22ddfb8 | [
"MIT"
] | 3 | 2019-03-06T15:19:05.000Z | 2021-04-12T10:33:12.000Z | UpdateFunction/Ggnn.py | nadeemkajla/siamese_ged | 134808dea802b57ad41c5cfb38984e7bb22ddfb8 | [
"MIT"
] | 10 | 2018-07-06T17:00:03.000Z | 2021-12-02T02:51:22.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ggnn.py: Update function following the Gated Graph Neural Network (GGNN) framework.
* Bibliography: Li et al. (2016), Gated Graph Neural Networks (GG-NN)
Usage:
"""
from __future__ import print_function
import torch.nn as nn
# Own modules
__author__ = "Pa... | 22.38 | 87 | 0.643432 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ggnn.py: Update function following the Gated Graph Neural Network (GGNN) framework.
* Bibliography: Li et al. (2016), Gated Graph Neural Networks (GG-NN)
Usage:
"""
from __future__ import print_function
import torch.nn as nn
# Own modules
__author__ = "Pa... | 0 | 0 | 0 | 734 | 0 | 0 | 0 | 0 | 23 |
800a7eec9b2d6782788277f524db64aa275a938d | 633 | py | Python | hoomd/test-py/test_run_walltime.py | PetersResearchGroup/PCND | 584768cc683a6df0152ead69b567d05b781aab2b | [
"BSD-3-Clause"
] | 2 | 2020-03-30T14:38:50.000Z | 2020-06-02T05:53:41.000Z | hoomd/test-py/test_run_walltime.py | PetersResearchGroup/PCND | 584768cc683a6df0152ead69b567d05b781aab2b | [
"BSD-3-Clause"
] | null | null | null | hoomd/test-py/test_run_walltime.py | PetersResearchGroup/PCND | 584768cc683a6df0152ead69b567d05b781aab2b | [
"BSD-3-Clause"
] | 1 | 2020-05-20T07:00:08.000Z | 2020-05-20T07:00:08.000Z | # -*- coding: iso-8859-1 -*-
# Maintainer: joaander
import hoomd
hoomd.context.initialize()
import unittest
if __name__ == '__main__':
unittest.main(argv = ['test.py', '-v'])
| 25.32 | 76 | 0.620853 | # -*- coding: iso-8859-1 -*-
# Maintainer: joaander
import hoomd
hoomd.context.initialize()
import unittest
import os
class analyze_callback_tests(unittest.TestCase):
def setUp(self):
sysdef = hoomd.init.create_lattice(unitcell=hoomd.lattice.sq(a=2.0),
n=[1,2]);... | 0 | 0 | 0 | 419 | 0 | 0 | 0 | -12 | 45 |
a41f600ea41bd2f2907b4c63ee97d0a4b016604c | 282 | py | Python | supervisr/provider/debug/__init__.py | BeryJu/supervisr | 2305b1e27abb0bfe9fcee93b79e012c62cba712e | [
"MIT"
] | 1 | 2020-01-12T21:33:03.000Z | 2020-01-12T21:33:03.000Z | supervisr/provider/debug/__init__.py | BeryJu/supervisr | 2305b1e27abb0bfe9fcee93b79e012c62cba712e | [
"MIT"
] | null | null | null | supervisr/provider/debug/__init__.py | BeryJu/supervisr | 2305b1e27abb0bfe9fcee93b79e012c62cba712e | [
"MIT"
] | null | null | null | """Supervisr Mod mod/provider/onlinenet Header"""
__ui_name__ = 'Supervisr mod/mod/provider/onlinenet'
__author__ = 'Supervisr Team'
__email__ = 'supervisr@beryju.org'
__version__ = '0.3.14-alpha'
default_app_config = 'supervisr.provider.debug.apps.SupervisrModProviderDebugConfig'
| 40.285714 | 84 | 0.801418 | """Supervisr Mod mod/provider/onlinenet Header"""
__ui_name__ = 'Supervisr mod/mod/provider/onlinenet'
__author__ = 'Supervisr Team'
__email__ = 'supervisr@beryju.org'
__version__ = '0.3.14-alpha'
default_app_config = 'supervisr.provider.debug.apps.SupervisrModProviderDebugConfig'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b67a3211141343017694589fa6422b8ca9cea73c | 887 | py | Python | infrastructure/framework/falcon/app.py | pachecobruno/python-ddd | 81812848a567d4605df346ef3630718d320706cc | [
"MIT"
] | null | null | null | infrastructure/framework/falcon/app.py | pachecobruno/python-ddd | 81812848a567d4605df346ef3630718d320706cc | [
"MIT"
] | null | null | null | infrastructure/framework/falcon/app.py | pachecobruno/python-ddd | 81812848a567d4605df346ef3630718d320706cc | [
"MIT"
] | null | null | null | import falcon
from composition_root import FalconContainer
app = falcon.API()
app.set_error_serializer(error_serializer)
app.add_route('/', FalconContainer.info_controller_factory())
app.add_route('/items', FalconContainer.items_controller_factory()) | 35.48 | 70 | 0.674183 | import falcon
import yaml
from composition_root import FalconContainer
from infrastructure.framework.falcon.controllers import InfoController
def error_serializer(req, resp, exception):
representation = None
preferred = req.client_prefers(('application/x-yaml',
'application... | 0 | 0 | 0 | 0 | 0 | 528 | 0 | 39 | 67 |
4485ab8fcc90cd7f77aa5f622c046a6da5ada355 | 2,147 | py | Python | essaysense/__init__.py | zlliang/essaysense | c9bf72b2f143417e6d5be91fd000ee70e48c3923 | [
"MIT"
] | 24 | 2018-05-24T06:56:25.000Z | 2022-03-05T13:09:51.000Z | essaysense/__init__.py | deltaquincy/essaysense | c9bf72b2f143417e6d5be91fd000ee70e48c3923 | [
"MIT"
] | 3 | 2019-12-22T04:26:44.000Z | 2019-12-22T04:27:03.000Z | essaysense/__init__.py | deltaquincy/essaysense | c9bf72b2f143417e6d5be91fd000ee70e48c3923 | [
"MIT"
] | 12 | 2018-05-24T06:57:34.000Z | 2020-05-01T11:40:32.000Z | """An NLP project on Automated Essay Scoring.
Project EssaySense
==================
EssaySense is an NLP project on Automated Essay Scoring, based on neural network
technologies.
Several neural network models are included to modelling the scoring task, imple-
mented using TensorFlow (see https://tensorflow.org). Pre-... | 28.626667 | 80 | 0.706567 | """An NLP project on Automated Essay Scoring.
Project EssaySense
==================
EssaySense is an NLP project on Automated Essay Scoring, based on neural network
technologies.
Several neural network models are included to modelling the scoring task, imple-
mented using TensorFlow (see https://tensorflow.org). Pre-... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 22 |
be11e51b64c711f834138060343f0be3b5398a65 | 16,066 | py | Python | telethon/tl/custom/conversation.py | megansquire/Telethon | e5f1b2afa3482fe77aaee514bc3ec1574ada9262 | [
"MIT"
] | 2 | 2021-04-29T14:19:25.000Z | 2021-09-17T07:13:49.000Z | telethon/tl/custom/conversation.py | josh8tg/Arabic-Telethon | 10467cff74e15aa7d664e976972e1f1c4af5ae57 | [
"MIT"
] | null | null | null | telethon/tl/custom/conversation.py | josh8tg/Arabic-Telethon | 10467cff74e15aa7d664e976972e1f1c4af5ae57 | [
"MIT"
] | 1 | 2020-04-16T22:02:26.000Z | 2020-04-16T22:02:26.000Z | from ... import helpers, utils, errors
# Sometimes the edits arrive very fast (within the same second).
# In that case we add a small delta so that the age is older, for
# comparision purposes. This value is enough for up to 1000 messages.
_EDIT_COLLISION_DELTA = 0.001
| 35.30989 | 87 | 0.608614 | import asyncio
import itertools
import time
from .chatgetter import ChatGetter
from ... import helpers, utils, errors
from ...events.common import EventCommon
# Sometimes the edits arrive very fast (within the same second).
# In that case we add a small delta so that the age is older, for
# comparision purposes. This... | 0 | 0 | 7,016 | 8,610 | 0 | 0 | 0 | 10 | 157 |
f1a6af247fbbfca805569215362ba5bc2e531f8a | 1,142 | py | Python | tests/test_dat.py | astrogewgaw/priwo | cc3ef488b6e9a36fb5d633d6c2c6135274b2c7b7 | [
"MIT"
] | 7 | 2021-04-24T12:16:11.000Z | 2021-12-31T14:46:35.000Z | tests/test_dat.py | astrogewgaw/priwo | cc3ef488b6e9a36fb5d633d6c2c6135274b2c7b7 | [
"MIT"
] | null | null | null | tests/test_dat.py | astrogewgaw/priwo | cc3ef488b6e9a36fb5d633d6c2c6135274b2c7b7 | [
"MIT"
] | null | null | null | import numpy as np
from pathlib import Path
from deepdiff import DeepDiff
from priwo import read_dat, write_dat
from tempfile import NamedTemporaryFile
fnames = [
"test_fake_presto_radio.dat",
"test_fake_presto_radio_breaks.dat",
"test_fake_presto_xray.dat",
]
fdata = np.asarray(
[
0.0,
... | 18.126984 | 56 | 0.525394 | import numpy as np
from pathlib import Path
from deepdiff import DeepDiff
from priwo import read_dat, write_dat
from tempfile import NamedTemporaryFile
fnames = [
"test_fake_presto_radio.dat",
"test_fake_presto_radio_breaks.dat",
"test_fake_presto_xray.dat",
]
fdata = np.asarray(
[
0.0,
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8e29b3597a7d87d4a47252a7d1068099575a2c48 | 144 | py | Python | src/avame/errors.py | nickchen-mitac/fork | 64dab56012da47465b4923f30f26925476c87afc | [
"Apache-2.0"
] | null | null | null | src/avame/errors.py | nickchen-mitac/fork | 64dab56012da47465b4923f30f26925476c87afc | [
"Apache-2.0"
] | null | null | null | src/avame/errors.py | nickchen-mitac/fork | 64dab56012da47465b4923f30f26925476c87afc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
| 20.571429 | 82 | 0.75 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
class Timeout(Exception):
pass
| 0 | 0 | 0 | 13 | 0 | 0 | 0 | 0 | 23 |
6b6c4918437ff01fd308871c7f88d92fe127782e | 7,590 | py | Python | offrl/base.py | dlqudwns/RepB-SDE | d799c3bbfc9aeca9251dfa84255d1c1b90af42ce | [
"MIT"
] | null | null | null | offrl/base.py | dlqudwns/RepB-SDE | d799c3bbfc9aeca9251dfa84255d1c1b90af42ce | [
"MIT"
] | null | null | null | offrl/base.py | dlqudwns/RepB-SDE | d799c3bbfc9aeca9251dfa84255d1c1b90af42ce | [
"MIT"
] | null | null | null | import tensorflow as tf
SCALE_DIAG_MIN_MAX = (-20, 2)
EPS = 1e-6
def apply_squashing_func(sample, logp):
"""
Squash the ouput of the gaussian distribution and account for that in the log probability.
:param sample: (tf.Tensor) Action sampled from Gaussian distribution
:param logp: (tf.Tensor) Log pro... | 40.15873 | 100 | 0.645059 | import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
SCALE_DIAG_MIN_MAX = (-20, 2)
EPS = 1e-6
def apply_squashing_func(sample, logp):
"""
Squash the ouput of the gaussian distribution and account for that in the log probability.
:param sample: (tf.Tensor) Action sampled from Ga... | 0 | 0 | 0 | 6,797 | 0 | 0 | 0 | 12 | 158 |
088dfd54f1787f73dd612012fa9319fa21c0177a | 4,746 | py | Python | unittests/test_history.py | fraca7/pyqtcmd | 7648ab030cbcb308b451f8b34b022b523a08229f | [
"MIT"
] | null | null | null | unittests/test_history.py | fraca7/pyqtcmd | 7648ab030cbcb308b451f8b34b022b523a08229f | [
"MIT"
] | null | null | null | unittests/test_history.py | fraca7/pyqtcmd | 7648ab030cbcb308b451f8b34b022b523a08229f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import unittest
if __name__ == '__main__':
unittest.main()
| 25.793478 | 54 | 0.665402 | #!/usr/bin/env python3
import unittest
from pyqtcmd import History, Command, ConsistencyError
class DummyCommand(Command):
def __init__(self):
self.done = False
def do(self):
self.done = True
def undo(self):
self.done = False
class HistoryBaseTestCase(unittest.TestCase):
... | 0 | 0 | 0 | 4,409 | 0 | 0 | 0 | 33 | 207 |
54fc1cb85e499884e6925b7ab89f59efd44ce1c8 | 519 | py | Python | semana_01/aulas/05-formata_strings.py | alexaldr/AceleraDev-Python | f655b31f5d672f617c43282dc91a19f761845f84 | [
"MIT"
] | 5 | 2020-05-19T17:12:02.000Z | 2020-05-31T16:19:04.000Z | semana-1/arquivos-aulas/05-formata_strings.py | lucashenrs/acelerapython-codenation | 6335d994aef6d878a89d5504c68e7eceea8984cb | [
"MIT"
] | 23 | 2021-03-19T04:59:51.000Z | 2022-02-10T15:15:12.000Z | semana_01/aulas/05-formata_strings.py | alexaldr/AceleraDev-Python | f655b31f5d672f617c43282dc91a19f761845f84 | [
"MIT"
] | 1 | 2020-07-29T17:56:12.000Z | 2020-07-29T17:56:12.000Z | idade = 29
print('Minha idade : ' + str(idade))
print('Minha idade : {}'.format(idade))
print(f'Minha idade : {idade}')
nome = 'lysson MR cdoiksabncdsaicbsdaoin dsaucubsdaocpiknbsdaoiyvcsdaopikbncsdaiyvbcds'
print(f'Meu nome {nome:.15} e eu tenho {idade:03} anos')
dinheiro = 2.598
print(f'Eu tenho {dinheiro:.2f... | 22.565217 | 88 | 0.685934 | idade = 29
print('Minha idade é: ' + str(idade))
print('Minha idade é: {}'.format(idade))
print(f'Minha idade é: {idade}')
nome = 'Élysson MR cdoiksabncdsaicbsdaoin dsaucubsdaocpiknbsdaoiyvcsdaopikbncsdaiyvbcds'
print(f'Meu nome é {nome:.15} e eu tenho {idade:03} anos')
dinheiro = 2.598
print(f'Eu tenho {dinheir... | 12 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7d1cee70fe047374d76b7ebbe6bcabae1994465c | 1,692 | py | Python | qcs_api_client/models/edge.py | rigetti/qcs-api-client-python | 569cb9fa972dec1a706757374acb3df3ce649ec4 | [
"Apache-2.0"
] | 2 | 2021-12-15T23:24:40.000Z | 2022-01-03T01:14:17.000Z | qcs_api_client/models/edge.py | rigetti/qcs-api-client-python | 569cb9fa972dec1a706757374acb3df3ce649ec4 | [
"Apache-2.0"
] | 3 | 2022-01-10T21:55:13.000Z | 2022-02-22T19:41:01.000Z | qcs_api_client/models/edge.py | rigetti/qcs-api-client-python | 569cb9fa972dec1a706757374acb3df3ce649ec4 | [
"Apache-2.0"
] | 3 | 2021-12-15T23:24:42.000Z | 2022-01-09T11:16:17.000Z | from typing import TypeVar
T = TypeVar("T", bound="Edge")
| 30.763636 | 118 | 0.631797 | from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, cast
import attr
from ..types import UNSET
from ..util.serialization import is_not_none
T = TypeVar("T", bound="Edge")
@attr.s(auto_attribs=True)
class Edge:
"""A degree-two logical connection in the quantum processor's architecture.
T... | 0 | 1,475 | 0 | 0 | 0 | 0 | 0 | 66 | 91 |
ac4d125ce541406a626cb354c5f68c7526fe5daf | 1,371 | py | Python | rising/transforms/functional/channel.py | NKPmedia/rising | 2a580e9c74c8fb690e27e8bacf09ab97184ab1ee | [
"MIT"
] | 1 | 2020-11-10T11:03:33.000Z | 2020-11-10T11:03:33.000Z | rising/transforms/functional/channel.py | NKPmedia/rising | 2a580e9c74c8fb690e27e8bacf09ab97184ab1ee | [
"MIT"
] | null | null | null | rising/transforms/functional/channel.py | NKPmedia/rising | 2a580e9c74c8fb690e27e8bacf09ab97184ab1ee | [
"MIT"
] | null | null | null | from typing import Optional
import torch
from rising.ops import torch_one_hot
__all__ = ["one_hot_batch"]
def one_hot_batch(target: torch.Tensor,
num_classes: Optional[int] = None,
dtype: Optional[torch.dtype] = None) -> torch.Tensor:
"""
Compute one hot for input tensor ... | 34.275 | 82 | 0.624362 | from typing import Optional
import torch
from rising.ops import torch_one_hot
__all__ = ["one_hot_batch"]
def one_hot_batch(target: torch.Tensor,
num_classes: Optional[int] = None,
dtype: Optional[torch.dtype] = None) -> torch.Tensor:
"""
Compute one hot for input tensor ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
36f0c59e08e6d5af57d119b9412a2304554292ca | 307 | py | Python | music/distance/aural/simple.py | jedhsu/music | dea68c4a82296cd4910e786f533b2cbf861377c3 | [
"MIT"
] | null | null | null | music/distance/aural/simple.py | jedhsu/music | dea68c4a82296cd4910e786f533b2cbf861377c3 | [
"MIT"
] | null | null | null | music/distance/aural/simple.py | jedhsu/music | dea68c4a82296cd4910e786f533b2cbf861377c3 | [
"MIT"
] | null | null | null | """
*Simple Aural Interval*
An interval that is less than equal to an octave.
Simple / compound intervals partition by ordering.
"""
__all__ = ["SimpleInterval"]
| 13.954545 | 52 | 0.716612 | """
*Simple Aural Interval*
An interval that is less than equal to an octave.
Simple / compound intervals partition by ordering.
"""
from abc import ABCMeta
from ._interval import AuralInterval
__all__ = ["SimpleInterval"]
class SimpleInterval(
Interval,
):
__metaclass__ = ABCMeta
| 0 | 0 | 0 | 45 | 0 | 0 | 0 | 17 | 69 |
7977ac24bcafeb338b85e0748caeb55e887c5ea1 | 1,522 | py | Python | test/test_add_contact.py | ivangrebeniuk/python_training | bcf459539556d7d7152f7891e0d65bb744b4b475 | [
"Apache-2.0"
] | null | null | null | test/test_add_contact.py | ivangrebeniuk/python_training | bcf459539556d7d7152f7891e0d65bb744b4b475 | [
"Apache-2.0"
] | null | null | null | test/test_add_contact.py | ivangrebeniuk/python_training | bcf459539556d7d7152f7891e0d65bb744b4b475 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from model.contact import Contact
testdata = [Contact(first_name=random_string("first name", 10), middle_name=random_string("Middle name", 10), last_name=random_string("Last name", 10), nickname=random_string("Nickname", 10), title=random_string("Title", 5), company=random_string("Company", 1... | 58.538462 | 338 | 0.676084 | # -*- coding: utf-8 -*-
from model.contact import Contact
import pytest
import random
import string
def random_string(prefix, maxlen):
symbols = string.ascii_letters + string.digits + string.punctuation + " " * 5
return prefix + "".join([random.choice(symbols) for i in range(random.randrange(maxlen))])
test... | 0 | 291 | 0 | 0 | 0 | 190 | 0 | -24 | 112 |
28d567f2f90d422a7180e2b2898eb93681b8f4f1 | 1,049 | py | Python | No choice line edit.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 117 | 2015-12-18T07:18:27.000Z | 2022-03-28T00:25:54.000Z | No choice line edit.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 8 | 2018-10-03T09:38:46.000Z | 2021-12-13T19:51:09.000Z | No choice line edit.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 28 | 2016-08-02T17:43:47.000Z | 2022-03-21T08:31:12.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
"""
, .
"""
if __name__ == '__main__':
app = QApplication([])
w = Widget()
w.show()
app.exec()
| 21.854167 | 82 | 0.673975 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
"""
Скрипт показывает пример ограничение ввода только тем текстом, что был указан.
"""
from PyQt5.QtWidgets import *
class Widget(QWidget):
def __init__(self):
super().__init__()
self.setWindowTitle('No choice')
... | 160 | 0 | 0 | 714 | 0 | 0 | 0 | 8 | 46 |
edf44f21f459c6ec4d199865de2cbb5e5d8dd291 | 2,091 | py | Python | run_neutronics.py | RemDelaporteMathurin/T_transport_LIBRA | 5002c3f670f85053751026cfa8079188cd4eb7ab | [
"MIT"
] | null | null | null | run_neutronics.py | RemDelaporteMathurin/T_transport_LIBRA | 5002c3f670f85053751026cfa8079188cd4eb7ab | [
"MIT"
] | null | null | null | run_neutronics.py | RemDelaporteMathurin/T_transport_LIBRA | 5002c3f670f85053751026cfa8079188cd4eb7ab | [
"MIT"
] | null | null | null | import openmc
import openmc_dagmc_wrapper as odw
import openmc_plasma_source as ops
import neutronics_material_maker as nmm
import math
import numpy as np
my_h5m_filename = "dagmc_not_merged.h5m"
# materials
material_tag_to_material_dict = {
"lead": "Lead",
"flibe": nmm.Material.from_library(name=... | 31.208955 | 145 | 0.74462 | import openmc
import openmc_dagmc_wrapper as odw
import openmc_plasma_source as ops
import neutronics_material_maker as nmm
import math
import numpy as np
my_h5m_filename = "dagmc_not_merged.h5m"
# materials
material_tag_to_material_dict = {
"lead": "Lead",
"flibe": nmm.Material.from_library(name=... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2afd5a24146c0c51425b992586dbcad2ddda8c4d | 1,538 | py | Python | predict_pennfudan_with_loss.py | lilinxi/210429_YoloV3_Experiment | 60b2c8f348f7e101353ae0440f6c948f6bd03c04 | [
"MIT"
] | null | null | null | predict_pennfudan_with_loss.py | lilinxi/210429_YoloV3_Experiment | 60b2c8f348f7e101353ae0440f6c948f6bd03c04 | [
"MIT"
] | null | null | null | predict_pennfudan_with_loss.py | lilinxi/210429_YoloV3_Experiment | 60b2c8f348f7e101353ae0440f6c948f6bd03c04 | [
"MIT"
] | null | null | null | import conf.config
import dataset.pennfudan_dataset
import model.yolov3
"""
1demo weights:
67.91% = person AP || score_threhold=0.5 : F1=0.80 ; Recall=99.09% ; Precision=66.87%
mAP = 67.91%
---------------------------------------
tensor(2.9181) tensor(2.8104)
tensor(0.1682) tensor(0.1877)
tensor(20.8298) tensor(0.... | 26.067797 | 97 | 0.556567 | import conf.config
import dataset.pennfudan_dataset
import model.yolov3
"""
(1)demo weights:
67.91% = person AP || score_threhold=0.5 : F1=0.80 ; Recall=99.09% ; Precision=66.87%
mAP = 67.91%
---------------------------------------
tensor(2.9181) tensor(2.8104)
tensor(0.1682) tensor(0.1877)
tensor(20.8298) tensor(... | 84 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
42eaf6217f866f78656c77414228daa7e8a7c960 | 11,297 | py | Python | ephypype/nodes/import_data.py | EtienneCmb/ephypype | fdc13efb79545f072585d1e180d03702efd9e326 | [
"BSD-3-Clause"
] | null | null | null | ephypype/nodes/import_data.py | EtienneCmb/ephypype | fdc13efb79545f072585d1e180d03702efd9e326 | [
"BSD-3-Clause"
] | 1 | 2018-09-03T20:08:46.000Z | 2018-09-03T21:00:55.000Z | ephypype/nodes/import_data.py | EtienneCmb/ephypype | fdc13efb79545f072585d1e180d03702efd9e326 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""All nodes for import that are NOT specific to a ephy package."""
# ----------------- ImportMat ----------------------------- #
# ------------------- ImportBrainVisionAscii -------------------
# ------------------- ImportBrainVisionVhdr -------------------
# ------------------- Ep... | 28.966667 | 79 | 0.619368 | # -*- coding: utf-8 -*-
"""All nodes for import that are NOT specific to a ephy package."""
import os
from nipype.interfaces.base import BaseInterface,\
BaseInterfaceInputSpec, traits, TraitedSpec, isdefined
from nipype.interfaces.base import File
# ----------------- ImportMat ----------------------------- #
cl... | 0 | 0 | 0 | 10,441 | 0 | 0 | 0 | 94 | 412 |
7ffd18602922ec689066ec7889bc59c75a5ca252 | 3,799 | py | Python | experiments/torch_topics_deepfool.py | nibydlo/modAL | c0fe0200001c8c34e3fabb099fb70cf1e4bfb680 | [
"MIT"
] | 2 | 2020-01-22T14:34:01.000Z | 2020-01-22T14:51:18.000Z | experiments/torch_topics_deepfool.py | nibydlo/modAL | c0fe0200001c8c34e3fabb099fb70cf1e4bfb680 | [
"MIT"
] | null | null | null | experiments/torch_topics_deepfool.py | nibydlo/modAL | c0fe0200001c8c34e3fabb099fb70cf1e4bfb680 | [
"MIT"
] | null | null | null | from copy import deepcopy
from functools import partial, update_wrapper
import torch
import numpy as np
import torch.optim as optim
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from experiments.models.topics_torch_models import NormModel
from experiments.datas... | 29.679688 | 123 | 0.726244 | from copy import deepcopy
from functools import partial, update_wrapper
import torch
import numpy as np
import torch.optim as optim
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from experiments.models.topics_torch_models import NormModel, NormModelTrident
from... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 36 | 0 |
43befbf17ea0a9cbbc089006fafe91f4a9b1e2b7 | 8,873 | py | Python | json_logging/json_logging/__init__.py | harrystech/arthur-tools | b4d1772d3d7bba423efa74b7e5d697c40a095cd2 | [
"MIT"
] | 2 | 2020-01-23T18:05:15.000Z | 2020-05-26T14:53:08.000Z | json_logging/json_logging/__init__.py | harrystech/arthur-tools | b4d1772d3d7bba423efa74b7e5d697c40a095cd2 | [
"MIT"
] | 194 | 2020-01-13T22:26:34.000Z | 2022-03-29T12:02:58.000Z | json_logging/json_logging/__init__.py | harrystech/arthur-tools | b4d1772d3d7bba423efa74b7e5d697c40a095cd2 | [
"MIT"
] | null | null | null | """
Enable logging (from Lambda functions) in JSON format which makes post-processing much easier.
Since we assume this will be used by Lambda functions, we also add the request id in log lines.
"""
import logging
import logging.config
from typing import Any, Optional, Union
# We don't create this dict earlier so... | 35.778226 | 100 | 0.618618 | """
Enable logging (from Lambda functions) in JSON format which makes post-processing much easier.
Since we assume this will be used by Lambda functions, we also add the request id in log lines.
"""
import json
import logging
import logging.config
import sys
import traceback
from contextlib import ContextDecorator
fr... | 0 | 984 | 0 | 5,041 | 0 | 287 | 0 | 33 | 284 |
5fa7626bffa829023dff17d79a49ca9e81fba492 | 2,149 | py | Python | hacker_earth/python_problems/string_addition.py | Faraaz54/python_training_problems | 24c7b42daaf54366759e1d7c4b42f9936316e94b | [
"MIT"
] | null | null | null | hacker_earth/python_problems/string_addition.py | Faraaz54/python_training_problems | 24c7b42daaf54366759e1d7c4b42f9936316e94b | [
"MIT"
] | null | null | null | hacker_earth/python_problems/string_addition.py | Faraaz54/python_training_problems | 24c7b42daaf54366759e1d7c4b42f9936316e94b | [
"MIT"
] | null | null | null |
sol = []
for _ in xrange(0, int(raw_input())):
s = raw_input()
#w = [i for i in s]
#print w
#t = [s[len(s) - 1 - count] for count in xrange(len(s))]
#print t
T = []
st = 0
for i in xrange(0, len(s)):
v = (ord(s[i]) + ord(s[len(s) - 1 - i])) - 96
if v ... | 25.891566 | 61 | 0.33504 |
sol = []
for _ in xrange(0, int(raw_input())):
s = raw_input()
#w = [i for i in s]
#print w
#t = [s[len(s) - 1 - count] for count in xrange(len(s))]
#print t
T = []
st = 0
for i in xrange(0, len(s)):
v = (ord(s[i]) + ord(s[len(s) - 1 - i])) - 96
if v ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
839d371d56939d9dda6a230c854a47fd94faa3e6 | 5,063 | py | Python | esphomeyaml/components/logger.py | Bierchermuesli/esphomeyaml | f087e313d4ca5370b14f7e8173c8f1719e90dfa6 | [
"MIT"
] | null | null | null | esphomeyaml/components/logger.py | Bierchermuesli/esphomeyaml | f087e313d4ca5370b14f7e8173c8f1719e90dfa6 | [
"MIT"
] | null | null | null | esphomeyaml/components/logger.py | Bierchermuesli/esphomeyaml | f087e313d4ca5370b14f7e8173c8f1719e90dfa6 | [
"MIT"
] | null | null | null |
import voluptuous as vol
import esphomeyaml.config_validation as cv
from esphomeyaml.const import CONF_ARGS, CONF_BAUD_RATE, CONF_FORMAT, CONF_LEVEL, CONF_LOGS, CONF_TAG, CONF_TX_BUFFER_SIZE
from esphomeyaml.helpers import esphomelib_ns, global_ns, Component
LOG_LEVELS = {
'NONE': global_ns.ESPHOMELIB_LOG_LEVEL_N... | 38.946154 | 100 | 0.673119 | import re
import voluptuous as vol
from esphomeyaml.automation import ACTION_REGISTRY, LambdaAction
import esphomeyaml.config_validation as cv
from esphomeyaml.const import CONF_ARGS, CONF_BAUD_RATE, CONF_FORMAT, CONF_ID, CONF_LEVEL, \
CONF_LOGS, CONF_TAG, CONF_TX_BUFFER_SIZE
from esphomeyaml.core import ESPHomeY... | 0 | 593 | 0 | 0 | 0 | 2,183 | 0 | 166 | 205 |
df28fa0ee16b08f7c8e724f545139a01db78d3c1 | 3,695 | py | Python | celery_conf/tasks.py | kwrobert/qualipy | a514e8d2e7d3b24d111556a1af91689ace36af9a | [
"MIT"
] | null | null | null | celery_conf/tasks.py | kwrobert/qualipy | a514e8d2e7d3b24d111556a1af91689ace36af9a | [
"MIT"
] | null | null | null | celery_conf/tasks.py | kwrobert/qualipy | a514e8d2e7d3b24d111556a1af91689ace36af9a | [
"MIT"
] | null | null | null | import json
import inspect
from celery import Celery
from celery import group
app = Celery()
# celery config file here:
app.config_from_object('sampleconfig')
def celery_process(images, filters, ROIs=None, return_predictions=False,
combine_results=False, sort_filters=True):
"""Process a list... | 32.412281 | 81 | 0.665765 | import json
import inspect
import qualipy
from celery import Celery
from celery import group
app = Celery()
# celery config file here:
app.config_from_object('sampleconfig')
@app.task
def process_image(image, filters, ROI=None, return_predictions=False,
combine_results=False, sort_filters=True):
... | 0 | 335 | 0 | 0 | 0 | 1,022 | 0 | -7 | 138 |
a269b81a626604236eb11f9b26a66abc6af99700 | 3,545 | py | Python | VISION/CalibrationStereo/StereoCalibration.py | Beam-create/S4_projet_QUADRUS_V2 | 304b434b552a4a5377dd2f49c4bb4c8e9fcb714b | [
"MIT"
] | null | null | null | VISION/CalibrationStereo/StereoCalibration.py | Beam-create/S4_projet_QUADRUS_V2 | 304b434b552a4a5377dd2f49c4bb4c8e9fcb714b | [
"MIT"
] | 52 | 2022-02-12T17:12:17.000Z | 2022-03-30T00:39:18.000Z | VISION/CalibrationStereo/StereoCalibration.py | Beam-create/S4_projet_QUADRUS_V2 | 304b434b552a4a5377dd2f49c4bb4c8e9fcb714b | [
"MIT"
] | 2 | 2022-01-19T15:44:53.000Z | 2022-01-20T21:44:41.000Z | import numpy as np
import cv2
import glob
################ CHQUIER #############################
chessboardSize = (8,6)
frameSize = (720,540)
criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001)
objp = np.zeros((chessboardSize[0] * chessboardSize[1], 3), np.float32)
objp[:,:2] = np.mgri... | 33.130841 | 257 | 0.691396 | import numpy as np
import cv2
import glob
################ ÉCHÉQUIER #############################
chessboardSize = (8,6)
frameSize = (720,540)
criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001)
objp = np.zeros((chessboardSize[0] * chessboardSize[1], 3), np.float32)
objp[:,:2] = np.mg... | 6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
af5d2d20165054a32572a1b993db106fb4ae9b6e | 2,992 | py | Python | experiment-Gaussians.py | rougier/VSOM | 78e6eb924b5f89a0e6f42eb6bbe7971473a9abaa | [
"BSD-3-Clause"
] | 17 | 2020-11-20T06:27:15.000Z | 2022-01-11T22:20:28.000Z | experiment-Gaussians.py | rougier/VSOM | 78e6eb924b5f89a0e6f42eb6bbe7971473a9abaa | [
"BSD-3-Clause"
] | null | null | null | experiment-Gaussians.py | rougier/VSOM | 78e6eb924b5f89a0e6f42eb6bbe7971473a9abaa | [
"BSD-3-Clause"
] | 1 | 2022-01-03T04:41:57.000Z | 2022-01-03T04:41:57.000Z | # -----------------------------------------------------------------------------
# Copyright (c) 2019 Nicolas P. Rougier
# Distributed under the terms of the BSD License.
# -----------------------------------------------------------------------------
import sys
import som, plot
import numpy as np
import matplotlib.pyplo... | 34.790698 | 82 | 0.541778 | # -----------------------------------------------------------------------------
# Copyright (c) 2019 Nicolas P. Rougier
# Distributed under the terms of the BSD License.
# -----------------------------------------------------------------------------
import sys
import som, mnist, plot
import numpy as np
import matplotli... | 0 | 0 | 0 | 0 | 0 | 466 | 0 | 7 | 23 |
23434da633307b6722c28b1fdadb1f0d38de4516 | 1,243 | py | Python | tests/test_nfa.py | peppermintpatty5/regex-eq | e1665c0e3292547d0ce5727756bf9646f53d1247 | [
"MIT"
] | null | null | null | tests/test_nfa.py | peppermintpatty5/regex-eq | e1665c0e3292547d0ce5727756bf9646f53d1247 | [
"MIT"
] | null | null | null | tests/test_nfa.py | peppermintpatty5/regex-eq | e1665c0e3292547d0ce5727756bf9646f53d1247 | [
"MIT"
] | null | null | null | """
Unit tests for module `regular.nfa`
"""
import unittest
if __name__ == "__main__":
unittest.main()
| 25.895833 | 87 | 0.529364 | """
Unit tests for module `regular.nfa`
"""
import unittest
from regular.nfa import NFA
class TestNFA(unittest.TestCase):
"""
Test cases for class `NFA`
"""
def test_overlapping_states(self):
"""
The operations for union and concatenation cannot be performed if the NFAs have
... | 0 | 0 | 0 | 1,080 | 0 | 0 | 0 | 6 | 46 |
be5b801ffebc8f1fe9e4eeadfe3427720a90651a | 8,234 | py | Python | tarterus/door.py | redcartel/tarterus-webclient | 79939a365a29ba85728066265dc665a9af04120a | [
"MIT"
] | 1 | 2019-01-14T18:55:14.000Z | 2019-01-14T18:55:14.000Z | tarterus/door.py | redcartel/tarterus-webclient | 79939a365a29ba85728066265dc665a9af04120a | [
"MIT"
] | null | null | null | tarterus/door.py | redcartel/tarterus-webclient | 79939a365a29ba85728066265dc665a9af04120a | [
"MIT"
] | 1 | 2019-06-18T20:42:35.000Z | 2019-06-18T20:42:35.000Z | # from tarterus.graphpaper import is_positive, turn_across
# TODO: stairs & trapped doors
# TODO: "blocking void"
DICE_ARRAY = [18, 20, 12]
# TODO: passages from actual door table
# def table_passage(engine, origin, x, y, direction, width, dsquare, dice):
# engine.log(":: door: table_passage")
# simp = is_s... | 34.165975 | 79 | 0.568496 | from tarterus.graphpaper import right, left, back #turn_positive
# from tarterus.graphpaper import is_positive, turn_across
from tarterus.graphpaper import advance # , empty, middle_value
from tarterus.passage import passage_width_table
from tarterus.room import find_loc
# TODO: stairs & trapped doors
# TODO: "blocki... | 0 | 0 | 0 | 0 | 0 | 5,897 | 0 | 86 | 331 |
7f340048ad5a0970872ba10e09820f668d89059f | 750 | py | Python | test.py | rilango/anndata | 0621bb947ea2dde45827ad493e7947ad5f97eeba | [
"BSD-3-Clause"
] | null | null | null | test.py | rilango/anndata | 0621bb947ea2dde45827ad493e7947ad5f97eeba | [
"BSD-3-Clause"
] | null | null | null | test.py | rilango/anndata | 0621bb947ea2dde45827ad493e7947ad5f97eeba | [
"BSD-3-Clause"
] | null | null | null | import rapids_scanpy_funcs
import scanpy as sc
min_genes_per_cell = 200
max_genes_per_cell = 6000
adata = sc.read('/data/anndata/krasnow_hlca_10x_UMIs.sparse.h5ad')
a = adata.T
genes = a.var_names
# print(type(genes))
# print(genes)
#a = anndata.read_h5ad('/data/anndata/krasnow_hlca_10x_UMIs.sparse.h5ad', as_sparse... | 19.230769 | 111 | 0.725333 | import rapids_scanpy_funcs
import anndata
import cupy
import scanpy as sc
min_genes_per_cell = 200
max_genes_per_cell = 6000
adata = sc.read('/data/anndata/krasnow_hlca_10x_UMIs.sparse.h5ad')
a = adata.T
genes = a.var_names
# print(type(genes))
# print(genes)
#a = anndata.read_h5ad('/data/anndata/krasnow_hlca_10x_U... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -17 | 44 |
a1b35406f7e59655f593a0a9f524cbff400ee90a | 850 | py | Python | directoalartista/apps/plancontrol/models.py | mpampols/directoalartista.com | 833eea7f4db5a2343dba4314793d593cd66cf1fb | [
"MIT"
] | null | null | null | directoalartista/apps/plancontrol/models.py | mpampols/directoalartista.com | 833eea7f4db5a2343dba4314793d593cd66cf1fb | [
"MIT"
] | null | null | null | directoalartista/apps/plancontrol/models.py | mpampols/directoalartista.com | 833eea7f4db5a2343dba4314793d593cd66cf1fb | [
"MIT"
] | 1 | 2018-03-29T02:16:18.000Z | 2018-03-29T02:16:18.000Z |
from django.contrib.auth.models import User
from django.conf import settings
User = settings.AUTH_USER_MODEL
#User = get_user_model()
| 26.5625 | 80 | 0.722353 | from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
User = settings.AUTH_USER_MODEL
from datetime import datetime, timedelta
from directoalartista.apps.genericuser.models import GenericUser
from django.contrib.auth import get_user_model
#User = get_user_model()... | 0 | 0 | 0 | 505 | 0 | 0 | 0 | 94 | 114 |
8f22a8ccbf3f5deb0ac40abecf7cf72f45a67953 | 808 | py | Python | Python/CLRS/2-3_Horner.py | mixterjim/Learn | f1f2132f2d90d50d6963ba4563f037186c9dc955 | [
"MIT"
] | 3 | 2015-05-14T14:32:27.000Z | 2019-05-01T08:24:17.000Z | Python/CLRS/2-3_Horner.py | mixterjim/Learn | f1f2132f2d90d50d6963ba4563f037186c9dc955 | [
"MIT"
] | 1 | 2015-05-14T10:54:20.000Z | 2015-05-14T10:54:47.000Z | Python/CLRS/2-3_Horner.py | mixterjim/Learn | f1f2132f2d90d50d6963ba4563f037186c9dc955 | [
"MIT"
] | null | null | null | import time
x = 2
A = random_int_list(1, 100000, 1000)
B = A
start = time.clock()
HORNER(B, x)
end = time.clock()
print("Horner: %f s" % (end - start))
B = A
start = time.clock()
NAIVE(B, x)
end = time.clock()
print("Navie: %f s" % (end - start))
| 19.238095 | 65 | 0.576733 | import random
import time
def random_int_list(start, stop, length):
start, stop = (int(start), int(stop)) if start <= stop else (
int(stop), int(start))
length = int(abs(length)) if length else 0
random_list = []
for i in range(length):
random_list.append(random.randint(start, stop))
... | 0 | 0 | 0 | 0 | 0 | 472 | 0 | -8 | 91 |
d42adb0f53f3d2a64f24cc2b95a0007e8e05e75d | 1,426 | py | Python | app/weather/__init__.py | zhounanshu/semd | 42a893ddf441bc770126bef1d62a5840ef1f8dc7 | [
"MIT"
] | 1 | 2016-05-31T05:56:12.000Z | 2016-05-31T05:56:12.000Z | app/weather/__init__.py | zhounanshu/SEMD | 42a893ddf441bc770126bef1d62a5840ef1f8dc7 | [
"MIT"
] | null | null | null | app/weather/__init__.py | zhounanshu/SEMD | 42a893ddf441bc770126bef1d62a5840ef1f8dc7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Blueprint
from flask.ext.restful import Api
Weather = Blueprint('Weather', __name__)
weather_api = Api(Weather)
# weather_api.add_resource(viewRelti, '/v1/weather/realtime')
# weather_api.add_resource(viewForecast, '/v1/wather/forecast')
weather_api.add_r... | 43.212121 | 74 | 0.792426 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Blueprint
from flask.ext.restful import Api
Weather = Blueprint('Weather', __name__)
weather_api = Api(Weather)
from .views import *
# weather_api.add_resource(viewRelti, '/v1/weather/realtime')
# weather_api.add_resource(viewForecast, '/v1/wather/foreca... | 75 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 23 |
4d3a56a9d3b747e92621da1b436cf297bbe05c05 | 1,154 | py | Python | tests/helpers.py | rekt-hard/invenio-userprofiles | 69cbe381a35aca98d398a9673af351b672d41b70 | [
"MIT"
] | null | null | null | tests/helpers.py | rekt-hard/invenio-userprofiles | 69cbe381a35aca98d398a9673af351b672d41b70 | [
"MIT"
] | null | null | null | tests/helpers.py | rekt-hard/invenio-userprofiles | 69cbe381a35aca98d398a9673af351b672d41b70 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Helper functions for tests."""
from flask import url_for
def sign_up(app, clien... | 32.055556 | 72 | 0.681976 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Helper functions for tests."""
from flask import url_for
def sign_up(app, clien... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2ef8e91a362c0314b58c09f0e9bbfe4f66eed0a0 | 526 | py | Python | hydra/plugins/__init__.py | blackc03r/hydra | 3c30c201b8d0791752bdcf2c80414f83ffe1dc1a | [
"MIT"
] | null | null | null | hydra/plugins/__init__.py | blackc03r/hydra | 3c30c201b8d0791752bdcf2c80414f83ffe1dc1a | [
"MIT"
] | null | null | null | hydra/plugins/__init__.py | blackc03r/hydra | 3c30c201b8d0791752bdcf2c80414f83ffe1dc1a | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
Plugins API package
"""
from hydra.plugins.completion_plugin import CompletionPlugin
from hydra.plugins.launcher import Launcher
from hydra.plugins.plugin import Plugin
from hydra.plugins.search_path_plugin import SearchPathPlugin
from hydra.plu... | 26.3 | 70 | 0.771863 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
Plugins API package
"""
from hydra.plugins.completion_plugin import CompletionPlugin
from hydra.plugins.launcher import Launcher
from hydra.plugins.plugin import Plugin
from hydra.plugins.search_path_plugin import SearchPathPlugin
from hydra.plu... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
07577bb0e7fed97b97efc99c236826232b74cb72 | 1,316 | py | Python | config/dev.py | BruceWW/flask-basic | 3252f47e6b3fca170b57819f8fdbdeb0f868654e | [
"MIT"
] | 1 | 2019-09-28T17:03:39.000Z | 2019-09-28T17:03:39.000Z | config/dev.py | BruceWW/flask-basic | 3252f47e6b3fca170b57819f8fdbdeb0f868654e | [
"MIT"
] | null | null | null | config/dev.py | BruceWW/flask-basic | 3252f47e6b3fca170b57819f8fdbdeb0f868654e | [
"MIT"
] | 1 | 2019-11-19T02:39:40.000Z | 2019-11-19T02:39:40.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/9/11 20:20
# @Author : Lin Luo
# @Site :
# @File : dev
# @Software: PyCharm
| 26.32 | 97 | 0.636018 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/9/11 20:20
# @Author : Lin Luo
# @Site :
# @File : dev
# @Software: PyCharm
from . import BaseConfig
from redis import Redis
class Config(BaseConfig):
"""开发环境配置参数"""
SQLALCHEMY_ECHO = True
DEBUG = True
EMV = 'dev'
# DB
DB... | 54 | 0 | 0 | 1,078 | 0 | 0 | 0 | 5 | 67 |
623e7e5221c700158814fc6dc6ff3ae2884806bf | 651 | py | Python | images/tests.py | chelseaayoo/Personal-Gallery | 1c1d8a8c494751b87428866c6a5d029d4b136ce1 | [
"MIT"
] | null | null | null | images/tests.py | chelseaayoo/Personal-Gallery | 1c1d8a8c494751b87428866c6a5d029d4b136ce1 | [
"MIT"
] | null | null | null | images/tests.py | chelseaayoo/Personal-Gallery | 1c1d8a8c494751b87428866c6a5d029d4b136ce1 | [
"MIT"
] | null | null | null |
# Create your tests here. | 31 | 109 | 0.683564 | from django.test import TestCase
from .models import Image, Category, Location
# Create your tests here.
class ImageTestClass(TestCase):
#Set up method
def setUp(self):
self.location = Location(name="Kisumu")
self.location.save()
self.category = Category(name="Vacation")
self.... | 0 | 0 | 0 | 523 | 0 | 0 | 0 | 35 | 67 |
5abde49cc8d6f0837cc649c0b25fec4d80eb1bd3 | 4,850 | py | Python | bin/prepare_diann_parameters.py | ypriverol/quantms | 2626e228c1276a8fa5b41a2eda00a68253e657e6 | [
"MIT"
] | 1 | 2022-03-14T02:02:01.000Z | 2022-03-14T02:02:01.000Z | bin/prepare_diann_parameters.py | ypriverol/quantms | 2626e228c1276a8fa5b41a2eda00a68253e657e6 | [
"MIT"
] | 14 | 2022-03-15T21:46:45.000Z | 2022-03-31T11:12:42.000Z | bin/prepare_diann_parameters.py | ypriverol/quantms | 2626e228c1276a8fa5b41a2eda00a68253e657e6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
cli.add_command(generate_cfg)
if __name__ == "__main__":
cli()
| 36.19403 | 140 | 0.569485 | #!/usr/bin/env python
import re
import click
from sdrf_pipelines.openms.unimod import UnimodDatabase
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
@click.group(context_settings=CONTEXT_SETTINGS)
def cli():
pass
@click.command('generate')
@click.option("--enzyme", "-e", help="")
@click.option("--fix... | 0 | 1,543 | 0 | 0 | 0 | 2,961 | 0 | 13 | 181 |
13c14d38a65bb64feeef34679a6670837801479a | 878 | py | Python | var/spack/repos/builtin/packages/py-python-memcached/package.py | adrianjhpc/spack | 0a9e4fcee57911f2db586aa50c8873d9cca8de92 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2020-10-15T01:08:42.000Z | 2021-10-18T01:28:18.000Z | var/spack/repos/builtin/packages/py-python-memcached/package.py | adrianjhpc/spack | 0a9e4fcee57911f2db586aa50c8873d9cca8de92 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2019-07-30T10:12:28.000Z | 2019-12-17T09:02:27.000Z | var/spack/repos/builtin/packages/py-python-memcached/package.py | adrianjhpc/spack | 0a9e4fcee57911f2db586aa50c8873d9cca8de92 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 5 | 2019-07-30T09:42:14.000Z | 2021-01-25T05:39:20.000Z | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
| 39.909091 | 96 | 0.740319 | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyPythonMemcached(PythonPackage):
"""This software is a 100% Python interface to the memca... | 0 | 0 | 0 | 636 | 0 | 0 | 0 | -2 | 46 |
c7093f3820d04b8103121cee9f4cdaf96e748579 | 23,970 | py | Python | python/uw/utilities/fitter.py | coclar/pointlike | 7088724b5a40cf787371aff69e64c9bec701f578 | [
"BSD-3-Clause"
] | null | null | null | python/uw/utilities/fitter.py | coclar/pointlike | 7088724b5a40cf787371aff69e64c9bec701f578 | [
"BSD-3-Clause"
] | null | null | null | python/uw/utilities/fitter.py | coclar/pointlike | 7088724b5a40cf787371aff69e64c9bec701f578 | [
"BSD-3-Clause"
] | null | null | null | """
Basic fitter utilities
Authors: Matthew Kerr, Toby Burnett
$Header: /nfs/slac/g/glast/ground/cvs/pointlike/python/uw/utilities/fitter.py,v 1.10 2013/07/28 15:27:44 burnett Exp $
"""
import numpy as np
def test(x0=1.1, pars=[1.0, 1.5], **kwargs):
""" test with a parabola corresponding to a Gauss... | 40.218121 | 142 | 0.561786 | """
Basic fitter utilities
Authors: Matthew Kerr, Toby Burnett
$Header: /nfs/slac/g/glast/ground/cvs/pointlike/python/uw/utilities/fitter.py,v 1.10 2013/07/28 15:27:44 burnett Exp $
"""
import types
import numpy as np
from scipy import optimize #for fmin,fmin_powell,fmin_bfgs
from numpy import linalg #for inv
import... | 0 | 7,196 | 0 | 15,243 | 0 | 151 | 0 | -3 | 305 |
be296d19d60e06bb3d6093baff8e0f188b1419b0 | 1,384 | py | Python | L1Trigger/L1THGCal/python/hgcalTowerMapProducer_cfi.py | Michael-Krohn/cmssw | 25064b40a13dc451b498e850214fcbe141f7cb75 | [
"Apache-2.0"
] | 2 | 2018-06-01T05:18:55.000Z | 2021-04-08T21:44:06.000Z | L1Trigger/L1THGCal/python/hgcalTowerMapProducer_cfi.py | Michael-Krohn/cmssw | 25064b40a13dc451b498e850214fcbe141f7cb75 | [
"Apache-2.0"
] | 26 | 2018-10-30T12:47:58.000Z | 2022-03-29T08:39:00.000Z | L1Trigger/L1THGCal/python/hgcalTowerMapProducer_cfi.py | p2l1pfp/cmssw | 9bda22bf33ecf18dd19a3af2b3a8cbdb1de556a9 | [
"Apache-2.0"
] | 2 | 2020-03-20T18:46:13.000Z | 2021-03-12T09:23:07.000Z | import FWCore.ParameterSet.Config as cms
import math
L1TTriggerTowerConfig_etaphi = cms.PSet(readMappingFile=cms.bool(False),
minEta=cms.double(1.479),
maxEta=cms.double(3.0),
minPhi=cms.double(-1*ma... | 43.25 | 85 | 0.547688 | import FWCore.ParameterSet.Config as cms
import math
L1TTriggerTowerConfig_etaphi = cms.PSet(readMappingFile=cms.bool(False),
minEta=cms.double(1.479),
maxEta=cms.double(3.0),
minPhi=cms.double(-1*ma... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1d9d233c7e37bec6b3e1f0f38264ff51b1dac383 | 2,069 | py | Python | testgrids/eosfit.py | ajulik1997/testgrids | 0d52e9b4fccd755a9421934d40b8b312a198699f | [
"MIT"
] | null | null | null | testgrids/eosfit.py | ajulik1997/testgrids | 0d52e9b4fccd755a9421934d40b8b312a198699f | [
"MIT"
] | null | null | null | testgrids/eosfit.py | ajulik1997/testgrids | 0d52e9b4fccd755a9421934d40b8b312a198699f | [
"MIT"
] | null | null | null | # eosfit.py fits E(V) data to a Birch-Murnaghan equation of state.
# Current version: 3.1
#
# Copyright (C) 2012 Kurt Lejaeghere <Kurt.Lejaeghere@UGent.be>, Center for
# Molecular Modeling (CMM), Ghent University, Ghent, Belgium
#
# eosfit.py is free software; you can redistribute it and/or modify it under
# the terms... | 36.298246 | 104 | 0.670372 | # eosfit.py fits E(V) data to a Birch-Murnaghan equation of state.
# Current version: 3.1
#
# Copyright (C) 2012 Kurt Lejaeghere <Kurt.Lejaeghere@UGent.be>, Center for
# Molecular Modeling (CMM), Ghent University, Ghent, Belgium
#
# eosfit.py is free software; you can redistribute it and/or modify it under
# the terms... | 0 | 0 | 0 | 0 | 0 | 864 | 0 | -3 | 46 |
16ef86cedd96dea29913b4087cc47bb49e7abf68 | 13,774 | py | Python | synthesisdatabase/managers/download_manager.py | olivettigroup/synthesis-database-public | 3a5b96558249c3079b7acaf9e96bd0282c0341ce | [
"MIT"
] | 7 | 2017-02-28T01:01:02.000Z | 2021-05-24T04:48:01.000Z | synthesisdatabase/managers/download_manager.py | olivettigroup/synthesis-database-public | 3a5b96558249c3079b7acaf9e96bd0282c0341ce | [
"MIT"
] | 1 | 2019-03-07T06:38:28.000Z | 2019-04-04T18:14:38.000Z | synthesisdatabase/managers/download_manager.py | olivettigroup/synthesis-database-public | 3a5b96558249c3079b7acaf9e96bd0282c0341ce | [
"MIT"
] | 4 | 2017-05-01T18:57:39.000Z | 2020-06-04T06:01:53.000Z | import sys
sys.path.append("..")
reload(sys)
sys.setdefaultencoding('utf8')
| 35.776623 | 142 | 0.610861 | import sys
sys.path.append("..")
from models import (Paper, Paragraph)
from time import sleep
from pymongo import MongoClient
from pymatgen.matproj.rest import (MPRester)
from articledownloader.articledownloader import (ArticleDownloader)
from os import (environ, path, remove, listdir, strerror)
from autologging impor... | 0 | 13,177 | 0 | 0 | 0 | 0 | 0 | 187 | 332 |
a26d42f799f99e7095be3f0c3901520eec0d8829 | 24,371 | py | Python | 11/solution.py | AlecRosenbaum/adventofcode2017 | 9214a64db77492790d30bbd22e835535d05abb25 | [
"MIT"
] | null | null | null | 11/solution.py | AlecRosenbaum/adventofcode2017 | 9214a64db77492790d30bbd22e835535d05abb25 | [
"MIT"
] | null | null | null | 11/solution.py | AlecRosenbaum/adventofcode2017 | 9214a64db77492790d30bbd22e835535d05abb25 | [
"MIT"
] | null | null | null | """
Day 11 challenge
"""
DIRECTIONS = {
"nw": Offset(horizontal=-.5, vertical=.5),
"n": Offset(vertical=1),
"ne": Offset(horizontal=.5, vertical=.5),
"se": Offset(horizontal=.5, vertical=-.5),
"s": Offset(vertical=-1),
"sw": Offset(horizontal=-.5, vertical=-.5),
}
if __name__ == "__ma... | 276.943182 | 22,006 | 0.620697 | """
Day 11 challenge
"""
import attr
import math
from functools import reduce
@attr.s
class Offset(object):
horizontal = attr.ib(default=0)
vertical = attr.ib(default=0)
def __add__(self, other):
return Offset(
horizontal=self.horizontal + other.horizontal,
vertical=self.v... | 0 | 360 | 0 | 0 | 0 | 1,469 | 0 | -13 | 135 |
0edbf4856f3f5fc8d8eca3650fd3de2cd8ef2372 | 3,729 | py | Python | Metric/logger.py | ZM-Zhou/MDE_Platform_Pytorch | d86efe061bf14a6eed3352cc45e1437e46c138b1 | [
"MIT"
] | null | null | null | Metric/logger.py | ZM-Zhou/MDE_Platform_Pytorch | d86efe061bf14a6eed3352cc45e1437e46c138b1 | [
"MIT"
] | null | null | null | Metric/logger.py | ZM-Zhou/MDE_Platform_Pytorch | d86efe061bf14a6eed3352cc45e1437e46c138b1 | [
"MIT"
] | null | null | null | import torch.nn as nn
def sec_to_hm(t):
"""Convert time in seconds to time in hours, minutes and seconds
e.g. 10239 -> (2, 50, 39)
"""
t = int(t)
s = t % 60
t //= 60
m = t % 60
t //= 60
return t, m, s
def sec_to_hm_str(t):
"""Convert time in seconds to a nice string
e.g. 1... | 32.426087 | 84 | 0.540896 | import time
import os
import json
import shutil
import numpy as np
import cv2 as cv
import torch
import torch.nn as nn
import torch.nn.functional as F
from Utils.import_choice import import_module
from Utils.visualization import VisualImage, make_output_img
def sec_to_hm(t):
"""Convert time in seconds to time in... | 0 | 0 | 0 | 3,041 | 0 | 0 | 0 | 16 | 245 |
680f8d81c64768930a68b46fa87c28d4ef3f1453 | 15,200 | py | Python | Tests/Application.py | BigFriendly/tm1py | 03210d672cc3797025b8de80c42037e1e11f369f | [
"MIT"
] | null | null | null | Tests/Application.py | BigFriendly/tm1py | 03210d672cc3797025b8de80c42037e1e11f369f | [
"MIT"
] | null | null | null | Tests/Application.py | BigFriendly/tm1py | 03210d672cc3797025b8de80c42037e1e11f369f | [
"MIT"
] | null | null | null | import configparser
import os
config = configparser.ConfigParser()
config.read(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'config.ini'))
# Hard coded stuff
PREFIX = 'TM1py_Tests_Applications_'
TM1PY_APP_FOLDER = PREFIX + "RootFolder"
APPLICATION_NAME = PREFIX + "Application"
CUBE_NAME = PREFIX + "Cube"
... | 44.705882 | 120 | 0.684013 | import configparser
import os
import random
import unittest
from _datetime import datetime
from TM1py import TM1Service, Element, ElementAttribute, Hierarchy, Dimension, Cube, NativeView, AnonymousSubset, \
Subset, Process, Chore, ChoreStartTime, ChoreFrequency, ChoreTask
from TM1py.Objects.Application import Cub... | 0 | 5,146 | 0 | 8,909 | 0 | 0 | 0 | 368 | 135 |
b233161373558bab9922ed14cc69db5f313c6bba | 141 | py | Python | odoo/custom/src/private/fieldservice_worker_geolocalize/models/__init__.py | mtelahun/odoo-geo | 1473dabfa8bc082a552cbb88981635d9eb358dce | [
"BSL-1.0"
] | null | null | null | odoo/custom/src/private/fieldservice_worker_geolocalize/models/__init__.py | mtelahun/odoo-geo | 1473dabfa8bc082a552cbb88981635d9eb358dce | [
"BSL-1.0"
] | null | null | null | odoo/custom/src/private/fieldservice_worker_geolocalize/models/__init__.py | mtelahun/odoo-geo | 1473dabfa8bc082a552cbb88981635d9eb358dce | [
"BSL-1.0"
] | null | null | null | # Copyright (C) 2021 TREVI Software
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# flake8: noqa
| 23.5 | 63 | 0.723404 | # Copyright (C) 2021 TREVI Software
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# flake8: noqa
from . import fsm_person
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 22 |
54d628d4d3ddf9311d90625573627f6cc737d717 | 363 | py | Python | lecture/migrations/0009_auto_20191217_1120.py | JhoLee/django-lecture_manager | d74ab1d48c954583ffd509346d7cb30b9214f1dc | [
"MIT"
] | null | null | null | lecture/migrations/0009_auto_20191217_1120.py | JhoLee/django-lecture_manager | d74ab1d48c954583ffd509346d7cb30b9214f1dc | [
"MIT"
] | 7 | 2020-06-05T20:02:50.000Z | 2021-09-22T18:05:02.000Z | lecture/migrations/0009_auto_20191217_1120.py | JhoLee/django-lecture_manager | d74ab1d48c954583ffd509346d7cb30b9214f1dc | [
"MIT"
] | null | null | null | # Generated by Django 3.0 on 2019-12-17 02:20
| 19.105263 | 47 | 0.586777 | # Generated by Django 3.0 on 2019-12-17 02:20
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('lecture', '0008_auto_20191217_1115'),
]
operations = [
migrations.RenameField(
model_name='notice',
old_name='attachment',
... | 0 | 0 | 0 | 259 | 0 | 0 | 0 | 11 | 46 |
b4df9266c9f7897610aa8a7227dacf7d1148455c | 5,990 | py | Python | ownthinkdb/txtpro.py | sealhuang/KBQA-BERT | fa8c32da0625326a7209d053c3c6b1bd14a702fd | [
"MIT"
] | null | null | null | ownthinkdb/txtpro.py | sealhuang/KBQA-BERT | fa8c32da0625326a7209d053c3c6b1bd14a702fd | [
"MIT"
] | null | null | null | ownthinkdb/txtpro.py | sealhuang/KBQA-BERT | fa8c32da0625326a7209d053c3c6b1bd14a702fd | [
"MIT"
] | null | null | null | # vi: set ft=python sts=4 ts=4 sw=4 et:
import csv
def collect_relations(file_name='ownthink_v2.csv'):
"""Get all unique relations."""
rel_dict = {}
# output relation file
csvf_relation = open("relation_dict.csv", "w", newline='', encoding='utf-8')
w_relation = csv.writer(csvf_relation)
w_rel... | 32.378378 | 80 | 0.534391 | # vi: set ft=python sts=4 ts=4 sw=4 et:
import os
import csv
def collect_relations(file_name='ownthink_v2.csv'):
"""Get all unique relations."""
rel_dict = {}
# output relation file
csvf_relation = open("relation_dict.csv", "w", newline='', encoding='utf-8')
w_relation = csv.writer(csvf_relation... | 36 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 23 |
86af3493021fc803c2875cc14631bdd8241d8319 | 1,535 | py | Python | Introducing_CircuitPlaygroundExpress/CircuitPlaygroundExpress_AudioSine/code.py | claycooper/Adafruit_Learning_System_Guides | 890431bd4b9df929bc601e5886c2a735d89814f9 | [
"MIT"
] | null | null | null | Introducing_CircuitPlaygroundExpress/CircuitPlaygroundExpress_AudioSine/code.py | claycooper/Adafruit_Learning_System_Guides | 890431bd4b9df929bc601e5886c2a735d89814f9 | [
"MIT"
] | null | null | null | Introducing_CircuitPlaygroundExpress/CircuitPlaygroundExpress_AudioSine/code.py | claycooper/Adafruit_Learning_System_Guides | 890431bd4b9df929bc601e5886c2a735d89814f9 | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import time
import array
import math
import board
import digitalio
try:
from audiocore import RawSample
except ImportError:
from audioio import RawSample
try:
from audioio import AudioOut
except ImportErro... | 31.979167 | 95 | 0.744625 | # SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import time
import array
import math
import board
import digitalio
try:
from audiocore import RawSample
except ImportError:
from audioio import RawSample
try:
from audioio import AudioOut
except ImportErro... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c7247eec88133f20ed823babefa8db152456f367 | 17,666 | py | Python | src/checkrs/sim_cdf.py | timothyb0912/checkrs | 213ac39b5dccc0c38d984a66286174de070af00d | [
"BSD-3-Clause"
] | 2 | 2021-08-31T17:07:12.000Z | 2021-09-02T09:20:33.000Z | src/checkrs/sim_cdf.py | timothyb0912/checkrs | 213ac39b5dccc0c38d984a66286174de070af00d | [
"BSD-3-Clause"
] | 28 | 2020-09-26T01:38:14.000Z | 2020-12-03T00:47:22.000Z | src/checkrs/sim_cdf.py | timothyb0912/checkrs | 213ac39b5dccc0c38d984a66286174de070af00d | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Functions for plotting simulated vs observed cumulative distribution functions.
"""
from __future__ import absolute_import
import checkrs.base as base
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sbn
from checkrs.plot_utils import... | 35.191235 | 87 | 0.614627 | # -*- coding: utf-8 -*-
"""
Functions for plotting simulated vs observed cumulative distribution functions.
"""
from __future__ import absolute_import
import os
from typing import Dict
from typing import Iterable
from typing import List
from typing import Optional
import altair as alt
import attr
import checkrs.base ... | 0 | 7,887 | 0 | 0 | 0 | 0 | 0 | -9 | 223 |
5a2edae1fde1740b1290641cc2634614516685b6 | 382 | py | Python | dserver/__main__.py | dandk105/Asyncpyserver | 228671a7299214b503f440b8dea2773c3769e618 | [
"MIT"
] | null | null | null | dserver/__main__.py | dandk105/Asyncpyserver | 228671a7299214b503f440b8dea2773c3769e618 | [
"MIT"
] | null | null | null | dserver/__main__.py | dandk105/Asyncpyserver | 228671a7299214b503f440b8dea2773c3769e618 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# space level: 4
"""this module is the most importing in thie app.
"""
from dserver import ServerSocket as server
from config import ConfManage as conf
if __name__ == "__main__":
# would manage conf class
hostdata = conf("./conf/base.json")
hostdata.setup_logging()
server = se... | 22.470588 | 49 | 0.683246 | # -*- coding: utf-8 -*-
# space level: 4
"""this module is the most importing in thie app.
"""
from dserver import ServerSocket as server
from config import ConfManage as conf
if __name__ == "__main__":
# would manage conf class
hostdata = conf("./conf/base.json")
hostdata.setup_logging()
server = se... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
19bf9e0556d61188bc88bf1e77eb1fa49ee6106a | 239 | py | Python | app/utils.py | deviantthread/MagicFormula | f22d7d530929050c6cd2b20423c31f866751c7f6 | [
"Apache-2.0"
] | 17 | 2019-05-23T16:55:48.000Z | 2021-08-12T18:38:28.000Z | app/utils.py | deviantthread/MagicFormula | f22d7d530929050c6cd2b20423c31f866751c7f6 | [
"Apache-2.0"
] | 2 | 2020-01-30T16:45:30.000Z | 2020-05-08T21:35:00.000Z | app/utils.py | deviantthread/MagicFormula | f22d7d530929050c6cd2b20423c31f866751c7f6 | [
"Apache-2.0"
] | 6 | 2020-01-26T18:42:48.000Z | 2022-01-30T10:50:31.000Z |
# Add your own utility classes and functions here.
| 17.071429 | 50 | 0.631799 | from . import db
class ModelMixin(object):
def save(self):
# Save this model to the database.
db.session.add(self)
db.session.commit()
return self
# Add your own utility classes and functions here.
| 0 | 0 | 0 | 145 | 0 | 0 | 0 | -5 | 45 |
8122ac4323b3f9727d08324f79b9508409903093 | 4,073 | py | Python | SIGNUS/app/controllers/search.py | 837477/SIGNUS | cd395dfd45d2c36d09ec9a8069e6e52e19f058e8 | [
"MIT"
] | null | null | null | SIGNUS/app/controllers/search.py | 837477/SIGNUS | cd395dfd45d2c36d09ec9a8069e6e52e19f058e8 | [
"MIT"
] | null | null | null | SIGNUS/app/controllers/search.py | 837477/SIGNUS | cd395dfd45d2c36d09ec9a8069e6e52e19f058e8 | [
"MIT"
] | null | null | null | '''
Search Controller Module
'''
import math
from bson.json_util import dumps
from flask import current_app
from datetime import datetime
from app.models.mongodb.posts import Posts
from app.models.mongodb.user import User
from app.models.mongodb.search_log import SearchLog
def v1_search(mongo_cur, keywords, order, us... | 29.092857 | 89 | 0.57697 | '''
Search Controller Module
'''
import math
from bson.json_util import dumps
from flask import current_app
from datetime import datetime
from app.models.mongodb.posts import Posts
from app.models.mongodb.user import User
from app.models.mongodb.search_log import SearchLog
def v1_search(mongo_cur, keywords, order, us... | 429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ade08a55f673cefae524a9ff08cdfd340e5d3249 | 992 | py | Python | mgr/mgr/samples/urls.py | onap/vfc-gvnfm-vnfmgr | 237ff06c840543d78c715cc488692bc6a3cfb7bc | [
"Apache-2.0"
] | 1 | 2021-10-15T15:23:24.000Z | 2021-10-15T15:23:24.000Z | mgr/mgr/samples/urls.py | onap/vfc-gvnfm-vnfmgr | 237ff06c840543d78c715cc488692bc6a3cfb7bc | [
"Apache-2.0"
] | null | null | null | mgr/mgr/samples/urls.py | onap/vfc-gvnfm-vnfmgr | 237ff06c840543d78c715cc488692bc6a3cfb7bc | [
"Apache-2.0"
] | 1 | 2021-10-15T15:23:16.000Z | 2021-10-15T15:23:16.000Z | # Copyright 2017 ZTE Corporation.
#
# 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 ... | 41.333333 | 109 | 0.705645 | # Copyright 2017 ZTE Corporation.
#
# 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 ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2c7358c1382c40af8b18f20ce862f9e03188d010 | 956 | py | Python | brainex/experiments/meta.py | ebuntel/BrainExTemp | 991038155a6e9289af90da3d800210841ef23ff1 | [
"MIT"
] | 1 | 2020-09-04T16:15:26.000Z | 2020-09-04T16:15:26.000Z | brainex/experiments/meta.py | ebuntel/Brainextemp | 991038155a6e9289af90da3d800210841ef23ff1 | [
"MIT"
] | null | null | null | brainex/experiments/meta.py | ebuntel/Brainextemp | 991038155a6e9289af90da3d800210841ef23ff1 | [
"MIT"
] | null | null | null | # Jan28Report on General Accureacy #####################################################################################
# date = 'Jan-23-2020-22-N-noneSpark-R0-noOpt'
# notes = 'noneSpark-R0-noOpt'
# date = 'Jan-23-2020-21-N-UseSpark-R0-noOpt'
# notes = 'UseSpark-R0-noOpt'
# date = 'Jan-24-2020-2-N-UseSpark-R1-noOpt'
... | 45.52381 | 120 | 0.628661 | # Jan28Report on General Accureacy #####################################################################################
# date = 'Jan-23-2020-22-N-noneSpark-R0-noOpt'
# notes = 'noneSpark-R0-noOpt'
# date = 'Jan-23-2020-21-N-UseSpark-R0-noOpt'
# notes = 'UseSpark-R0-noOpt'
# date = 'Jan-24-2020-2-N-UseSpark-R1-noOpt'
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
059ca706a2b105444ff5df27e29f6a31260c0ac2 | 6,285 | py | Python | exercises/city_temperature_prediction.py | ShaharZuntz/IML.HUJI | 5804904840ac0fbdaa5b4cbf2df9348d276927d1 | [
"MIT"
] | null | null | null | exercises/city_temperature_prediction.py | ShaharZuntz/IML.HUJI | 5804904840ac0fbdaa5b4cbf2df9348d276927d1 | [
"MIT"
] | null | null | null | exercises/city_temperature_prediction.py | ShaharZuntz/IML.HUJI | 5804904840ac0fbdaa5b4cbf2df9348d276927d1 | [
"MIT"
] | null | null | null | from typing import List
from pandas import DataFrame
from scipy.stats import zscore
from IMLearn.learners.regressors import PolynomialFitting
from IMLearn.utils import split_train_test
import numpy as np
import pandas as pd
import plotly.express as px
import plotly.io as pio
Q2_SCATTER_PLOT_TITLE = ("Temperature in... | 30.509709 | 79 | 0.688465 | from typing import Tuple, Any, Union, List
import scipy.stats
from pandas import Series, DataFrame
from pandas.core.generic import NDFrame
from scipy.stats import zscore
from IMLearn.learners.regressors import PolynomialFitting
from IMLearn.utils import split_train_test
import numpy as np
import pandas as pd
import ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 42 | 45 |
c7325ba4a58ad20bab3d38c0047ad34ee324c512 | 1,736 | py | Python | scbt/actions.py | Jorch72/PythonBitTorrent | 53bb4420288e064f8ca2f6f2844a32afa0084b66 | [
"MIT"
] | 2 | 2015-06-16T02:04:03.000Z | 2017-01-05T19:44:29.000Z | scbt/actions.py | ddevault/scbt | 53bb4420288e064f8ca2f6f2844a32afa0084b66 | [
"MIT"
] | null | null | null | scbt/actions.py | ddevault/scbt | 53bb4420288e064f8ca2f6f2844a32afa0084b66 | [
"MIT"
] | null | null | null |
actions = dict()
# TODO: Remove this before releasing scbt
| 30.45614 | 82 | 0.608295 | import os
from datetime import datetime
from functools import wraps
actions = dict()
def action(f):
@wraps(f)
def wrapper(*args, **kwargs):
return f(*args, **kwargs)
actions[f.__name__] = f
return wrapper
@action
def add_torrent(session, payload):
path = payload.get("path")
if not pat... | 0 | 1,427 | 0 | 0 | 0 | 66 | 0 | 2 | 180 |
24d6b029b931b5c92bfb749057647d092e4bcb99 | 4,305 | py | Python | Fb-Post-Inviter.py | rohitcoder/Automation-Scripts | 34656f2b237a582bf864570375a36eb3a3233143 | [
"Apache-2.0"
] | null | null | null | Fb-Post-Inviter.py | rohitcoder/Automation-Scripts | 34656f2b237a582bf864570375a36eb3a3233143 | [
"Apache-2.0"
] | null | null | null | Fb-Post-Inviter.py | rohitcoder/Automation-Scripts | 34656f2b237a582bf864570375a36eb3a3233143 | [
"Apache-2.0"
] | null | null | null | import requests
import json
from bs4 import BeautifulSoup
import urlparse
burp0_url = "https://business.facebook.com/ufi/reaction/profile/browser/fetch/?limit=5000&total_count=5000&ft_ent_identifier=108566350975276&fb_dtsg_ag=AQxhzRLE9rpjfoRo1DHdRZ0DSQntKVunKgX-keo45t7N2Q:AQzSCWY38h7fU8ix7KUq66CzW1lEBK6d7q6b9qF1GVuN... | 134.53125 | 923 | 0.801858 | import requests
import json
from bs4 import BeautifulSoup
import urlparse
burp0_url = "https://business.facebook.com/ufi/reaction/profile/browser/fetch/?limit=5000&total_count=5000&ft_ent_identifier=108566350975276&fb_dtsg_ag=AQxhzRLE9rpjfoRo1DHdRZ0DSQntKVunKgX-keo45t7N2Q:AQzSCWY38h7fU8ix7KUq66CzW1lEBK6d7q6b9qF1GVuN... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
042b672d0c1ff8faf6acd9ae05f3802f8aca03f6 | 397 | py | Python | contas/models.py | acaciojunio28/CRUD-django | 62b34a544ec5a14c53172e9240a1f0b448ed7b69 | [
"Apache-2.0"
] | null | null | null | contas/models.py | acaciojunio28/CRUD-django | 62b34a544ec5a14c53172e9240a1f0b448ed7b69 | [
"Apache-2.0"
] | null | null | null | contas/models.py | acaciojunio28/CRUD-django | 62b34a544ec5a14c53172e9240a1f0b448ed7b69 | [
"Apache-2.0"
] | null | null | null |
# Create your models here.
| 24.8125 | 54 | 0.745592 | from django.db import models
# Create your models here.
class categoria(models.Model):
nome=models.CharField(max_length=100)
dt_criaçao=models.DateTimeField(auto_now_add=True)
class listar(models.Model):
nome = models.CharField(max_length=100)
valor= models.CharField(max_length=100)
unidade=model... | 2 | 0 | 0 | 293 | 0 | 0 | 0 | 7 | 68 |
7cb6858846589320c17fb4ea403321cc22f2fffc | 112 | py | Python | text/_cascade/element/_element.py | jedhsu/text | 8525b602d304ac571a629104c48703443244545c | [
"Apache-2.0"
] | null | null | null | text/_cascade/element/_element.py | jedhsu/text | 8525b602d304ac571a629104c48703443244545c | [
"Apache-2.0"
] | null | null | null | text/_cascade/element/_element.py | jedhsu/text | 8525b602d304ac571a629104c48703443244545c | [
"Apache-2.0"
] | null | null | null | """
*Element*
A CSS Element.
"""
| 8 | 27 | 0.625 | """
*Element*
A CSS Element.
"""
from abc import ABCMeta
class Element:
__metaclass__ = ABCMeta
| 0 | 0 | 0 | 21 | 0 | 0 | 0 | 2 | 46 |
3e0fbcb449b4cfa8bd257a18259a5527d4dbb40f | 641 | py | Python | portfolio/models.py | Aditya-aot/ION | 4789bb2e05fae48414eb829c3607c13a24349cd7 | [
"MIT"
] | null | null | null | portfolio/models.py | Aditya-aot/ION | 4789bb2e05fae48414eb829c3607c13a24349cd7 | [
"MIT"
] | null | null | null | portfolio/models.py | Aditya-aot/ION | 4789bb2e05fae48414eb829c3607c13a24349cd7 | [
"MIT"
] | 1 | 2022-02-16T10:43:57.000Z | 2022-02-16T10:43:57.000Z |
# Create your models here. | 33.736842 | 73 | 0.74103 | from django.db import models
from django.conf import settings
from django.contrib.auth.models import User , auth
from django.utils import timezone
# Create your models here.
class stock_port(models.Model) :
user = models.ForeignKey(User, on_delete=models.CASCADE, null = True)
name = models.TextField(null = ... | 0 | 0 | 0 | 419 | 0 | 0 | 0 | 59 | 136 |
b9bbe40517af05264261c3f6465a6deaa46f3523 | 786 | py | Python | zero_to_one_hundred/tests/test_main.py | fossabot/0to100 | 37faa1340b2ec8b87e5d4c268c8caf521ea164cb | [
"Apache-2.0"
] | null | null | null | zero_to_one_hundred/tests/test_main.py | fossabot/0to100 | 37faa1340b2ec8b87e5d4c268c8caf521ea164cb | [
"Apache-2.0"
] | null | null | null | zero_to_one_hundred/tests/test_main.py | fossabot/0to100 | 37faa1340b2ec8b87e5d4c268c8caf521ea164cb | [
"Apache-2.0"
] | null | null | null | """Unit tests."""
# pylint: disable=C0116,R0903,E0401,W0703,W1201,redefined-outer-name,missing-function-docstring,E0401,C0114,W0511,W1203,C0200,C0103,W1203
from main import run_main
def test_run_main(
get_args_create_section_processor,
get_args_refresh_links_processor,
get_args_refresh_puml_processor,
... | 34.173913 | 137 | 0.774809 | """Unit tests."""
# pylint: disable=C0116,R0903,E0401,W0703,W1201,redefined-outer-name,missing-function-docstring,E0401,C0114,W0511,W1203,C0200,C0103,W1203
from main import run_main
def test_run_main(
get_args_create_section_processor,
get_args_refresh_links_processor,
get_args_refresh_puml_processor,
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1225db4ffd2b439dfc6fac24400a2380348b7109 | 1,655 | py | Python | sdk/machinelearning/azure-mgmt-machinelearningcompute/azure/mgmt/machinelearningcompute/models/ssl_configuration.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/machinelearning/azure-mgmt-machinelearningcompute/azure/mgmt/machinelearningcompute/models/ssl_configuration.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/machinelearning/azure-mgmt-machinelearningcompute/azure/mgmt/machinelearningcompute/models/ssl_configuration.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 37.613636 | 81 | 0.598792 | # 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 ... | 0 | 0 | 0 | 1,118 | 0 | 0 | 0 | 17 | 46 |
efd8688b990c88981e88b5bbf3bf4ad0c1cba2df | 10,767 | py | Python | android_env/components/emulator_console.py | majacQ/android_env | 3703c9883aa445e93f151dad9332aa6b8f32eea4 | [
"Apache-2.0"
] | 1 | 2021-06-07T13:58:24.000Z | 2021-06-07T13:58:24.000Z | android_env/components/emulator_console.py | smbale/android_env | 5ecfbfe56bb5843b298791d3c8c73b01a79e864a | [
"Apache-2.0"
] | null | null | null | android_env/components/emulator_console.py | smbale/android_env | 5ecfbfe56bb5843b298791d3c8c73b01a79e864a | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 DeepMind Technologies Limited.
#
# 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 applic... | 37.256055 | 80 | 0.663973 | # coding=utf-8
# Copyright 2021 DeepMind Technologies Limited.
#
# 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 applic... | 0 | 0 | 0 | 9,710 | 0 | 0 | 0 | 18 | 269 |
c679d6b045ca8f35b52d519de118dd8764302a1b | 712 | py | Python | ebiznes/apps/service/admin.py | kaniak274/EBiznes | 5dcb10020b5af6b7ae57a70060605f6e5324b03a | [
"MIT"
] | null | null | null | ebiznes/apps/service/admin.py | kaniak274/EBiznes | 5dcb10020b5af6b7ae57a70060605f6e5324b03a | [
"MIT"
] | 1 | 2019-10-30T06:26:36.000Z | 2019-11-20T17:07:25.000Z | ebiznes/apps/service/admin.py | kaniak274/EBiznes | 5dcb10020b5af6b7ae57a70060605f6e5324b03a | [
"MIT"
] | 1 | 2019-11-12T19:09:05.000Z | 2019-11-12T19:09:05.000Z | from django.contrib import admin
admin.site.register(Profession)
admin.site.register(Service, ServiceAdmin)
admin.site.register(Rating, RatingAdmin)
admin.site.register(Rent, RentAdmin)
admin.site.register(PriceList, PriceListAdmin)
admin.site.register(Order)
| 25.428571 | 79 | 0.738764 | from django.contrib import admin
from .models import *
class ServiceAdmin(admin.ModelAdmin):
list_display = ('__str__', 'owner', 'city', 'profession', 'account_number')
class RatingAdmin(admin.ModelAdmin):
list_display = ('__str__', 'owner', 'service', 'rating',)
class RentAdmin(admin.ModelAdmin):
li... | 0 | 0 | 0 | 331 | 0 | 0 | 0 | 0 | 115 |
569065124cbd11728d67697d3d36bb715343e14a | 294 | py | Python | pinakes/main/common/tests/functional/test_about.py | hsong-rh/pinakes | 2f08cb757ca64c866af3244686b92a3074fc7571 | [
"Apache-2.0"
] | 2 | 2022-03-17T18:53:58.000Z | 2022-03-17T22:04:22.000Z | pinakes/main/common/tests/functional/test_about.py | hsong-rh/pinakes | 2f08cb757ca64c866af3244686b92a3074fc7571 | [
"Apache-2.0"
] | 9 | 2022-03-18T08:22:57.000Z | 2022-03-30T17:14:49.000Z | pinakes/main/common/tests/functional/test_about.py | hsong-rh/pinakes | 2f08cb757ca64c866af3244686b92a3074fc7571 | [
"Apache-2.0"
] | 7 | 2022-03-17T22:03:08.000Z | 2022-03-28T21:28:34.000Z | """Test about view"""
| 24.5 | 49 | 0.707483 | """Test about view"""
import pytest
@pytest.mark.django_db
def test_about(api_request):
"""Test about GET endpoint"""
response = api_request("get", "common:about")
assert response.status_code == 200
assert "product_name" in response.data
assert "version" in response.data
| 0 | 234 | 0 | 0 | 0 | 0 | 0 | -8 | 45 |
36ba270c3402aa4a3591c37c11d1cf962bf5bbc1 | 366 | py | Python | StalinSort.py | joscha0/ExoticAlgorithms | 86601200e1bf590fbd246a6c6677ac6e850b9e1c | [
"MIT"
] | null | null | null | StalinSort.py | joscha0/ExoticAlgorithms | 86601200e1bf590fbd246a6c6677ac6e850b9e1c | [
"MIT"
] | null | null | null | StalinSort.py | joscha0/ExoticAlgorithms | 86601200e1bf590fbd246a6c6677ac6e850b9e1c | [
"MIT"
] | 2 | 2019-04-03T09:04:36.000Z | 2019-05-17T13:19:54.000Z |
if __name__ == "__main__":
list1 = [1,4,2,5,6,5,3]
print('\n\n-----Stalin Sorting Algorithm-----\n')
print('unsorted list: '+str(list1))
print('sorted list: '+str(stalinSort(list1))) | 28.153846 | 53 | 0.571038 | def stalinSort(lst):
sorted_list = [lst[0]]
for i in lst[1:]:
if i >= sorted_list[-1]:
sorted_list.append(i)
return sorted_list
if __name__ == "__main__":
list1 = [1,4,2,5,6,5,3]
print('\n\n-----Stalin Sorting Algorithm-----\n')
print('unsorted list: '+str(list1))
pri... | 0 | 0 | 0 | 0 | 0 | 138 | 0 | 0 | 22 |
f9e994ad70317ea383079aa8f894e5717769e495 | 834 | py | Python | unionchan/runlocal.py | mochidaz/union-chan | 410e77e33ce4263d0adff0c7303d9413eb5faab9 | [
"MIT"
] | 4 | 2020-07-19T13:41:42.000Z | 2020-08-03T05:47:59.000Z | unionchan/runlocal.py | mochidaz/union-chan | 410e77e33ce4263d0adff0c7303d9413eb5faab9 | [
"MIT"
] | 4 | 2020-11-13T18:59:33.000Z | 2022-02-10T02:14:45.000Z | unionchan/runlocal.py | mochidaz/union-chan | 410e77e33ce4263d0adff0c7303d9413eb5faab9 | [
"MIT"
] | 3 | 2020-07-19T16:07:25.000Z | 2021-01-31T13:45:03.000Z | import tflearn
from utils.utils import net
model = tflearn.DNN(net)
model.load("model/model.tfl")
if __name__ == '__main__':
chat()
| 23.828571 | 64 | 0.589928 | import numpy
import tflearn
import tensorflow
import json
import random
import datetime
from utils.utils import net, label, kata, data, sekantung_kata
model = tflearn.DNN(net)
model.load("model/model.tfl")
def chat():
while True:
content = str(input("Pengguna: "))
if content == "dadah":
... | 0 | 0 | 0 | 0 | 0 | 564 | 0 | -2 | 133 |
d151688d7ced74000a8d74c506785adc3588f6a1 | 668 | py | Python | pages/artefacts/contents/SSD/exercises/recursion.py | yinpinglai/ypinglai.github.io | f82e6380061ec30eb9d71739cedb9115671af565 | [
"CC-BY-3.0"
] | null | null | null | pages/artefacts/contents/SSD/exercises/recursion.py | yinpinglai/ypinglai.github.io | f82e6380061ec30eb9d71739cedb9115671af565 | [
"CC-BY-3.0"
] | null | null | null | pages/artefacts/contents/SSD/exercises/recursion.py | yinpinglai/ypinglai.github.io | f82e6380061ec30eb9d71739cedb9115671af565 | [
"CC-BY-3.0"
] | null | null | null |
if __name__ == '__main__':
n = 4
Solution().tower_of_hanoi(n, 'A', 'B', 'C')
| 30.363636 | 77 | 0.679641 | class Solution:
def tower_of_hanoi(self, n, source, destination, auxiliary):
'''Recursive function for solving the tower of hanoi problem'''
# Base case for the recursion function
if n == 1:
print(f'Move disk 1 from source {source} to destination {destination}')
return
# Move from s... | 0 | 0 | 0 | 562 | 0 | 0 | 0 | 0 | 22 |
f9075a7a8b5220a708c1cc2264c0723cb62d18d5 | 1,029 | py | Python | backend/app/app/crud/crud_item.py | L3RAT/passvortex | ddfac2d4969f2be60d19a9ca857e58939aa8f128 | [
"MIT"
] | null | null | null | backend/app/app/crud/crud_item.py | L3RAT/passvortex | ddfac2d4969f2be60d19a9ca857e58939aa8f128 | [
"MIT"
] | null | null | null | backend/app/app/crud/crud_item.py | L3RAT/passvortex | ddfac2d4969f2be60d19a9ca857e58939aa8f128 | [
"MIT"
] | null | null | null | from app.models.item import Item
item = CRUDItem(Item)
| 27.810811 | 76 | 0.620991 | from typing import List
from fastapi.encoders import jsonable_encoder
from sqlalchemy.orm import Session
from app.core.security import encrypt_secret
from app.crud.base import CRUDBase
from app.models.item import Item
from app.schemas.item import ItemCreate, ItemUpdate
import json
class CRUDItem(CRUDBase[Item, ItemCre... | 0 | 0 | 0 | 700 | 0 | 0 | 0 | 95 | 177 |
d9c9d7b3236a94973bc2fb541d5f643b9f229cdf | 38 | py | Python | for2.py | praveenpmin/Python | 513fcde7430b03a187e2c7e58302b88645388eed | [
"MIT"
] | null | null | null | for2.py | praveenpmin/Python | 513fcde7430b03a187e2c7e58302b88645388eed | [
"MIT"
] | null | null | null | for2.py | praveenpmin/Python | 513fcde7430b03a187e2c7e58302b88645388eed | [
"MIT"
] | null | null | null | for i in range(0, 10):
print (i), | 19 | 23 | 0.526316 | for i in range(0, 10):
print (i), | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
87717b27eb0ad86fca3a1abc5a9c047b441ba6f0 | 1,707 | py | Python | vendors/spiders/goudenton.py | nl-hugo/grapy | b72216f0a1c93286575d4c1d81c1f4825021dfec | [
"MIT"
] | 2 | 2018-08-02T20:33:44.000Z | 2018-11-14T12:57:28.000Z | vendors/spiders/goudenton.py | nl-hugo/grapy | b72216f0a1c93286575d4c1d81c1f4825021dfec | [
"MIT"
] | null | null | null | vendors/spiders/goudenton.py | nl-hugo/grapy | b72216f0a1c93286575d4c1d81c1f4825021dfec | [
"MIT"
] | 1 | 2019-01-10T16:19:35.000Z | 2019-01-10T16:19:35.000Z | # -*- coding: utf-8 -*-
| 36.319149 | 98 | 0.625073 | # -*- coding: utf-8 -*-
import scrapy
from vendors.items import VendorWine
from vendors.utils import float_or_none
def find_property(response, label):
result = response.css('#product-attribute-specs-table') \
.xpath('//th[contains(text(), "{}")]/following-sibling::td/text()'.format(label)).get()
if r... | 0 | 0 | 0 | 1,294 | 0 | 249 | 0 | 25 | 113 |
1a716336214a081c4e22fedb7d3a76054d86896e | 3,858 | py | Python | ir_datasets/datasets/clirmatrix.py | seanmacavaney/ir_datasets | a8e56f53bb06fcf11164fb0ffc4afc497a6e7507 | [
"Apache-2.0"
] | null | null | null | ir_datasets/datasets/clirmatrix.py | seanmacavaney/ir_datasets | a8e56f53bb06fcf11164fb0ffc4afc497a6e7507 | [
"Apache-2.0"
] | null | null | null | ir_datasets/datasets/clirmatrix.py | seanmacavaney/ir_datasets | a8e56f53bb06fcf11164fb0ffc4afc497a6e7507 | [
"Apache-2.0"
] | null | null | null | import ir_datasets
NAME = 'clirmatrix'
_logger = ir_datasets.log.easy()
QRELS_DEFS = {
6: "6",
5: "5",
4: "4",
3: "3",
2: "2",
1: "1",
0: "0",
}
collection = _init()
| 44.860465 | 883 | 0.608087 | import contextlib
from pathlib import Path
from typing import NamedTuple
import ir_datasets
from ir_datasets.util import GzipExtract, DownloadConfig, _DownloadConfig
from ir_datasets.datasets.base import Dataset, YamlDocumentation
from ir_datasets.formats import TsvDocs, CLIRMatrixQueries, CLIRMatrixQrels
NAME = 'clir... | 0 | 0 | 0 | 0 | 0 | 3,348 | 0 | 156 | 155 |
f7e0dea9de8ac33acc29d4283d1db7dc1b9430a5 | 198 | py | Python | CSES/Dynamic_Programming/Dice_Combinations.py | kancharlaraju21/Competitive_Programming | 98dc9ff17ce42a5b884b0460c161b42bbb203f0e | [
"MIT"
] | null | null | null | CSES/Dynamic_Programming/Dice_Combinations.py | kancharlaraju21/Competitive_Programming | 98dc9ff17ce42a5b884b0460c161b42bbb203f0e | [
"MIT"
] | null | null | null | CSES/Dynamic_Programming/Dice_Combinations.py | kancharlaraju21/Competitive_Programming | 98dc9ff17ce42a5b884b0460c161b42bbb203f0e | [
"MIT"
] | null | null | null | n=int(input())
m=1000000007
dp=[0]*(n+1)
dp[0]=1
for i in range(1,n+1):
for j in range(1,7):
if i-j >= 0:
dp[i]=(dp[i]+dp[i-j])%m
else:
break
print(dp[n]) | 18 | 35 | 0.449495 | n=int(input())
m=1000000007
dp=[0]*(n+1)
dp[0]=1
for i in range(1,n+1):
for j in range(1,7):
if i-j >= 0:
dp[i]=(dp[i]+dp[i-j])%m
else:
break
print(dp[n]) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
035212274fe5f2c36cd9bf6f0401cf06e9c747da | 807 | py | Python | class_n_objects.py | ntnshrm87/OOP-Basics-Python | 4387c4c565266dc93fc8b03484dea59ef47f59c8 | [
"MIT"
] | 1 | 2018-06-28T16:20:45.000Z | 2018-06-28T16:20:45.000Z | class_n_objects.py | ntnshrm87/OOP-Basics-Python | 4387c4c565266dc93fc8b03484dea59ef47f59c8 | [
"MIT"
] | null | null | null | class_n_objects.py | ntnshrm87/OOP-Basics-Python | 4387c4c565266dc93fc8b03484dea59ef47f59c8 | [
"MIT"
] | null | null | null | # This is a small python snippet which introduces how to create a class with a constructor,
# some functions inside the class and their usage.
# Creating an instance of object
x = Store("Security Books")
# Adding items in stock
x.add_item("Gray Hat Hacking", 34)
x.add_item("Rafay Baloch", 34.42)
# Total of stock ite... | 27.827586 | 91 | 0.634449 | # This is a small python snippet which introduces how to create a class with a constructor,
# some functions inside the class and their usage.
class Store:
def __init__(self, name):
self.name = name
self.items = []
def add_item(self, name, price):
''' A function to add items in store l... | 0 | 0 | 0 | 411 | 0 | 0 | 0 | 0 | 23 |