hexsha stringlengths 40 40 | size int64 6 782k | ext stringclasses 7
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 237 | max_stars_repo_name stringlengths 6 72 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses list | max_stars_count int64 1 53k ⌀ | 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 184 | max_issues_repo_name stringlengths 6 72 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses list | max_issues_count int64 1 27.1k ⌀ | 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 184 | max_forks_repo_name stringlengths 6 72 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses list | max_forks_count int64 1 12.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 6 782k | avg_line_length float64 2.75 664k | max_line_length int64 5 782k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cd5d30edb941ca4c80e7254ca7f23547afb5655e | 284 | py | Python | src/bubbleplots/bubble.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | src/bubbleplots/bubble.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | src/bubbleplots/bubble.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | # bubble plots
#plotly
import plotly.express as px
df = px.data.gapminder()
fig = px.scatter(df.query("year==2007"), x="gdpPercap", y="lifeExp",
size="pop", color="continent",
hover_name="country", log_x=True, size_max=60, template = "gridon")
fig.show()
| 25.818182 | 84 | 0.633803 |
f8c449b70c9e3d22725fcb8711890c1f07847700 | 227 | py | Python | Source/13_requests/app3_auth.py | rbiotblbk/WBS_T9_2022 | 533156db88ff2fe676564b0e5d6e84e888ab0916 | [
"MIT"
] | 1 | 2022-02-28T09:49:35.000Z | 2022-02-28T09:49:35.000Z | Source/13_requests/app3_auth.py | rbiotblbk/WBS_T9_2022 | 533156db88ff2fe676564b0e5d6e84e888ab0916 | [
"MIT"
] | null | null | null | Source/13_requests/app3_auth.py | rbiotblbk/WBS_T9_2022 | 533156db88ff2fe676564b0e5d6e84e888ab0916 | [
"MIT"
] | null | null | null |
import requests
URL = "https://httpbin.org/basic-auth/usermohamed/passtesting"
username = "usermohamed"
password = "passtesting"
# Basic Authentication with the API
r = requests.get(URL, auth=(username,password))
print(r) | 17.461538 | 62 | 0.753304 |
e4c046bb8d58fc5ec80f144ff9df084229649092 | 1,836 | py | Python | research/cv/metric_learn/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/metric_learn/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/metric_learn/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | 39.913043 | 88 | 0.674837 |
843443634a12c57b0c35adbf33ca71e04770591f | 3,925 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/detector/routeUsage.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/detector/routeUsage.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/detector/routeUsage.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2007-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.ec... | 38.480392 | 113 | 0.650446 |
4b7837f2536666340920a7a1073a3cc5832fe87d | 3,906 | py | Python | marsyas-vamp/marsyas/scripts/chord-detection/scripts/AccumulateChroma.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/chord-detection/scripts/AccumulateChroma.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/chord-detection/scripts/AccumulateChroma.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from math import sqrt
import argparse
from marsyas import *
from os import path, mkdir, makedirs
majTriad = [1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0]
augTriad = [1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0]
minTriad = [1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0]
dimTriad = [1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0]
noChord... | 33.384615 | 99 | 0.566308 |
8a82df0b3d3f354d22074075228add3737ef8d68 | 1,403 | py | Python | books/PythonCleanCode/ch6_descriptors/descriptors_pythonic_1.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch6_descriptors/descriptors_pythonic_1.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch6_descriptors/descriptors_pythonic_1.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """Clean Code in Python - Chapter 6: Descriptors
> A Pythonic Implementation
"""
import time
class Traveller:
"""A person visitting several cities.
We wish to track the path of the traveller, as he or she
new city.
>>> alice = Traveller("Alice", "Barcelona")
>>> alice.current_ci... | 25.509091 | 61 | 0.612259 |
76dd721b794e54e0117a9e1ea07658b6377c42d9 | 1,855 | py | Python | website-addons-14.0/website_seo_url/models.py | Reathline/DOD_PODCAST | ffadd4bd11f268d9983668b87348f29dd2f4a6a5 | [
"MIT"
] | null | null | null | website-addons-14.0/website_seo_url/models.py | Reathline/DOD_PODCAST | ffadd4bd11f268d9983668b87348f29dd2f4a6a5 | [
"MIT"
] | null | null | null | website-addons-14.0/website_seo_url/models.py | Reathline/DOD_PODCAST | ffadd4bd11f268d9983668b87348f29dd2f4a6a5 | [
"MIT"
] | null | null | null | # Copyright 2021 Ivan Yelizariev <https://twitter.com/yelizariev>
# Copyright 2021 Denis Mudarisov <https://github.com/trojikman>
# License MIT (https://opensource.org/licenses/MIT).
from odoo import _, api, models
from odoo.exceptions import ValidationError
from odoo.addons.website.models.website import slugify
cl... | 30.916667 | 96 | 0.543935 |
76fd7ccf4ddf2e208624553713d3707c903cfccf | 767 | py | Python | src/onegov/election_day/utils/ballot.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/utils/ballot.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/utils/ballot.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | def get_ballot_data_by_entity(ballot):
""" Returns the yeas/nays percentage by entity_id. """
data = {}
for result in ballot.results:
entity = {'counted': result.counted}
if result.counted:
entity['percentage'] = result.yeas_percentage
data[result.entity_id] = entity
... | 27.392857 | 75 | 0.627119 |
0a37888607d28c0d997e4056203fa034665d63a6 | 5,851 | py | Python | research/audio/tacotron2/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/audio/tacotron2/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/audio/tacotron2/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | 39.006667 | 111 | 0.62109 |
6a7d77eb21de1a8b31ca56480ad2f8c374368fb3 | 151 | py | Python | Algorithms/Sorting/tutorial_challenges.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Sorting/tutorial_challenges.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Sorting/tutorial_challenges.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
n = int(input().strip())
V = int(input().strip())
ar = list(map(int, input().strip().split()))
print(ar.index(n))
| 15.1 | 44 | 0.615894 |
6ac09aaf1264fff57924d7dd17d0f9a43bdf55c1 | 22,773 | py | Python | Packs/TrustwaveFusion/Integrations/TrustwaveFusion/TrustwaveFusion.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | null | null | null | Packs/TrustwaveFusion/Integrations/TrustwaveFusion/TrustwaveFusion.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 60 | 2022-02-24T14:54:47.000Z | 2022-03-31T10:38:41.000Z | Packs/TrustwaveFusion/Integrations/TrustwaveFusion/TrustwaveFusion.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | null | null | null | """Trustwave Fusion Integration for Cortex XSOAR"""
import demistomock as demisto
from CommonServerPython import * # noqa # pylint: disable=unused-wildcard-import
from CommonServerUserPython import * # noqa
import requests
import traceback
from typing import Dict, Any
import urllib.parse
# Disable insecure warning... | 31.497925 | 90 | 0.573354 |
0ac7fc812423071a726e272575add3654d252d99 | 12,384 | py | Python | retro/data/__init__.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 2,706 | 2018-04-05T18:28:50.000Z | 2022-03-29T16:56:59.000Z | retro/data/__init__.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 242 | 2018-04-05T22:30:42.000Z | 2022-03-19T01:55:11.000Z | retro/data/__init__.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 464 | 2018-04-05T19:10:34.000Z | 2022-03-28T13:33:32.000Z | from retro._retro import GameDataGlue, RetroEmulator, data_path as _data_path
import glob
import hashlib
import json
import os
import sys
try:
import enum
from enum import Flag
except ImportError:
# Python < 3.6 doesn't support Flag, so we polyfill it ourself
class Flag(enum.Enum):
def __and__(... | 29.207547 | 167 | 0.592216 |
0ae05899019c9ca44a26e24064c9c9f1c39f8852 | 882 | py | Python | Coursera/Using Databases with Python/Week-2/Excercise/emaildb.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 331 | 2019-10-22T09:06:28.000Z | 2022-03-27T13:36:03.000Z | Coursera/Using Databases with Python/Week-2/Excercise/emaildb.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 8 | 2020-04-10T07:59:06.000Z | 2022-02-06T11:36:47.000Z | Coursera/Using Databases with Python/Week-2/Excercise/emaildb.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 572 | 2019-07-28T23:43:35.000Z | 2022-03-27T22:40:08.000Z | import sqlite3
conn = sqlite3.connect('emaildb.sqlite')
cur = conn.cursor()
cur.execute('Drop table if exists counts')
cur.execute('''
CREATE TABLE Counts(email TEXT, count INTEGER)''')
fname = input('Enter file name: ')
if(len(fname) < 1):
fname = 'mbox-short.txt'
fh = open(fname)
for line in fh:... | 22.615385 | 84 | 0.623583 |
7ca6f2143f49c35a61f466776d88559341d298a3 | 244 | py | Python | Data-Structures/Linkedlist/ReverseLinkedList.py | M-Usman-Tahir/Data-Structures-and-Algorithms | 08331182f0bbfd85fcdba50477dcf408b09a37cd | [
"Apache-2.0"
] | 2 | 2021-12-13T10:09:47.000Z | 2022-01-05T11:04:31.000Z | Data-Structures/Linkedlist/ReverseLinkedList.py | M-Usman-Tahir/Data-Structures-and-Algorithms | 08331182f0bbfd85fcdba50477dcf408b09a37cd | [
"Apache-2.0"
] | 1 | 2021-10-15T17:55:47.000Z | 2021-10-17T20:43:15.000Z | Data-Structures/Linkedlist/ReverseLinkedList.py | M-Usman-Tahir/Data-Structures-and-Algorithms | 08331182f0bbfd85fcdba50477dcf408b09a37cd | [
"Apache-2.0"
] | 4 | 2021-10-12T13:05:10.000Z | 2021-10-16T19:31:46.000Z | def reversedLinkedList(head):
prev = None
curr = head
nisql = head.next
while True:
curr.next = prev
if not nisql:
break
tmp_curr = curr
curr = nisql
nisql = curr.next
prev = tmp_curr
return curr
| 13.555556 | 29 | 0.598361 |
6b2833060ea1114f7304cae0010e17111429504f | 17,148 | py | Python | Packs/Safewalk/Integrations/SafewalkReports/SafewalkReports.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Safewalk/Integrations/SafewalkReports/SafewalkReports.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Safewalk/Integrations/SafewalkReports/SafewalkReports.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from datetime import datetime, timedelta
import urllib3
import json
import dateparser
from typing import Any, Dict
from CommonServerPython import *
urllib3.disable_warnings()
DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
MAX_INCIDENTS_TO_FETCH = 50
HELLOWORLD_SEVERITIES = ['Low', 'Medium', 'High', 'Critical']
class Client(B... | 31.234973 | 130 | 0.651213 |
6b388ac93bc5af811abe4ca138f8c495d7cd7d6c | 41,556 | py | Python | Packs/ThreatGrid/Integrations/ThreatGrid/ThreatGrid.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ThreatGrid/Integrations/ThreatGrid/ThreatGrid.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ThreatGrid/Integrations/ThreatGrid/ThreatGrid.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import requests
import demistomock as demisto
from CommonServerPython import *
requests.packages.urllib3.disable_warnings()
if not demisto.getParam('proxy'):
del os.environ['HTTP_PROXY']
del os.environ['HTTPS_PROXY']
del os.environ['http_proxy']
del os.environ['https_proxy']
URL = demisto.getParam('... | 35.548332 | 119 | 0.580277 |
861cadc14491249963c7566add59bf833ab9f63c | 638 | py | Python | python/advanced_sw/GITHUB/test.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/advanced_sw/GITHUB/test.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/advanced_sw/GITHUB/test.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import urllib.request, urllib.parse, urllib.error
from bs4 import BeautifulSoup
import ssl
import re
import sqlite3
import requests
import datetime
import os
import sys
import argparse
import random
import lxml.html as lh
import wget
from urllib.request import Request, urlopen
# Ignore SSL certificate errors
ctx = ssl... | 21.266667 | 83 | 0.768025 |
864a0cf9bb1900b98cecaf7a198ea8bada227830 | 2,421 | py | Python | python/oneflow/nn/modules/stack.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/nn/modules/stack.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/nn/modules/stack.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 32.716216 | 105 | 0.663775 |
be09e91324b6ae5f4fba9f745e096d7214c4fb5d | 670 | py | Python | source/pkgsrc/lang/python27/patches/patch-Lib_tarfile.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/lang/python27/patches/patch-Lib_tarfile.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/lang/python27/patches/patch-Lib_tarfile.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-Lib_tarfile.py,v 1.2 2020/09/20 12:10:27 mgorny Exp $
bpo-39017 (CVE-2019-20907): infinite loop in tarfile.py
taken from:
https://gitweb.gentoo.org/fork/cpython.git/commit/?h=gentoo-2.7-vanilla&id=893e6e3aee483d262df70656a68f63f601720fcd
--- Lib/tarfile.py.orig 2020-04-19 21:13:39.000000000 +0000
+++ ... | 35.263158 | 115 | 0.637313 |
ed4b7523c67c2ed225b59b0288ed36aa0a766863 | 175 | py | Python | funpmp/worktime.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2017-10-23T14:58:47.000Z | 2017-10-23T14:58:47.000Z | funpmp/worktime.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | null | null | null | funpmp/worktime.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2018-04-06T07:49:18.000Z | 2018-04-06T07:49:18.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def fit(best, possible, bad):
return (best + 4 * possible + bad) / 6
if __name__ == '__main__':
print(fit(12, 10, 7))
| 17.5 | 42 | 0.571429 |
71eb5bd5e9b0cf46100b479ece32f2a491ff9f79 | 7,421 | py | Python | Packs/Trello/Integrations/Trello/Trello_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Trello/Integrations/Trello/Trello_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Trello/Integrations/Trello/Trello_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import pytest
import os
import json
from Trello import Client, select_outputs, select_outputs_camelize
"""
Test script for the Trello Integration
To test properly, setup a new board with at least one list and pass the ID as environment variable TEST_BOARD.
This test suite runs both unit tests and integration tests
... | 30.539095 | 114 | 0.697345 |
9c56d0131b815f7130c1a36eddc5c4674d3b5cd1 | 14,582 | py | Python | Packs/BitcoinAbuse/Integrations/BitcoinAbuse/BitcoinAbuse.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | Packs/BitcoinAbuse/Integrations/BitcoinAbuse/BitcoinAbuse.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | Packs/BitcoinAbuse/Integrations/BitcoinAbuse/BitcoinAbuse.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | import demistomock as demisto # noqa: F401
from CSVFeedApiModule import *
from CommonServerPython import * # noqa: F401
# disable insecure warnings
urllib3.disable_warnings()
''' CONSTANTS '''
SERVER_URL = 'https://www.bitcoinabuse.com/api/'
ABUSE_TYPE_ID_TO_NAME: Dict[str, str] = {
'1': 'ransomware',
'2': ... | 38.172775 | 119 | 0.652448 |
b973a25721a3270eee4efe955862cb743f2c869c | 6,787 | py | Python | src/Core/DevOps/Locust/locustfile.py | PuetzD/platform | ad8227ecb96f49083666172461de6e7d3c9d4c1d | [
"MIT"
] | null | null | null | src/Core/DevOps/Locust/locustfile.py | PuetzD/platform | ad8227ecb96f49083666172461de6e7d3c9d4c1d | [
"MIT"
] | null | null | null | src/Core/DevOps/Locust/locustfile.py | PuetzD/platform | ad8227ecb96f49083666172461de6e7d3c9d4c1d | [
"MIT"
] | null | null | null | import requests
import time
import csv
import os
import random
import uuid
import json
from locust import HttpUser, task, between, constant
class Purchaser(HttpUser):
weight = 10
wait_time = constant(15)
countryId = 1
salutationId = 1
def on_start(self):
self.initRegister()
self.re... | 30.164444 | 88 | 0.511124 |
0ecc910c8812dc228e5b0df099b14b4d54f26118 | 39,378 | py | Python | Packs/VirusTotal/Integrations/VirusTotal_V3_Premium/VirusTotal_V3_Premium.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/VirusTotal/Integrations/VirusTotal_V3_Premium/VirusTotal_V3_Premium.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/VirusTotal/Integrations/VirusTotal_V3_Premium/VirusTotal_V3_Premium.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | """
VirusTotal V3 - Premium API
Difference: https://developers.virustotal.com/v3.0/reference#public-vs-premium-api
"""
import copy
from typing import Tuple, Iterable
import urllib3
from dateparser import parse
from CommonServerPython import *
# Disable insecure warnings
urllib3.disable_warnings() # pylint: disable... | 35.253357 | 117 | 0.597821 |
16aa5c0cb8fd8ce3c9a633e40c73716928fe0030 | 1,055 | py | Python | tests/integration/filters/test_xyz_filters.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 1,142 | 2016-10-10T08:55:30.000Z | 2022-03-30T04:46:16.000Z | tests/integration/filters/test_xyz_filters.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 195 | 2016-10-10T08:30:37.000Z | 2022-02-17T12:51:17.000Z | tests/integration/filters/test_xyz_filters.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 215 | 2017-02-28T00:50:29.000Z | 2022-03-22T17:01:31.000Z | import pytest
from numpy.testing import assert_array_equal
@pytest.mark.usefixtures("simple_pyntcloud")
def test_BBOX_default_values(simple_pyntcloud):
"""
Default bounding box values are infinite so all points
should pass the filter.
"""
result = simple_pyntcloud.get_filter("BBOX")
assert al... | 22.446809 | 80 | 0.581991 |
bc945e8b3460069c38f9c7f4c0b2a01bd68ac12e | 15,060 | py | Python | Implementation/vibrostudies-backend/db/migrations/0001_initial.py | VibroStudies/vibrostudies | 24491d4dd193655e3036354174babc4ab17a8639 | [
"MIT"
] | null | null | null | Implementation/vibrostudies-backend/db/migrations/0001_initial.py | VibroStudies/vibrostudies | 24491d4dd193655e3036354174babc4ab17a8639 | [
"MIT"
] | null | null | null | Implementation/vibrostudies-backend/db/migrations/0001_initial.py | VibroStudies/vibrostudies | 24491d4dd193655e3036354174babc4ab17a8639 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.9 on 2020-09-22 00:29
import db.utils
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
... | 51.22449 | 212 | 0.586521 |
bcf69834429774e640018d1824d770f57818c0d8 | 3,728 | py | Python | tests/addons/log2reqs/test_plain.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 11 | 2017-10-02T01:29:12.000Z | 2022-03-31T08:37:22.000Z | tests/addons/log2reqs/test_plain.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 79 | 2017-07-16T14:47:17.000Z | 2022-03-31T08:49:14.000Z | tests/addons/log2reqs/test_plain.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 2 | 2019-01-28T06:11:58.000Z | 2021-01-25T07:21:21.000Z | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import pytest
from owlmixin.util import load_yaml
from jumeaux.addons.log2reqs.plain import Executor
from jumeaux.models import Log2ReqsAddOnPayload
# Line break is ignored. (examinee has 3 not 4)
REQUESTS = """
/path1?a=1
/path2?a=1&b=2
/path3?a=1&a=2&b=1
/path4?a=1&b
/p... | 37.28 | 100 | 0.409603 |
4c620a9487076918f3668af024e36430e234eca7 | 3,155 | py | Python | misc/IronOxide/solve.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | null | null | null | misc/IronOxide/solve.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | null | null | null | misc/IronOxide/solve.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | null | null | null | from pwn import *
while True:
p = process("./IronOxide") if not args.REMOTE else remote(args.HOST, int(args.PORT))
import itertools
from functools import reduce
data = []
sign = lambda x: 0 if x == 0 else x // abs(x)
from operator import add
from functools import reduce
for i in range(25... | 34.67033 | 140 | 0.536292 |
914c18222ae48be20b5bcf15d0192d2fb5ee107b | 9,066 | py | Python | retro/examples/interactive.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 2,706 | 2018-04-05T18:28:50.000Z | 2022-03-29T16:56:59.000Z | retro/examples/interactive.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 242 | 2018-04-05T22:30:42.000Z | 2022-03-19T01:55:11.000Z | retro/examples/interactive.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 464 | 2018-04-05T19:10:34.000Z | 2022-03-28T13:33:32.000Z | """
Interact with Gym environments using the keyboard
An adapter object is defined for each environment to map keyboard commands to actions and extract observations as pixels.
"""
import sys
import ctypes
import argparse
import abc
import time
import numpy as np
import retro
import pyglet
from pyglet import gl
from ... | 35.276265 | 178 | 0.589345 |
fc376707c5b4def1dc840f9ae13a78ef2f208630 | 2,163 | py | Python | apps/multivers/urls.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | null | null | null | apps/multivers/urls.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | null | null | null | apps/multivers/urls.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', view=views.Index.as_view(), name='index'),
url(r'^code(/(?P<code>[0-9]+))?$', view=views.SaveCode.as_view(), name='code'),
url(r'^customer/(?P<pk>[0-9]+)/edit$', view=views.CustomerUpdate.as_view(), name='customer_upd... | 65.545455 | 139 | 0.676838 |
db5167b961f52c67a5e9cc45dc4f6b810e69d1d4 | 165 | py | Python | DataStructures/Arrays/LeftRotation.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/Arrays/LeftRotation.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/Arrays/LeftRotation.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
n, d = map(int, raw_input().split())
array = raw_input().split()
d = d % n
while(d):
array.append(array.pop(0))
d -= 1
print ' '.join(array)
| 15 | 36 | 0.581818 |
db53d896105e0ecdcc93da3edfc30593be4fe143 | 92 | py | Python | core/main.py | littlecharacter/AutoWork | feebb8459f889b7a9165073be8fd44ba544cbb35 | [
"Apache-2.0"
] | null | null | null | core/main.py | littlecharacter/AutoWork | feebb8459f889b7a9165073be8fd44ba544cbb35 | [
"Apache-2.0"
] | null | null | null | core/main.py | littlecharacter/AutoWork | feebb8459f889b7a9165073be8fd44ba544cbb35 | [
"Apache-2.0"
] | null | null | null | from core.window import Window
if __name__ == '__main__':
app = Window()
app.run()
| 15.333333 | 30 | 0.641304 |
72e920e6dc81cadde7f5090009796ebc7d788ad0 | 702 | py | Python | x2paddle/models.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 559 | 2019-01-14T06:01:55.000Z | 2022-03-31T02:52:43.000Z | x2paddle/models.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 353 | 2019-05-07T13:20:03.000Z | 2022-03-31T05:30:12.000Z | x2paddle/models.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 241 | 2018-12-25T02:13:51.000Z | 2022-03-27T23:21:43.000Z | from x2paddle.project_convertor.pytorch import models
resnet_pth_urls = models.resnet.model_urls
resnet18_pth = models.resnet18
resnet34_pth = models.resnet34
resnet50_pth = models.resnet50
resnet101_pth = models.resnet101
resnet152_pth = models.resnet152
resnext50_32x4d_pth = models.resnext50_32x4d
resnext101_32x8d_pt... | 31.909091 | 53 | 0.851852 |
f41483195595e7988abee7f6be4d454643ba814d | 1,780 | py | Python | algorithms/dynamic_programming/grid_walking.py | PlamenHristov/HackerRank | 2c875995f0d51d7026c5cf92348d9fb94fa509d6 | [
"MIT"
] | null | null | null | algorithms/dynamic_programming/grid_walking.py | PlamenHristov/HackerRank | 2c875995f0d51d7026c5cf92348d9fb94fa509d6 | [
"MIT"
] | null | null | null | algorithms/dynamic_programming/grid_walking.py | PlamenHristov/HackerRank | 2c875995f0d51d7026c5cf92348d9fb94fa509d6 | [
"MIT"
] | null | null | null | import sys
MOD = 1000000007
def choose(n, k):
if k < 0 or k > n:
return 0
else:
p, q = 1, 1
for i in range(1, min(k, n - k) + 1):
p *= n
q *= i
n -= 1
return p // q
def count_ways(N, M, D):
ways = [[[0] * D[i] for _ in range(M + 1)]... | 24.383562 | 101 | 0.421348 |
fe46c90f30bd8a232623d6c34b16b9f5cbda3243 | 3,789 | py | Python | python/oneflow/compatible/single_client/test/ops/test_broadcast_like.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/compatible/single_client/test/ops/test_broadcast_like.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/compatible/single_client/test/ops/test_broadcast_like.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 36.786408 | 85 | 0.685405 |
a3a75191482a062f53a22c3e2254f07b075a43bd | 1,161 | py | Python | 7-assets/past-student-repos/LambdaSchool-master/m6/61b1/src/room.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/61b1/src/room.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/61b1/src/room.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # Implement a class to hold room information. This should have name and
# description attributes.
class Room:
def __init__(self, room_name, room_description, n_to=None, e_to=None, s_to=None, w_to=None, items=None):
self.room_name = room_name
self.room_description = room_description
self.n_... | 32.25 | 111 | 0.639966 |
4a7a95b918d1fdb3e3c2d7e743749f49c969dd3c | 2,523 | py | Python | v2/rules2.py | timm/py | 28be3bb63433895e2bcab27ad82cb0b0cc994f37 | [
"Unlicense"
] | 1 | 2021-03-31T03:41:06.000Z | 2021-03-31T03:41:06.000Z | v2/rules2.py | timm/py | 28be3bb63433895e2bcab27ad82cb0b0cc994f37 | [
"Unlicense"
] | null | null | null | v2/rules2.py | timm/py | 28be3bb63433895e2bcab27ad82cb0b0cc994f37 | [
"Unlicense"
] | null | null | null | # vim: ts=2 sw=2 sts=2 et :
import re
# rahnges have its
class o(object):
def __init__(i, **k): i.__dict__.update(**k)
def __repr__(i):
return i.__class__.__name__ + str(
{k: v for k, v in i.__dict__.items() if k[0] != "_"})
from functools import wraps
def memo(f):
cache = {} # initialized at load ... | 25.744898 | 63 | 0.552517 |
60094c99d7bc5f4773a455ef1fbaaf9e7566eab4 | 18,324 | py | Python | tests/test_platforms.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 4 | 2019-07-18T10:58:28.000Z | 2021-11-18T16:57:45.000Z | tests/test_platforms.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 1 | 2019-07-05T09:21:47.000Z | 2019-07-05T09:21:47.000Z | tests/test_platforms.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 2 | 2019-07-05T08:56:34.000Z | 2020-06-09T10:03:42.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2018-2020 Niko Sandschneider
"""Module with statement download tests for all supported P2P platforms."""
from datetime import date
import logging
import os
import tempfile
from typing import Optional, Tuple
import unittest.mock
import pandas as pd
from selenium.common.excepti... | 34.186567 | 80 | 0.646911 |
609aee964178f0915a37924b35bee59789f9125f | 382 | py | Python | Problems/Stack/Easy/RemoveOutermostParentheses/test_remove_outermost_parentheses.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Problems/Stack/Easy/RemoveOutermostParentheses/test_remove_outermost_parentheses.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Stack/Easy/RemoveOutermostParentheses/test_remove_outermost_parentheses.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from unittest import TestCase
from remove_outermost_parentheses import removeOuterParentheses
class Test(TestCase):
def test_remove_outer_parentheses(self):
self.assertEqual(removeOuterParentheses("(()())(())(()(()))"), "()()()()(())")
self.assertEqual(removeOuterParentheses("(()())(())"), "()()()"... | 47.75 | 86 | 0.65445 |
609e0d15f6c888deb23f732f0f016c9d9870084d | 281 | py | Python | Programming Languages/Python/Theory/100_Python_Challenges/Section_2_String/36. separate the digits of an integer.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_2_String/36. separate the digits of an integer.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_2_String/36. separate the digits of an integer.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | """
Write a function to separate the digits of an integer. Return the digits in the form of a list.
Example:
Input: num = 1475
Expected output : [1,4,7,5]
"""
def separate_digits(num):
lst = []
for i in str(num):
i = int(i)
lst.append(i)
return lst | 17.5625 | 95 | 0.6121 |
60ee66c1d4835cad400e45a505a293ebba609d15 | 1,763 | py | Python | Packs/CommonScripts/Scripts/ExtractIndicatorsFromWordFile/ExtractIndicatorsFromWordFile_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/ExtractIndicatorsFromWordFile/ExtractIndicatorsFromWordFile_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/ExtractIndicatorsFromWordFile/ExtractIndicatorsFromWordFile_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import pytest
import os
import shutil
from ExtractIndicatorsFromWordFile import WordParser
import demistomock as demisto
expected_partial_all_data = 'Lorem ipsum dolor sit amet, an quas nostro posidonium mei, pro choro vocent pericula et'
@pytest.mark.parametrize('file_name,file_path', [
('docwithindicators.doc'... | 28.435484 | 117 | 0.691435 |
71e1adf4d66491423092986ca753c3329460898f | 2,249 | py | Python | dewar/account/forms.py | shonenada-archives/dewar | 392b996771a35bc26e9c301cc2a25bad973e8f61 | [
"MIT"
] | null | null | null | dewar/account/forms.py | shonenada-archives/dewar | 392b996771a35bc26e9c301cc2a25bad973e8f61 | [
"MIT"
] | null | null | null | dewar/account/forms.py | shonenada-archives/dewar | 392b996771a35bc26e9c301cc2a25bad973e8f61 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from flask.ext.babel import lazy_gettext as _
from flask.ext.wtf import Form
from wtforms import StringField, EmailField, PasswordField
from wtforms.validators import InputRequired, Email, Length, EqualTo
class SignUpForm(Form):
username = StringField(
label=_(u'username'),
... | 23.427083 | 68 | 0.538017 |
71e34751e68fcd98c10437ff679407229ffee740 | 3,428 | py | Python | Wortliste_filtern.py | UlrichBerntien/Uebungen-Python | 67e6d885dd2319e999979410448364ec4d59dc51 | [
"Apache-2.0"
] | null | null | null | Wortliste_filtern.py | UlrichBerntien/Uebungen-Python | 67e6d885dd2319e999979410448364ec4d59dc51 | [
"Apache-2.0"
] | null | null | null | Wortliste_filtern.py | UlrichBerntien/Uebungen-Python | 67e6d885dd2319e999979410448364ec4d59dc51 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Wortliste filtern
https://www.programmieraufgaben.ch/aufgabe/wortliste-filtern/pomdoige
"""
# Programmieraufgabe:
# Für die Erstellung eines Lernprogramms zum Maschinenschreiben werden
# geeignete Wörter aus einer Wortliste herausgepickt. Dafür wird die folge... | 37.67033 | 109 | 0.640023 |
e0911fc7ca791269fa5ccc73a3575de991cace5e | 634 | py | Python | books/PythonCleanCode/ch8_unittest/test_mock_2.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch8_unittest/test_mock_2.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch8_unittest/test_mock_2.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """Clean Code in Python - Chapter 8: Unit Testing
> Mock Objects
- File under test: mock_2.py
"""
from unittest import mock
from constants import STATUS_ENDPOINT
from mock_2 import BuildStatus
@mock.patch("mock_2.requests")
def test_build_notification_sent(mock_requests):
build_date = "2018... | 26.416667 | 79 | 0.700315 |
98fa01b8cdb5dfb29e68d1f821e6af07b671712b | 8,970 | py | Python | controller/mcp23017.py | huberthoegl/tsgrain | 405d0ba8b98c2afa950d27294e55cd1e07506db4 | [
"Apache-2.0"
] | 1 | 2021-06-15T08:59:02.000Z | 2021-06-15T08:59:02.000Z | controller/mcp23017.py | huberthoegl/tsgrain | 405d0ba8b98c2afa950d27294e55cd1e07506db4 | [
"Apache-2.0"
] | null | null | null | controller/mcp23017.py | huberthoegl/tsgrain | 405d0ba8b98c2afa950d27294e55cd1e07506db4 | [
"Apache-2.0"
] | null | null | null | '''Enable I2C bus with "sudo raspi-config"
Python package python3-smbus must be installed.
'''
import smbus
import time
import array
import math
import logging
import conf
bus = smbus.SMBus(1)
logger = logging.getLogger(conf.TSGRAIN_LOGGER)
press_handler = None
release_handler = None
def mcp_handler(intr_nr):
... | 34.633205 | 117 | 0.670346 |
406543879615f86f05e80bb09a55da70941dc9f0 | 649 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v8_0/rename_total_margin_to_rate_with_margin.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v8_0/rename_total_margin_to_rate_with_margin.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v8_0/rename_total_margin_to_rate_with_margin.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | from __future__ import unicode_literals
import frappe
from frappe.model.utils.rename_field import rename_field
def execute():
"""
Rename Total Margin field to Rate With Margin in
"Sales Order Item", "Sales Invoice Item", "Delivery Note Item",
"Quotation Item"
"""
for d in ("Sales Order Item", "Sales Invoic... | 25.96 | 66 | 0.747304 |
dc031cf851f5afa16ee5920be54e1526d422b208 | 299 | py | Python | Python/Sets/set_discard_remove_pop.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Sets/set_discard_remove_pop.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Sets/set_discard_remove_pop.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | n = int(input())
s = set(map(int, input().split()))
for i in range(int(input())):
choice = input().split()
if choice[0]=="pop" :
s.pop()
elif choice[0]=="remove" :
s.remove(int(choice[1]))
elif choice[0]=="discard" :
s.discard(int(choice[1]))
print(sum(s)) | 23 | 35 | 0.531773 |
9088a38af233d79feda8c73abbbe7f7b99f9e75b | 2,275 | py | Python | Securinets/2021/Quals/crypto/Sign_it/app.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | Securinets/2021/Quals/crypto/Sign_it/app.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | Securinets/2021/Quals/crypto/Sign_it/app.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | from Crypto.Util.number import inverse
from Crypto.Random import random
from fastecdsa.curve import Curve
from fastecdsa.point import Point
import hashlib
import signal
class Server():
def __init__(self, curve, G):
self.G = G
self.order = curve.q
self.d = random.randrange(1 , self.order - 1)
self.... | 30.743243 | 175 | 0.663736 |
2914cced61a27b5db665f7aed0304d3a12d46850 | 1,854 | py | Python | 0-notes/job-search/Leetcode/04-MinSwapsPalindrome.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Leetcode/04-MinSwapsPalindrome.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Leetcode/04-MinSwapsPalindrome.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # Given a string, what is the minimum number of adjacent swaps required to convert a string into
# a palindrome.
# If not possible, return -1.
'''
Example 1: Input: "mamad" | Output: 3
Example 2: Input: "asflkj" | Output: -1
Example 3: Input: "aabb" | Output: 2
Example 4: Input: "ntiin" | Output: 1
... | 28.090909 | 102 | 0.568501 |
291c41520bd1672d4884799f3f3e4a26004cbea1 | 946 | pyde | Python | sketches/shaunsim4/shaunsim4.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/shaunsim4/shaunsim4.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/shaunsim4/shaunsim4.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | from config import Settings
from shaun import Sheep
from grass import Grass
from random import randint, choice
s = Settings()
sz = s.PATCHSIZE
sheeps = []
lawn = []
colors = [s.WHITE, s.RED, s.BLUE, s.YELLOW]
def setup():
size(s.WIDTH, s.HEIGHT)
this.surface.setTitle("Shaun das Schaf (4): Es kann nur einen ge... | 27.028571 | 81 | 0.597252 |
293cc161af2592224a7e98a6eedfacd6046b376f | 2,086 | py | Python | scripts/embedding_features.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 8 | 2018-03-09T16:44:38.000Z | 2021-04-07T11:33:30.000Z | scripts/embedding_features.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 4 | 2020-03-24T15:34:54.000Z | 2021-06-01T21:54:33.000Z | scripts/embedding_features.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 1 | 2020-05-13T14:30:55.000Z | 2020-05-13T14:30:55.000Z |
# coding: utf-8
# Load FourSquare MAPPED dataset and assign to each square in the grid the
# number of POI of each FS category.
from geol.feature_extraction.various import cell2vec
import sys
import argparse
import os
def category(df, level):
tmp = df['categories'].split(":")
if len(tmp) > level:
... | 27.813333 | 91 | 0.476031 |
4622b2b13afbf4b00117448eeb07ba7467a3b382 | 6,980 | py | Python | tapia/exercise7/ex7.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 11 | 2017-04-21T11:39:55.000Z | 2022-02-11T20:25:18.000Z | tapia/exercise7/ex7.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 69 | 2017-04-26T09:30:38.000Z | 2017-08-01T11:31:21.000Z | tapia/exercise7/ex7.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 53 | 2017-04-20T16:16:11.000Z | 2017-07-19T12:53:01.000Z | import sys
import time
class Graph(object):
"""
Defines an undirected graph with dictionary structure {}
"""
def __init__(self):
self._edges = dict()
self._nodes = list()
def _add_node(self, node):
"""
Adds a node to the list of nodes in a Graph.
:type n... | 27.480315 | 106 | 0.605444 |
463fb7d4b3d6e7c37854a5176edbabdd5c1d5aa7 | 480 | py | Python | solutions/graph_based_recommend/webserver/src/service/count.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | 1 | 2021-01-11T18:40:22.000Z | 2021-01-11T18:40:22.000Z | solutions/graph_based_recommend/webserver/src/service/count.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | solutions/graph_based_recommend/webserver/src/service/count.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | import logging
import time
from common.config import MILVUS_TABLE
from indexer.index import milvus_client, count_collection
from indexer.tools import count_table
def do_count(index_client, conn, cursor, table_name):
if not table_name:
table_name = MILVUS_TABLE
logging.info("doing count, table_name:" ... | 32 | 59 | 0.78125 |
464d89347efd4c8819402ca27125510dbfb2db3c | 2,917 | py | Python | pkg/build/builder/ansible/werf/live_stdout.py | kayanme/werf | 655dbdc5f5ddba6e604274d29ee3d885ed79559e | [
"Apache-2.0"
] | 1,426 | 2020-06-05T13:43:08.000Z | 2022-03-31T19:58:57.000Z | pkg/build/builder/ansible/werf/live_stdout.py | kayanme/werf | 655dbdc5f5ddba6e604274d29ee3d885ed79559e | [
"Apache-2.0"
] | 1,053 | 2020-06-17T14:58:08.000Z | 2022-03-31T15:44:52.000Z | pkg/build/builder/ansible/werf/live_stdout.py | kayanme/werf | 655dbdc5f5ddba6e604274d29ee3d885ed79559e | [
"Apache-2.0"
] | 84 | 2020-06-05T14:28:46.000Z | 2022-03-29T22:42:05.000Z | # -*- coding: utf-8 -*-
import threading
import os
import socket
import select
import logboek
from werf import STDOUT_UNIX_SOCK_NAME
'''
'''
class LiveStdoutListener(object):
def __init__(self):
self._stdout_sock = None
self._stderr_sock = None
self._stop = False
self._enable_liv... | 27.518868 | 116 | 0.599246 |
313304bdc1202e701d6f2e95ddb624fcb3c1d30d | 1,497 | py | Python | test/test_npu/test_network_ops/test_item.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_item.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_item.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 39.394737 | 75 | 0.690047 |
9eed8a4adb82a2449abb86a3644ac156c9c2a01f | 178 | py | Python | project/views/dump.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | project/views/dump.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | project/views/dump.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | from flask import send_from_directory
from project import app, dump_path
@app.route("/dump/<path:path>")
def dump_files(path):
return send_from_directory(dump_path, path)
| 19.777778 | 47 | 0.775281 |
73313731c00d99c476cb9eb537472221df1e2b77 | 2,333 | py | Python | site/public/courses/CS-1.2/Code/Simplified_Starter_Code/test_listogram.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | 1 | 2021-08-24T20:22:19.000Z | 2021-08-24T20:22:19.000Z | site/public/courses/CS-1.2/Code/Simplified_Starter_Code/test_listogram.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | site/public/courses/CS-1.2/Code/Simplified_Starter_Code/test_listogram.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null |
from listogram import Listogram
# known inputs and their expected results
fish_words = ['one', 'fish', 'two', 'fish', 'red', 'fish', 'blue', 'fish']
fish_list = [('one', 1), ('fish', 4), ('two', 1), ('red', 1), ('blue', 1)]
def test_entries():
# NOTE: This test assumes Listogram is implemented as a list ... | 40.224138 | 80 | 0.658808 |
73643f2c4c25449af1e6a939ef24746e08ccf75f | 4,750 | py | Python | MainWindow.py | klnrdknt/Sephrasto | 591224fe01825a169c21ebc6136533f282ce9a0b | [
"MIT"
] | 15 | 2017-11-09T12:49:52.000Z | 2022-03-06T12:18:48.000Z | MainWindow.py | klnrdknt/Sephrasto | 591224fe01825a169c21ebc6136533f282ce9a0b | [
"MIT"
] | 40 | 2018-02-01T21:32:01.000Z | 2022-03-22T11:35:28.000Z | MainWindow.py | klnrdknt/Sephrasto | 591224fe01825a169c21ebc6136533f282ce9a0b | [
"MIT"
] | 13 | 2018-03-12T17:50:42.000Z | 2022-03-06T12:21:41.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'MainWindow.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, Q... | 47.5 | 115 | 0.694526 |
81f6ca39a53879170de4cf53ca99e499e127f631 | 1,823 | py | Python | wordlist_gen.py | mayurkadampro/Wordlist-Generator- | e593cbf6406a062ed9a8307379653201fa1e6b76 | [
"MIT"
] | 9 | 2018-08-19T05:15:49.000Z | 2021-12-24T17:49:16.000Z | wordlist_gen.py | mayurkadampro/Wordlist-Generator- | e593cbf6406a062ed9a8307379653201fa1e6b76 | [
"MIT"
] | null | null | null | wordlist_gen.py | mayurkadampro/Wordlist-Generator- | e593cbf6406a062ed9a8307379653201fa1e6b76 | [
"MIT"
] | 2 | 2020-10-20T23:49:09.000Z | 2021-02-24T20:34:06.000Z | import os
import sys
import string
import argparse
import itertools
from datetime import datetime
def wordlist(chrs, min_length, max_length, output):
if min_length > max_length:
print("[+] min_length value Should be small or same as max_length")
sys.exit()
if os.path.exists(os.pa... | 30.383333 | 106 | 0.611081 |
81fe629c6c7861b4527f35dd5441a7534d247d15 | 2,995 | py | Python | research/cv/arcface/preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/arcface/preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/arcface/preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | 34.034091 | 78 | 0.599332 |
c32f028b08b7a0c38b60f39b8c4b04ac536be4ad | 6,970 | py | Python | frappe-bench/apps/erpnext/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from frappe.utils import flt
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt \
import set_perpetual_in... | 34 | 111 | 0.740316 |
c36a58417ad613623ca47e0b0cd818e41f6b91c9 | 4,699 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/module_utils/net_tools/netbox/test_netbox_utils.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/module_utils/net_tools/netbox/test_netbox_utils.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/module_utils/net_tools/netbox/test_netbox_utils.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright: (c) 2019, Bruno Inec (@sweenu) <bruno@inec.fr>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import pytest
from ansible_collections.netbox.netbox.plugins.module_utils.net_tools.netbox.netbox_utils import (
QUERY_TYPES,
_build_d... | 30.712418 | 98 | 0.746755 |
6f0d2ecd71f0d68e5a8d101e9109848c633d284b | 4,570 | py | Python | weibo/login/weiboMain_bak.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | weibo/login/weiboMain_bak.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | weibo/login/weiboMain_bak.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | # coding:utf8
'''
Created on 2016年4月11日
@author: wb-zhaohaibo
'''
import weiboLogin
# import urllib2
from weibo.spider import url_manager
from weibo.spider import html_downloader
from weibo.spider import html_parser
from weibo.spider import html_outputer
import spynner
from _pyio import open
class Weib... | 31.517241 | 103 | 0.488184 |
48c7365c321a09cdd3750be4058fbed088107bca | 7,960 | py | Python | Integrations/python/deephaven/lang/tools.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 55 | 2021-05-11T16:01:59.000Z | 2022-03-30T14:30:33.000Z | Integrations/python/deephaven/lang/tools.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 943 | 2021-05-10T14:00:02.000Z | 2022-03-31T21:28:15.000Z | Integrations/python/deephaven/lang/tools.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 29 | 2021-05-10T11:33:16.000Z | 2022-03-30T21:01:54.000Z | """
Helper functions for analyzing and generating AST produced by ast.parse().
**The contents of this module are intended only for internal Deephaven use and may change at any time.**
"""
from _ast import Load, Store, Name, Param, Call, keyword, Subscript, FunctionDef, arguments, Index, Num, Attribute, \
Assign, ... | 31.338583 | 117 | 0.63191 |
48cc59cf99edc694767430b44915bf150d64cdd9 | 1,552 | py | Python | apps/community/views.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 2 | 2018-05-18T08:38:29.000Z | 2018-05-22T08:26:09.000Z | apps/community/views.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 118 | 2017-10-31T13:45:09.000Z | 2018-02-24T20:51:42.000Z | apps/community/views.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from apps.user.models import User
from apps.profile.models import Profile
from django.contrib.auth.decorators import login_required
from apps.projects.models import Project
from django.views.generic import ListView
from django.core.paginator import Paginator, EmptyPage, PageNotAnInte... | 34.488889 | 89 | 0.679768 |
82a86532ad568f5a0f9159f65a7d20c9eaf213ef | 1,485 | py | Python | tests/test_zeitintervall.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | tests/test_zeitintervall.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | tests/test_zeitintervall.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | from datetime import datetime, timezone
from decimal import Decimal
import pytest # type:ignore[import]
from bo4e.com.zeitintervall import Zeitintervall, ZeitintervallSchema
from bo4e.enum.zeiteinheit import Zeiteinheit
class TestZeitintervall:
def test_zeitintervall_daten(self):
"""
Test de-/s... | 36.219512 | 115 | 0.727946 |
7dd90b0ba4c18e50b18c99895a55c61764f950c4 | 3,789 | py | Python | Adaboost/adaboostLihang.py | lance52587/MachineLearningNote | 0184f8de178990ee31ace2a43809830874313697 | [
"MIT"
] | 37 | 2018-06-06T05:58:54.000Z | 2022-02-21T04:49:54.000Z | Adaboost/adaboostLihang.py | YYangjlu/MachineLearningNote | d34a9b57af3b2c6f276d14c2a7a3dccadb585421 | [
"MIT"
] | null | null | null | Adaboost/adaboostLihang.py | YYangjlu/MachineLearningNote | d34a9b57af3b2c6f276d14c2a7a3dccadb585421 | [
"MIT"
] | 35 | 2018-10-01T16:12:34.000Z | 2022-02-21T03:35:33.000Z | # -*- coding: utf-8 -*-
# @Author: Alan Lau
# @Date: 2018-10-11 10:59:38
import math
import numpy as np
from pprint import pprint
"""In one dimension"""
def load_simp_data():
data = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
class_labels = np.array([1, 1, 1, -1, -1, -1, 1, 1, 1, -1])
return data, class_la... | 30.071429 | 77 | 0.518343 |
81bccdf51c307f4a07d597ad1500b24d5b4bc904 | 2,854 | py | Python | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/screed-0.7.1-py2.7.egg/screed/tests/test_hava_methods.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2019-07-29T02:53:51.000Z | 2019-07-29T02:53:51.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/screed-0.7.1-py2.7.egg/screed/tests/test_hava_methods.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/screed-0.7.1-py2.7.egg/screed/tests/test_hava_methods.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | import screed
import screed.seqparse
from screed.DBConstants import fileExtension
import os
testha = os.path.join(os.path.dirname(__file__), 'test.hava')
class test_hava(object):
def setup(self):
screed.seqparse.read_hava_sequences(testha)
self._db = screed.ScreedDB(testha)
def teardown(self)... | 46.032258 | 75 | 0.716188 |
81dd9495b646fb1ed175dd8f379a7da90e823fbc | 7,612 | py | Python | transformer/utils.py | DragonYong/Sklearn | b604c4bc41ecfa5c10613f713d6ca5c73214c07c | [
"Apache-2.0"
] | null | null | null | transformer/utils.py | DragonYong/Sklearn | b604c4bc41ecfa5c10613f713d6ca5c73214c07c | [
"Apache-2.0"
] | null | null | null | transformer/utils.py | DragonYong/Sklearn | b604c4bc41ecfa5c10613f713d6ca5c73214c07c | [
"Apache-2.0"
] | 1 | 2021-02-03T07:35:20.000Z | 2021-02-03T07:35:20.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2020-06-20-19:30
# @Author : TuringEmmy
# @Email : yonglonggeng@163.com
# @WeChat : csy_lgy
# @File : utils.py
# @Project : PaperProject
import tensorflow as tf
import numpy as np
from tensorflow import keras
from data_preprocess import pt_tokeni... | 32.254237 | 84 | 0.643589 |
c4d91e5cf385026427244d3b26eff53bdc9057e3 | 122 | py | Python | zencad/examples/2.Operations/2.Operations/offset.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/examples/2.Operations/2.Operations/offset.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/examples/2.Operations/2.Operations/offset.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
from zencad import *
m = cone(r1=10, r2=5, h=10)
m = offset(m, 2)
disp(m)
show() | 12.2 | 27 | 0.614754 |
c4edaa0e5bc2a18dc2c9518ae48f2f470b6a146d | 194 | py | Python | PyStellar/stellar/psguser/psgSerializer.py | psgstellar/Stellar | 947d4b3d9d6b9c74d4c9ebd29683793a8d86fad2 | [
"Apache-2.0"
] | 3 | 2021-01-24T17:07:55.000Z | 2021-02-20T20:11:13.000Z | PyStellar/stellar/psguser/psgSerializer.py | psgstellar/Stellar | 947d4b3d9d6b9c74d4c9ebd29683793a8d86fad2 | [
"Apache-2.0"
] | 61 | 2021-01-10T12:59:01.000Z | 2021-06-24T09:19:20.000Z | PyStellar/stellar/psguser/psgSerializer.py | psgstellar/Stellar | 947d4b3d9d6b9c74d4c9ebd29683793a8d86fad2 | [
"Apache-2.0"
] | 1 | 2021-01-14T05:23:32.000Z | 2021-01-14T05:23:32.000Z | from rest_framework import serializers
class psgserializer(serializers.Serializer):
channel = serializers.CharField(help_text='슬랙채널명')
token = serializers.CharField(help_text='Slack토큰') | 38.8 | 54 | 0.804124 |
4872871c69185054784b30117e3cd2a779108b09 | 12,858 | py | Python | practices/practice_4/libs/myactuator/__init__.py | br4ch1st0chr0n3/robotic_systems_labs | 23b8b81dc845e00cf02460258b9cec817019957b | [
"MIT"
] | null | null | null | practices/practice_4/libs/myactuator/__init__.py | br4ch1st0chr0n3/robotic_systems_labs | 23b8b81dc845e00cf02460258b9cec817019957b | [
"MIT"
] | null | null | null | practices/practice_4/libs/myactuator/__init__.py | br4ch1st0chr0n3/robotic_systems_labs | 23b8b81dc845e00cf02460258b9cec817019957b | [
"MIT"
] | null | null | null | from time import perf_counter
from math import pi
from ..can import CANDevice
# from ..can
# TODO:
# Run motor in several modes in processes:
# i.e: speed, pos, current
# Implement motor modes
# motor.set_mode('s', 'p', 'c')
# via motor.run(mode = 's')
# provide interface to can_bus through tuple of functions
# tra... | 30.760766 | 142 | 0.533987 |
6fdb280e804035f2d6ba757d59654103d5f45834 | 117 | py | Python | Shivani/divisible by 3.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | Shivani/divisible by 3.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | Shivani/divisible by 3.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | n=int(input("enter a number\n"))
r=n%10
if r%3==0:
print("Divisible by 3")
else:
print("Not Divisible by 3")
| 16.714286 | 32 | 0.615385 |
838d7201eaab5f07668a9400ea2424f749b54494 | 1,100 | py | Python | python/image_processing/blending.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/image_processing/blending.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/image_processing/blending.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import cv2
import numpy as np,sys
A = cv2.imread('1_z.jpg')
B = cv2.imread('2_z.jpg')
# generate Gaussian pyramid for A
G = A.copy()
gpA = [G]
for i in range(6):
G = cv2.pyrDown(G)
gpA.append(G)
# generate Gaussian pyramid for B
G = B.copy()
gpB = [G]
for i in range(6):
G = cv2.pyrDown(G)
gpB.append(... | 20.754717 | 55 | 0.623636 |
e3d0b2e70f4e78601b3d45313b6974993204ea9f | 433 | py | Python | python/en/archive/dropbox/miscellaneous_python_files/python-class-ex05-simple example for class with name.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/miscellaneous_python_files/python-class-ex05-simple example for class with name.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/miscellaneous_python_files/python-class-ex05-simple example for class with name.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # _*_ coding: utf-8 _*_
# 점프 투 파이썬, 박응용, 이지스 퍼블리싱
# 05-1. 파이썬 프로그래밍의 핵심, 클래스
# 이야기 형식으로 클래스 기초 쌓기
# pp.177-179
class Service:
# 클래스 변수
secret = "오늘 영화 보헤미안 랩소디를 보러간다."
def setname( self, name ):
self.name = name
# 클래스 함수
def sum( self, a, b ):
result = a + b
print( "%s 님 %s + %s = ... | 20.619048 | 60 | 0.547344 |
e3f39a9f14363939ae2e3d59a2041f79dd13c7c5 | 11,339 | py | Python | ingress/ambassador/ambassador/ambassador/mapping.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 63 | 2018-02-04T03:31:22.000Z | 2022-03-07T08:27:39.000Z | ingress/ambassador/ambassador/ambassador/mapping.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 3 | 2020-06-15T03:41:03.000Z | 2020-06-15T03:41:04.000Z | ingress/ambassador/ambassador/ambassador/mapping.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 40 | 2018-01-22T16:31:16.000Z | 2022-03-08T04:40:42.000Z | # Copyright 2018 Datawire. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 38.050336 | 146 | 0.584531 |
5431cd584a10be5e8f69b892195bf45400b5274a | 3,092 | py | Python | test/test_npu/test_network_ops/test_normalization.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_normalization.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_normalization.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 39.641026 | 77 | 0.658473 |
4d01f1a90904dd56416fe07d1a1bd8c8893d1c3c | 2,864 | py | Python | updateBaselineSolutions.py | D-ICE/bladics--externals--openfast-rtest-dice | ed4990c174892e88cb297b65ec8cbc2f05b2904e | [
"Apache-2.0"
] | 2 | 2019-01-22T07:54:51.000Z | 2022-03-11T08:28:58.000Z | updateBaselineSolutions.py | D-ICE/bladics--externals--openfast-rtest-dice | ed4990c174892e88cb297b65ec8cbc2f05b2904e | [
"Apache-2.0"
] | null | null | null | updateBaselineSolutions.py | D-ICE/bladics--externals--openfast-rtest-dice | ed4990c174892e88cb297b65ec8cbc2f05b2904e | [
"Apache-2.0"
] | 1 | 2020-09-14T09:36:01.000Z | 2020-09-14T09:36:01.000Z | #
# Copyright 2017 National Renewable Energy Laboratory
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 38.702703 | 163 | 0.739176 |
c4763888c285237369b3459ab0415d5d096a43dc | 4,590 | py | Python | tests/onegov/org/test_pdf.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/org/test_pdf.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/org/test_pdf.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import datetime, date
from onegov.core.utils import Bunch
from onegov.form import FormCollection
from onegov.org.models import TicketMessage, TicketChatMessage
from onegov.org.pdf.ticket import TicketPdf
from onegov.pdf.utils import extract_pdf_info
from onegov.reservation import ResourceCollection
from o... | 30.805369 | 79 | 0.685621 |
c48aedca152d3fbfa411682ee0bcc9d988275bb0 | 70,813 | py | Python | Packs/DeprecatedContent/Integrations/PaloAltoNetworksCortex/PaloAltoNetworksCortex.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/DeprecatedContent/Integrations/PaloAltoNetworksCortex/PaloAltoNetworksCortex.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/DeprecatedContent/Integrations/PaloAltoNetworksCortex/PaloAltoNetworksCortex.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
import os
import requests
import json
from pancloud import LoggingService, Credentials
import base64
from dateutil.parser import parse
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
from ... | 41.826934 | 120 | 0.629291 |
67515457587874e77a85c840a6c3cc91d3d1dfd8 | 83 | py | Python | Juego/Launcher.py | Xavitheforce/GuesstheNumber | 7192018369fe2291f375f635ed19db21bb6f3c81 | [
"Apache-2.0"
] | null | null | null | Juego/Launcher.py | Xavitheforce/GuesstheNumber | 7192018369fe2291f375f635ed19db21bb6f3c81 | [
"Apache-2.0"
] | null | null | null | Juego/Launcher.py | Xavitheforce/GuesstheNumber | 7192018369fe2291f375f635ed19db21bb6f3c81 | [
"Apache-2.0"
] | null | null | null | from AdivinaelNúmeroDefinitivo import jugar
if __name__ == "__main__":
jugar() | 20.75 | 43 | 0.759036 |
3f52a053d000f29377a8d3f62e7b45ce6c5f5d9e | 1,815 | py | Python | official/cv/lenet/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/lenet/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/lenet/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 37.040816 | 112 | 0.744904 |
e1a93ee3b1d76b083dd650b56107c02ac84210a1 | 266 | py | Python | helper.py | oraarthornsombat/cs3240-labdemo | 0fcc4a53f10d48ccfacce03b1ee2cedac4e63a81 | [
"MIT"
] | null | null | null | helper.py | oraarthornsombat/cs3240-labdemo | 0fcc4a53f10d48ccfacce03b1ee2cedac4e63a81 | [
"MIT"
] | null | null | null | helper.py | oraarthornsombat/cs3240-labdemo | 0fcc4a53f10d48ccfacce03b1ee2cedac4e63a81 | [
"MIT"
] | null | null | null | #Ora Arthornsombat
#Cs 3240 - Github Lab
""" Create helper.py and move the definition of greeting(msg) to that
file. Edit hello.py and remove the function definition there, and make it use the method by
importing helper.py file"""
def greeting(msg):
print(msg) | 29.555556 | 91 | 0.75188 |
beddf7ea4eec87f1bb6e622f0ed555a67344a7e8 | 1,121 | py | Python | example/solid_example/car_orp_bad.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | example/solid_example/car_orp_bad.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | example/solid_example/car_orp_bad.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | class Car:
def __init__(self):
self.tire = None
def set_tire(self, tire):
self.tire = tire
def run(self):
if isinstance(self.tire, ATire):
self.tire.a_run()
elif isinstance(self.tire, BTire):
self.tire.b_run()
else:
print('타이어가 없습... | 21.557692 | 76 | 0.551293 |
55c7199f4d0c5c057d2b670f04610aad319b1630 | 199 | py | Python | src/data/metrics.py | kaphka/imi-master-thesis | 2331a3534dc32e30a1333bb21c68c1e1b07ec9e4 | [
"MIT"
] | 2 | 2018-04-27T09:02:15.000Z | 2019-04-19T19:12:13.000Z | src/data/metrics.py | kaphka/imi-master-thesis | 2331a3534dc32e30a1333bb21c68c1e1b07ec9e4 | [
"MIT"
] | 1 | 2019-04-19T19:13:08.000Z | 2021-02-22T21:29:55.000Z | src/data/metrics.py | kaphka/imi-master-thesis | 2331a3534dc32e30a1333bb21c68c1e1b07ec9e4 | [
"MIT"
] | null | null | null | import numpy as np
def mean_gradient(bw):
dx = bw[1:, :] - bw[:-1, :]
dy = bw[:, 1:] - bw[:, :-1]
grad = np.add(np.power(dx[:, :-1], 2), np.power(dy[:-1, :], 2))
return np.mean(grad) | 28.428571 | 67 | 0.482412 |
3d16f7d6b64becdf5c5d13de200c9574dc5f6629 | 348 | py | Python | 10.5.py | RonaldZhao/NowCoder | 935af39835a98efc14157e20df1e3458e02b9803 | [
"MIT"
] | null | null | null | 10.5.py | RonaldZhao/NowCoder | 935af39835a98efc14157e20df1e3458e02b9803 | [
"MIT"
] | null | null | null | 10.5.py | RonaldZhao/NowCoder | 935af39835a98efc14157e20df1e3458e02b9803 | [
"MIT"
] | null | null | null | import random
p = random.random()
class RandomP:
@staticmethod
def f():
return 0 if random.random() < p else 1
class Random01:
def random01(self):
t = "00"
while t in ["00", "11"]:
t = str(RandomP.f()) + str(RandomP.f())
return 0 if t == "01" else 1
r = Ran... | 15.818182 | 51 | 0.534483 |
3d1c881a4d9564f5dc8ba3b7934976469891f181 | 390 | py | Python | Algorithms/Search_Algorithms/Linear_Search/linear-search.py | hussamEL-Hwary/DS-Algo-Handbook | 86a97d586a4ca8b17168c0a9f5a9f43f856eba58 | [
"MIT"
] | 18 | 2016-11-01T04:00:36.000Z | 2021-09-13T14:26:35.000Z | Algorithms/Search_Algorithms/Linear_Search/linear-search.py | JEERU/DS-Algo-Handbook | 86a97d586a4ca8b17168c0a9f5a9f43f856eba58 | [
"MIT"
] | 60 | 2016-10-11T14:50:47.000Z | 2016-10-31T11:05:01.000Z | Algorithms/Search_Algorithms/Linear_Search/linear-search.py | JEERU/DS-Algo-Handbook | 86a97d586a4ca8b17168c0a9f5a9f43f856eba58 | [
"MIT"
] | 87 | 2016-09-08T05:04:50.000Z | 2016-10-30T19:19:53.000Z | def main():
a=[]
size=0
print "Enter size: "
size= input()
print "Enter the elements: "
for i in range(0,size):
x=input()
a.append(x)
print "Enter the element you want to search for: "
y=input()
flag=0
for i in range(0,size):
if a[i] == y:
print "Element found at position "+ str(i+1)
flag=1
if fl... | 18.571429 | 51 | 0.623077 |
182eba6c04d124002e6076600fb9b947bb4a61e4 | 384 | py | Python | py/jpy-integration/src/pythonToJava/python/java_debug.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 55 | 2021-05-11T16:01:59.000Z | 2022-03-30T14:30:33.000Z | py/jpy-integration/src/pythonToJava/python/java_debug.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 943 | 2021-05-10T14:00:02.000Z | 2022-03-31T21:28:15.000Z | py/jpy-integration/src/pythonToJava/python/java_debug.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 29 | 2021-05-10T11:33:16.000Z | 2022-03-30T21:01:54.000Z | if __name__ != '__main__':
quit()
import jpyutil
import jpy
print(jpy.has_jvm())
print(jpyutil.init_jvm())
print(jpy.has_jvm())
System = jpy.get_type('java.lang.System')
File = jpy.get_type('java.io.File')
classpath = System.getProperty('java.class.path')
separator = File.pathSeparator
classpathEntries = classpat... | 21.333333 | 49 | 0.755208 |
c5002e43c1a50fa29d6e45f337316f80ce076760 | 1,922 | py | Python | criterion/ComposeLoss.py | UESTC-Liuxin/SkmtSeg | 1251de57fae967aca395644d1c70a9ba0bb52271 | [
"Apache-2.0"
] | 2 | 2020-12-22T08:40:05.000Z | 2021-03-30T08:09:44.000Z | criterion/ComposeLoss.py | UESTC-Liuxin/SkmtSeg | 1251de57fae967aca395644d1c70a9ba0bb52271 | [
"Apache-2.0"
] | null | null | null | criterion/ComposeLoss.py | UESTC-Liuxin/SkmtSeg | 1251de57fae967aca395644d1c70a9ba0bb52271 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@description:
@author: LiuXin
@contact: xinliu1996@163.com
@Created on: 2020/11/27 下午8:05
"""
import torch
import torch.nn as nn
import warnings
class ComposeLoss(nn.Module):
"""Dice loss of binary class
Args:
losses:the list of loss Moudle
losses_weights:list of l... | 25.972973 | 108 | 0.652445 |
c51c9983b659dc2d9612dc65cff680c1b48c6677 | 10,869 | py | Python | grader/self.py | LammingerL/selfie | 93a094b6b33be000192e0eab946a462a3291907c | [
"BSD-2-Clause"
] | null | null | null | grader/self.py | LammingerL/selfie | 93a094b6b33be000192e0eab946a462a3291907c | [
"BSD-2-Clause"
] | null | null | null | grader/self.py | LammingerL/selfie | 93a094b6b33be000192e0eab946a462a3291907c | [
"BSD-2-Clause"
] | null | null | null | import sys
import os
import re
import math
from subprocess import Popen, PIPE
number_of_positive_tests_passed = [0]
number_of_positive_tests_failed = [0]
number_of_negative_tests_passed = [0]
number_of_negative_tests_failed = [0]
INSTRUCTIONSIZE = 4 # in bytes
ELF_HEADER_LEN = 120
TMP_FILE = '.tmp.bin'
OP_OP = 51
... | 31.967647 | 116 | 0.715797 |
3dd6f3a83cb3917206e50d6d00b02a0148a686f7 | 250 | py | Python | Shivani/numbers.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | Shivani/numbers.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | Shivani/numbers.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | a=int(input("enter 1st number\n"))
b=int(input("enter 2nd number\n"))
c=int(input("enter 3rd number\n"))
d=int(input("enter 4th number\n"))
total=a+b+c+d
average=(a+b+c+d)/4
print("total of four number",total)
print("average of four number",average)
| 27.777778 | 39 | 0.7 |
3de79df3e862acfb4e358fa113d8433e3020b034 | 2,029 | py | Python | bin/ldap_query.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | 75 | 2018-04-06T09:13:34.000Z | 2020-05-18T18:59:47.000Z | bin/ldap_query.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | 989 | 2018-04-18T21:01:56.000Z | 2019-10-23T15:37:09.000Z | bin/ldap_query.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | 72 | 2018-04-13T18:29:12.000Z | 2020-05-29T06:00:33.000Z | from ldap3 import Server, Connection, ALL
# Search filter options
# NOTE: User filter has a placeholder for the ${USER_ID}. It needs to be manually
# replaced with an actual user id before usage.
search_filters = {
'all_users': '(objectClass=person)',
'all_groups': '(objectClass=group)',
'specific_us... | 32.206349 | 158 | 0.64416 |
b119bd3f295706ca8f39953ac0170dd9d9efcf1e | 3,815 | py | Python | modules/drgn.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | 2 | 2022-02-24T08:21:49.000Z | 2022-03-10T08:57:35.000Z | modules/drgn.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | 1 | 2022-02-24T08:40:21.000Z | 2022-02-24T12:01:58.000Z | modules/drgn.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from modules.base import MultiHeadAttentionLayer
class DRGNResidualBlock(nn.Module):
def __init__(self, in_dim, hidden_dim, out_dim, num_head, with_non_linearity=False):
super(DRGNResidualBlock, self).__init__()
self.att_1 = Multi... | 43.850575 | 119 | 0.670511 |
b13885c55b0b2e9b6f4b283c494cbc54c92dc96c | 2,482 | py | Python | Packs/CyrenInboxSecurity/Scripts/CyrenShowThreatIndicators/CyrenShowThreatIndicators.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CyrenInboxSecurity/Scripts/CyrenShowThreatIndicators/CyrenShowThreatIndicators.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CyrenInboxSecurity/Scripts/CyrenShowThreatIndicators/CyrenShowThreatIndicators.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
# noqa: F401
# noqa: F401
# type: ignore
import json
def stringify_indicators(threat_indicators):
#
indicator_type = threat_indicators.get('type')
# url indicators
if indicator_type == 'url':
return t... | 29.2 | 106 | 0.587429 |
49857c946a9fae0e11c836ed55e48d8658b9d65a | 218 | py | Python | marsyas-vamp/marsyas/scripts/large-evaluators/test-compare.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/large-evaluators/test-compare.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/large-evaluators/test-compare.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import compare_tempi
a = "/home/gperciva/src/audio-research/foo.mf"
b = "/home/gperciva/src/audio-research/bar.mf"
compare_tempi.check_files_in_mf(a, a)
compare_tempi.check_files_in_mf(a, b)
| 18.166667 | 46 | 0.761468 |
499601e332882a13a0e5ee8efc6193d0ff614566 | 1,013 | py | Python | 7-assets/past-student-repos/Whiteboard-Pairing-master/SortTopScores/model_solution.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/Whiteboard-Pairing-master/SortTopScores/model_solution.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/Whiteboard-Pairing-master/SortTopScores/model_solution.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | """
Since we have a highest possible score, we can use
a strategy known as a counting sort into to achieve
a runtime faster than O(n log n).
"""
def sort_top_scores(scores, highest_possible_score):
# init a list with length highest_possible_score filled with 0s
score_counts = [0] * highest_possible_score
# incre... | 38.961538 | 65 | 0.733465 |
624c46852857e714009a033d52933f66cb1f95c7 | 2,110 | py | Python | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/modeling/losses/transnetv2_loss.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 5 | 2022-01-30T07:35:58.000Z | 2022-02-08T05:45:20.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/modeling/losses/transnetv2_loss.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-01-14T02:33:28.000Z | 2022-01-14T02:33:28.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/modeling/losses/transnetv2_loss.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-03-07T10:51:21.000Z | 2022-03-07T10:51:21.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 37.678571 | 113 | 0.683412 |
6584b536fd1b4c758432b1210ea9dd8afd0ab7b0 | 2,009 | py | Python | src/util/pipe.py | blitzher/Starbot | 90da81f3beac74cd4394c2d8e18d9c67d6819b16 | [
"MIT"
] | null | null | null | src/util/pipe.py | blitzher/Starbot | 90da81f3beac74cd4394c2d8e18d9c67d6819b16 | [
"MIT"
] | null | null | null | src/util/pipe.py | blitzher/Starbot | 90da81f3beac74cd4394c2d8e18d9c67d6819b16 | [
"MIT"
] | null | null | null | class RenderPipe:
def __init__(self, renderer, logger):
self.renderer = renderer
self.logger = logger
self.tasks = []
def draw_ui(self, args):
" RenderPipe.draw_ui (position, text)"
def store_function_call(self, function, *args, **kwargs):
# store a functio... | 39.392157 | 108 | 0.657043 |
b2ad6648a5f3a740e1170b13a53cade0fe8facba | 3,394 | py | Python | Packs/Barracuda/Integrations/BarracudaReputationBlockListBRBL/BarracudaReputationBlockListBRBL.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Barracuda/Integrations/BarracudaReputationBlockListBRBL/BarracudaReputationBlockListBRBL.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Barracuda/Integrations/BarracudaReputationBlockListBRBL/BarracudaReputationBlockListBRBL.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
''' IMPORTS '''
from socket import gaierror
def results_return(command, thingtoreturn):
for item in thingtoreturn:
description = ''
ip_reputation = {
'indicator': item['Address'],
}
... | 33.27451 | 129 | 0.580731 |
a2574cd7f358ebfeb580596954063f4170e0fbfe | 204 | py | Python | exercises/de/exc_01_02_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/de/exc_01_02_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/de/exc_01_02_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | # Importiere die Klasse Spanish
from spacy.lang.____ import ____
# Erstelle das nlp-Objekt
nlp = ____
# Verarbeite einen Text
doc = nlp("¿Cómo estás?")
# Drucke den Text des Dokuments
print(____.text)
| 17 | 32 | 0.745098 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.