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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0addbb98a491ebc70722c43f73f99bb4aac2a859 | 465 | py | Python | storm_control/test/test_hal_tcp_ms.py | jeffmoffitt/storm-control | 522add1e196e0b7964f574481fd90c20a74b575e | [
"MIT"
] | null | null | null | storm_control/test/test_hal_tcp_ms.py | jeffmoffitt/storm-control | 522add1e196e0b7964f574481fd90c20a74b575e | [
"MIT"
] | null | null | null | storm_control/test/test_hal_tcp_ms.py | jeffmoffitt/storm-control | 522add1e196e0b7964f574481fd90c20a74b575e | [
"MIT"
] | 1 | 2020-11-10T06:39:18.000Z | 2020-11-10T06:39:18.000Z | #!/usr/bin/env python
"""
Test move stage.
"""
| 23.25 | 61 | 0.677419 | #!/usr/bin/env python
"""
Test move stage.
"""
from storm_control.test.hal.standardHalTest import halTest
def test_hal_ms_1():
halTest(config_xml = "none_tcp_config.xml",
class_name = "MoveStage1",
test_module = "storm_control.test.hal.tcp_tests")
def test_hal_ms_2():
halTest(confi... | 0 | 0 | 0 | 0 | 0 | 311 | 0 | 37 | 68 |
fe072362ec45c1de0a01cabedbca9a31ef12dd03 | 3,970 | py | Python | nvtabular/ops/data_stats.py | davidxia/NVTabular | 97b05ac74204d4e21fa31d522d0f84fb37cf94a9 | [
"Apache-2.0"
] | 543 | 2020-05-14T13:03:29.000Z | 2021-10-06T14:35:16.000Z | nvtabular/ops/data_stats.py | davidxia/NVTabular | 97b05ac74204d4e21fa31d522d0f84fb37cf94a9 | [
"Apache-2.0"
] | 1,136 | 2020-05-21T01:44:01.000Z | 2021-10-08T00:44:45.000Z | nvtabular/ops/data_stats.py | davidxia/NVTabular | 97b05ac74204d4e21fa31d522d0f84fb37cf94a9 | [
"Apache-2.0"
] | 84 | 2020-05-14T13:11:48.000Z | 2021-10-04T03:17:22.000Z | #
# Copyright (c) 2021, NVIDIA 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 ... | 37.102804 | 90 | 0.611335 | #
# Copyright (c) 2021, NVIDIA 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 ... | 0 | 1,591 | 0 | 1,535 | 0 | 0 | 0 | 94 | 157 |
fa422e2255cf967e4b0f5e7fad952b7dfd2cd707 | 547 | py | Python | app/ask/tasks/post_indexer_task.py | viert/knowledgehub | 295a66002f26d694e518af97ad80269d69d59adf | [
"MIT"
] | 8 | 2020-06-16T07:45:35.000Z | 2020-08-10T10:11:50.000Z | app/ask/tasks/post_indexer_task.py | viert/knowledgehub | 295a66002f26d694e518af97ad80269d69d59adf | [
"MIT"
] | 2 | 2021-10-06T18:31:08.000Z | 2022-02-19T03:32:29.000Z | app/ask/tasks/post_indexer_task.py | viert/knowledgehub | 295a66002f26d694e518af97ad80269d69d59adf | [
"MIT"
] | null | null | null |
PostIndexerTask.register()
| 20.259259 | 73 | 0.632541 | from typing import Union
from bson import ObjectId
from glasskit.queue import BaseTask
class PostIndexerTask(BaseTask):
TYPE = "POST_INDEXER_TASK"
@classmethod
def create(cls, post_id: Union[ObjectId, str], delete: bool = False):
return cls({
"post_id": post_id,
"delete":... | 0 | 283 | 0 | 124 | 0 | 0 | 0 | 21 | 89 |
56838689303f149518aeefb7b136f4d9724c17e7 | 10,430 | py | Python | Pyrado/scripts/evaluation/eval_policies_domain_grid_1d.py | jacarvalho/SimuRLacra | a6c982862e2ab39a9f65d1c09aa59d9a8b7ac6c5 | [
"BSD-3-Clause"
] | null | null | null | Pyrado/scripts/evaluation/eval_policies_domain_grid_1d.py | jacarvalho/SimuRLacra | a6c982862e2ab39a9f65d1c09aa59d9a8b7ac6c5 | [
"BSD-3-Clause"
] | null | null | null | Pyrado/scripts/evaluation/eval_policies_domain_grid_1d.py | jacarvalho/SimuRLacra | a6c982862e2ab39a9f65d1c09aa59d9a8b7ac6c5 | [
"BSD-3-Clause"
] | null | null | null | """
Script to evaluate multiple policies in one environment using a range (1D grid) of domain parameters
"""
import os.path as osp
import numpy as np
import pandas as pd
import pprint
import pyrado
from pyrado.domain_randomization.utils import param_grid
from pyrado.environments.pysim.quanser_ball_balancer import QBal... | 48.511628 | 118 | 0.635187 | """
Script to evaluate multiple policies in one environment using a range (1D grid) of domain parameters
"""
import os.path as osp
import torch as to
import numpy as np
import pandas as pd
import pprint
import pyrado
from pyrado.domain_randomization.utils import param_grid
from pyrado.environments.pysim.quanser_ball_b... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 22 |
cf17fc58ea05c2b66cc1329d754aa4425999178b | 5,572 | py | Python | dnsdb_common/dal/subnet_ip.py | feythin/open_dnsdb | 78485274148d639bf9c2e992602c1f9f87091094 | [
"Apache-2.0"
] | 1 | 2019-09-27T01:06:55.000Z | 2019-09-27T01:06:55.000Z | dnsdb_common/dal/subnet_ip.py | feythin/open_dnsdb | 78485274148d639bf9c2e992602c1f9f87091094 | [
"Apache-2.0"
] | null | null | null | dnsdb_common/dal/subnet_ip.py | feythin/open_dnsdb | 78485274148d639bf9c2e992602c1f9f87091094 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
| 39.51773 | 108 | 0.624192 | # -*- coding: utf-8 -*-
from dnsdb_common.library.IPy import IP
from dnsdb_common.library.exception import BadParam
from . import commit_on_success
from . import db
from .models import DnsColo
from .models import DnsRecord
from .models import IpPool
from .models import Subnets
class SubnetIpDal(object):
@staticme... | 210 | 4,844 | 0 | 5 | 0 | 0 | 0 | 78 | 549 |
4ceb9e3b924e4fa021d61f5bd0e2581a94b1b15a | 4,169 | py | Python | scripts/lowest_pvalue_KG.py | PlantProteomes/SeqComparison | f67e63fee6bd1d90cd258528ab854a723adffcbf | [
"Apache-2.0"
] | null | null | null | scripts/lowest_pvalue_KG.py | PlantProteomes/SeqComparison | f67e63fee6bd1d90cd258528ab854a723adffcbf | [
"Apache-2.0"
] | 12 | 2021-11-02T23:34:24.000Z | 2022-03-25T18:28:18.000Z | scripts/lowest_pvalue_KG.py | PlantProteomes/SeqComparison | f67e63fee6bd1d90cd258528ab854a723adffcbf | [
"Apache-2.0"
] | 1 | 2021-11-07T03:33:41.000Z | 2021-11-07T03:33:41.000Z |
##########################################################################
if __name__ == "__main__":
main()
| 35.939655 | 119 | 0.526985 | import argparse
import re
from Bio import SeqIO
import os
class pvalue_lowest:
def __init__(self):
# stores the vlaues in here
self.identifier = dict()
self.entry_counter = 0
def read(self, filename):
# this will open specified file
with open(filename... | 0 | 0 | 0 | 2,510 | 0 | 1,419 | 0 | -30 | 142 |
91ee9b6c68617ef050d3aa5fdbcfbb952f31a3b3 | 30,054 | py | Python | bitmex_swagger/api/position_api.py | silencewwt/bitmex-swagger-client | 01403685eeb12eb27d53a0310d3bc7541793aa0f | [
"MIT"
] | 1 | 2018-08-04T15:05:43.000Z | 2018-08-04T15:05:43.000Z | bitmex_swagger/api/position_api.py | silencewwt/bitmex-swagger | 01403685eeb12eb27d53a0310d3bc7541793aa0f | [
"MIT"
] | null | null | null | bitmex_swagger/api/position_api.py | silencewwt/bitmex-swagger | 01403685eeb12eb27d53a0310d3bc7541793aa0f | [
"MIT"
] | null | null | null | # coding: utf-8
"""
BitMEX API
## REST API for the BitMEX Trading Platform [View Changelog](/app/apiChangelog) ---- #### Getting Started Base URI: [https://www.bitmex.com/api/v1](/api/v1) ##### Fetching Data All REST endpoints are documented below. You can try out any query right from this interface. M... | 54.249097 | 2,840 | 0.65003 | # coding: utf-8
"""
BitMEX API
## REST API for the BitMEX Trading Platform [View Changelog](/app/apiChangelog) ---- #### Getting Started Base URI: [https://www.bitmex.com/api/v1](/api/v1) ##### Fetching Data All REST endpoints are documented below. You can try out any query right from this interface. M... | 3 | 0 | 0 | 28,172 | 0 | 0 | 0 | 3 | 105 |
b7a8269b23b96f8235c2dc671a54b9df80b832ee | 12,083 | py | Python | pysnmp/HPN-ICF-E1-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/HPN-ICF-E1-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/HPN-ICF-E1-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module HPN-ICF-E1-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HPN-ICF-E1-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:26:02 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2... | 125.864583 | 1,976 | 0.763718 | #
# PySNMP MIB module HPN-ICF-E1-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HPN-ICF-E1-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:26:02 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2... | 0 | 0 | 0 | 147 | 0 | 0 | 0 | 0 | 22 |
c91881ea4514bafb5bac906997b0931abb9d7296 | 221 | py | Python | config/config.py | oplik0/jeja-pbf-export | c2889299db4d0331f96badaf067dfb8f71cc7da5 | [
"MIT"
] | null | null | null | config/config.py | oplik0/jeja-pbf-export | c2889299db4d0331f96badaf067dfb8f71cc7da5 | [
"MIT"
] | 2 | 2019-12-17T21:30:22.000Z | 2021-06-25T15:30:42.000Z | config/config.py | oplik0/jeja-pbf-export | c2889299db4d0331f96badaf067dfb8f71cc7da5 | [
"MIT"
] | null | null | null |
if __name__=="__main__":
print(parse_config("config")) | 27.625 | 55 | 0.723982 | import json
def parse_config(config_file_name):
with open(config_file_name+".json") as config_file:
config = json.load(config_file)
return config
if __name__=="__main__":
print(parse_config("config")) | 0 | 0 | 0 | 0 | 0 | 128 | 0 | -10 | 44 |
c7b8c85ccbe8a1f45038757cf18c941a089a78d4 | 3,353 | py | Python | helloworld-tls/src/tests/test_selenium_ff.py | JeNeSuisPasDave/Selenium-and-TLS | 4f1b88968967f3fbae52d499213031d56eb53337 | [
"MIT-0",
"MIT"
] | 2 | 2017-09-29T19:23:08.000Z | 2021-11-20T18:14:42.000Z | helloworld-tls/src/tests/test_selenium_ff.py | JeNeSuisPasDave/Selenium-and-TLS | 4f1b88968967f3fbae52d499213031d56eb53337 | [
"MIT-0",
"MIT"
] | null | null | null | helloworld-tls/src/tests/test_selenium_ff.py | JeNeSuisPasDave/Selenium-and-TLS | 4f1b88968967f3fbae52d499213031d56eb53337 | [
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2017 David Hein
#
# Licensed under the MIT License. If the LICENSE file is missing, you
# can find the MIT license terms here: https://opensource.org/licenses/MIT
| 32.553398 | 76 | 0.596183 | # Copyright 2017 David Hein
#
# Licensed under the MIT License. If the LICENSE file is missing, you
# can find the MIT license terms here: https://opensource.org/licenses/MIT
import re
import threading
import time
import unittest
from selenium import webdriver
from selenium.webdriver.firefox.firefox_profile import Fir... | 0 | 2,238 | 0 | 676 | 0 | 0 | 0 | -2 | 266 |
d635e85f735f50546bb4ea59ac57853b901f8d80 | 8,269 | py | Python | scripts/temizlik_robotu_engelden_sakinma_dugumu.py | inomuh/temizlik_robotu | ffd2ea18c5e1c19c910ab8a63ff8be5f00ca3a7a | [
"Apache-2.0"
] | null | null | null | scripts/temizlik_robotu_engelden_sakinma_dugumu.py | inomuh/temizlik_robotu | ffd2ea18c5e1c19c910ab8a63ff8be5f00ca3a7a | [
"Apache-2.0"
] | null | null | null | scripts/temizlik_robotu_engelden_sakinma_dugumu.py | inomuh/temizlik_robotu | ffd2ea18c5e1c19c910ab8a63ff8be5f00ca3a7a | [
"Apache-2.0"
] | 1 | 2020-02-15T19:20:47.000Z | 2020-02-15T19:20:47.000Z | #!/usr/bin/env python
# coding=utf-8
import rospy
#__________________________________________________________________________________________________
#
# TemizlikRobotuEngeldenSakinma
#
# AMA: Robotun engelden saknmas ve hareket emrini vermesi iin
# oluturulmu snftr.
#
# SINIF DEKENLER:
#
# ### Cons... | 39.37619 | 196 | 0.650381 | #!/usr/bin/env python
# coding=utf-8
import rospy
from sensor_msgs.msg import Range
from temizlik_robotu.srv import *
#__________________________________________________________________________________________________
#
# TemizlikRobotuEngeldenSakinma
#
# AMAÇ: Robotun engelden sakınması ve hareket emrini verm... | 340 | 0 | 0 | 6,781 | 0 | 0 | 0 | 24 | 68 |
81e949cc15bbe1268f45206540d53c41783c1a52 | 2,888 | py | Python | scripts/validateChecksum.py | mistalaba/popover-blocklist | 5c5159ece21a3ecd478eb1067d54f298c13e38c7 | [
"MIT"
] | 11 | 2015-11-04T21:13:03.000Z | 2019-04-29T15:03:42.000Z | scripts/validateChecksum.py | mistalaba/popover-blocklist | 5c5159ece21a3ecd478eb1067d54f298c13e38c7 | [
"MIT"
] | null | null | null | scripts/validateChecksum.py | mistalaba/popover-blocklist | 5c5159ece21a3ecd478eb1067d54f298c13e38c7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# This file is part of Adblock Plus <https://adblockplus.org/>,
# Copyright (C) 2006-2015 Eyeo GmbH
#
# Adblock Plus is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundat... | 40.111111 | 85 | 0.566482 | #!/usr/bin/env python
# coding: utf-8
# This file is part of Adblock Plus <https://adblockplus.org/>,
# Copyright (C) 2006-2015 Eyeo GmbH
#
# Adblock Plus is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundat... | 0 | 0 | 0 | 0 | 0 | 857 | 0 | 25 | 115 |
b2d4340abdb2f8574589b3ce07632671e220cd6e | 9,392 | py | Python | jinja2/jinja2-2.0/tests/test_filters.py | minixalpha/SourceLearning | a88d563662dfb3fb375ae3c1ec9012436cd9c88f | [
"Apache-2.0"
] | 118 | 2015-01-09T03:36:48.000Z | 2021-11-09T10:40:01.000Z | jinja2/jinja2-2.0/tests/test_filters.py | daichangya/SourceLearning | a88d563662dfb3fb375ae3c1ec9012436cd9c88f | [
"Apache-2.0"
] | 2 | 2015-07-14T06:18:29.000Z | 2016-03-14T04:00:45.000Z | jinja2/jinja2-2.0/tests/test_filters.py | daichangya/SourceLearning | a88d563662dfb3fb375ae3c1ec9012436cd9c88f | [
"Apache-2.0"
] | 56 | 2015-01-06T01:43:58.000Z | 2019-06-22T13:52:20.000Z | # -*- coding: utf-8 -*-
"""
unit test for the filters
~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2008 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
CAPITALIZE = '''{{ "foo bar"|capitalize }}'''
CENTER = '''{{ "foo"|center(9) }}'''
DEFAULT = '''{{ missing|default("no") }}|{{ false|def... | 28.721713 | 79 | 0.548552 | # -*- coding: utf-8 -*-
"""
unit test for the filters
~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2008 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from jinja2 import Markup, Environment
CAPITALIZE = '''{{ "foo bar"|capitalize }}'''
CENTER = '''{{ "foo"|center(9) }}'''
DEFAULT = '''{... | 0 | 0 | 0 | 0 | 0 | 5,584 | 0 | 17 | 942 |
85175c0706a3c9b3cef2931cbef75f58309860cd | 2,985 | py | Python | max+python3/maxdb/tests/test_main.py | chaughawout/rdbms | 94228ce2f2a11f40a69ad612ecf99bc71858fefc | [
"MIT"
] | 15 | 2017-02-10T20:07:51.000Z | 2021-02-10T02:57:59.000Z | max+python3/maxdb/tests/test_main.py | NashFP/rdms | 9cac306a9bc89fae4db03ee1a860a7137e7f5382 | [
"MIT"
] | 3 | 2017-02-10T21:03:41.000Z | 2017-03-01T21:39:41.000Z | max+python3/maxdb/tests/test_main.py | NashFP/rdms | 9cac306a9bc89fae4db03ee1a860a7137e7f5382 | [
"MIT"
] | 10 | 2016-10-26T04:44:29.000Z | 2021-07-29T05:57:23.000Z | import os
DB_NAME = 'app'
TABLE_NAME = 'thing'
| 25.29661 | 107 | 0.657286 | import json
import os
import os.path
import pytest
from ..constants import (
COLUMNS,
FILE_EXTENSION,
ROWS,
)
from ..exceptions import (
DatabaseDoesNotExist,
DatabaseExists,
TableExists,
MissingColumns,
)
from ..main import (
create_database,
create_table,
drop_database,
g... | 0 | 0 | 0 | 0 | 0 | 2,344 | 0 | 219 | 364 |
c7a817fcdef6be93ef14554390d7b275cdbc6c2e | 25,868 | py | Python | toolkit/tamr_aligner/rule_based_aligner/matcher.py | shamy1997/HIT-SCIR-CoNLL2019 | 48a0a0429bae18968efaffbe6e5c97344e1d8ff1 | [
"Apache-2.0"
] | 24 | 2019-10-07T12:38:00.000Z | 2021-09-28T06:44:56.000Z | toolkit/tamr_aligner/rule_based_aligner/matcher.py | shamy1997/HIT-SCIR-CoNLL2019 | 48a0a0429bae18968efaffbe6e5c97344e1d8ff1 | [
"Apache-2.0"
] | 13 | 2020-01-14T13:26:37.000Z | 2020-09-21T11:35:11.000Z | toolkit/tamr_aligner/rule_based_aligner/matcher.py | shamy1997/HIT-SCIR-CoNLL2019 | 48a0a0429bae18968efaffbe6e5c97344e1d8ff1 | [
"Apache-2.0"
] | 10 | 2019-10-09T07:14:05.000Z | 2020-12-11T19:02:13.000Z | #!/usr/bin/env python
from __future__ import unicode_literals
from __future__ import absolute_import
_word2vec = None
__all__ = [
'init_word2vec',
'WordMatcher',
'FuzzyWordMatcher',
'MorphosemanticLinkMatcher',
'SemanticWordMatcher',
'FuzzySpanMatcher',
'NamedEntityMat... | 41.722581 | 116 | 0.57113 | #!/usr/bin/env python
from __future__ import unicode_literals
from __future__ import absolute_import
import string
import os
from .stemmer import Stemmer, lemmatizer
from system.misc import parse_all_dates
from gensim.models import KeyedVectors
from nltk.corpus import stopwords
_word2vec = None
def init_word2vec(fil... | 0 | 3,348 | 0 | 21,093 | 0 | 234 | 0 | 46 | 592 |
c480f44d29881bf926e7a01db7948676c61f3ff1 | 9,513 | py | Python | _build/jupyter_execute/10_joint.py | myamullaciencia/Bayesian-statistics | 1439716e377884465316cf9512f8e3a9199e79d6 | [
"Apache-2.0"
] | null | null | null | _build/jupyter_execute/10_joint.py | myamullaciencia/Bayesian-statistics | 1439716e377884465316cf9512f8e3a9199e79d6 | [
"Apache-2.0"
] | null | null | null | _build/jupyter_execute/10_joint.py | myamullaciencia/Bayesian-statistics | 1439716e377884465316cf9512f8e3a9199e79d6 | [
"Apache-2.0"
] | null | null | null | # Chapter 10
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
## Review
So far we have been working with distributions of only one variable. In this notebook we'll take a step toward multivariate distributions, starting with two variables.
We'll use cross-tabulation to compute a **joint distr... | 31.39604 | 272 | 0.750657 | # Chapter 10
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
## Review
So far we have been working with distributions of only one variable. In this notebook we'll take a step toward multivariate distributions, starting with two variables.
We'll use cross-tabulation to compute a **joint distr... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ab4caff5163a3cdf52f09cd63ee7bc5ba8706caf | 270 | py | Python | easy_flags/__init__.py | vaniakosmos/easy_flags | 00f33561cc1d823885477579a1d0907f802eac55 | [
"MIT"
] | 3 | 2018-08-22T19:10:49.000Z | 2018-08-23T10:25:58.000Z | easy_flags/__init__.py | vaniakosmos/easy_flags | 00f33561cc1d823885477579a1d0907f802eac55 | [
"MIT"
] | null | null | null | easy_flags/__init__.py | vaniakosmos/easy_flags | 00f33561cc1d823885477579a1d0907f802eac55 | [
"MIT"
] | null | null | null | from .base import CONFIG, Config, SimpleConfig
from .fields import BoolField, Field, FloatField, IntField, MethodField, StringField
__all__ = [
'SimpleConfig', 'Config', 'CONFIG',
'BoolField', 'Field', 'FloatField', 'IntField', 'MethodField', 'StringField',
]
| 30 | 84 | 0.714815 | from .base import CONFIG, Config, SimpleConfig
from .fields import BoolField, Field, FloatField, IntField, MethodField, StringField
__all__ = [
'SimpleConfig', 'Config', 'CONFIG',
'BoolField', 'Field', 'FloatField', 'IntField', 'MethodField', 'StringField',
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2432c8ffc428f12b03b1bf2a84ad5fa033d6488a | 1,322 | py | Python | cache_purge_hooks/backends/varnishbackend.py | RealGeeks/django-cache-purge-hooks | 120463e5835e9072650e09ad868b3d37f6ff921d | [
"MIT"
] | 7 | 2015-02-16T15:02:41.000Z | 2017-09-21T20:41:37.000Z | cache_purge_hooks/backends/varnishbackend.py | RealGeeks/django-cache-purge-hooks | 120463e5835e9072650e09ad868b3d37f6ff921d | [
"MIT"
] | null | null | null | cache_purge_hooks/backends/varnishbackend.py | RealGeeks/django-cache-purge-hooks | 120463e5835e9072650e09ad868b3d37f6ff921d | [
"MIT"
] | 3 | 2015-10-30T17:36:06.000Z | 2015-11-11T09:29:13.000Z | import logging
from django.conf import settings
logger = logging.getLogger('django.cache_purge_hooks')
VARNISHADM_HOST = getattr(settings, 'VARNISHADM_HOST', 'localhost')
VARNISHADM_PORT = getattr(settings, 'VARNISHADM_PORT', 6082)
VARNISHADM_SECRET = getattr(settings, 'VARNISHADM_SECRET', '/etc/varnish/secret')
VAR... | 36.722222 | 113 | 0.665658 | import logging
import subprocess
from django.conf import settings
logger = logging.getLogger('django.cache_purge_hooks')
VARNISHADM_HOST = getattr(settings, 'VARNISHADM_HOST', 'localhost')
VARNISHADM_PORT = getattr(settings, 'VARNISHADM_PORT', 6082)
VARNISHADM_SECRET = getattr(settings, 'VARNISHADM_SECRET', '/etc/va... | 0 | 0 | 0 | 809 | 0 | 0 | 0 | -4 | 45 |
75bf6ff3d98f5842de4f4cb140dc65cee4e7392d | 2,543 | py | Python | mpcontribs-users/mpcontribs/users/dilute_solute_diffusion/rest/rester.py | josuav1/MPContribs | 3cbf0e83ba6cd749dd4fc988c9f6ad076b05f935 | [
"MIT"
] | 1 | 2019-07-03T04:38:58.000Z | 2019-07-03T04:38:58.000Z | mpcontribs-users/mpcontribs/users/dilute_solute_diffusion/rest/rester.py | josuav1/MPContribs | 3cbf0e83ba6cd749dd4fc988c9f6ad076b05f935 | [
"MIT"
] | null | null | null | mpcontribs-users/mpcontribs/users/dilute_solute_diffusion/rest/rester.py | josuav1/MPContribs | 3cbf0e83ba6cd749dd4fc988c9f6ad076b05f935 | [
"MIT"
] | 1 | 2019-07-03T04:39:04.000Z | 2019-07-03T04:39:04.000Z | # -*- coding: utf-8 -*-
from __future__ import division, unicode_literals
| 37.955224 | 105 | 0.628392 | # -*- coding: utf-8 -*-
from __future__ import division, unicode_literals
import six, bson, os
from bson.json_util import loads
from mpcontribs.rest.rester import MPContribsRester
from mpcontribs.io.core.utils import clean_value
from mpcontribs.io.archieml.mpfile import MPFile
class DiluteSoluteDiffusionRester(MPContr... | 6 | 0 | 0 | 2,240 | 0 | 0 | 0 | 94 | 133 |
db3902ad4e429e37bda1dace002fa844336167b8 | 499 | py | Python | teams_helper.py | paulpc/Team11 | e6ad2715dda315a0a32ba5b7b1fa0b2e2c0efdb9 | [
"MIT"
] | null | null | null | teams_helper.py | paulpc/Team11 | e6ad2715dda315a0a32ba5b7b1fa0b2e2c0efdb9 | [
"MIT"
] | null | null | null | teams_helper.py | paulpc/Team11 | e6ad2715dda315a0a32ba5b7b1fa0b2e2c0efdb9 | [
"MIT"
] | 1 | 2018-10-29T16:16:16.000Z | 2018-10-29T16:16:16.000Z | import requests
def teams_message(message, channel, colour, image=False):
"""sends a card on teams"""
card={
"@context": "http://schema.org/extensions",
"@type": "MessageCard",
"themeColor": colour,
"title": "Automated DrillBit analysis",
"text": message
}
if ima... | 29.352941 | 61 | 0.59519 | import requests
def teams_message(message, channel, colour, image=False):
"""sends a card on teams"""
card={
"@context": "http://schema.org/extensions",
"@type": "MessageCard",
"themeColor": colour,
"title": "Automated DrillBit analysis",
"text": message
}
if ima... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
36710d966d81efab9662f27509e3776dd311faf7 | 1,776 | py | Python | WH_Utils/Connectors/WH/api.py | McClain-Thiel/WH_Utils | f81432f57a5a8ed582ddb76f8f11353b3e1ea8bd | [
"Apache-2.0"
] | null | null | null | WH_Utils/Connectors/WH/api.py | McClain-Thiel/WH_Utils | f81432f57a5a8ed582ddb76f8f11353b3e1ea8bd | [
"Apache-2.0"
] | null | null | null | WH_Utils/Connectors/WH/api.py | McClain-Thiel/WH_Utils | f81432f57a5a8ed582ddb76f8f11353b3e1ea8bd | [
"Apache-2.0"
] | null | null | null | import requests
from typing import Dict, Union, Optional
from WH_Utils.Objects.Event import Event
from WH_Utils.Objects.Prospect import Prospect
from WH_Utils.Objects.Company import Company
base_url = "https://db.wealthawk.com"
def get_event_by_person(
client: Union[Prospect, str], auth_header: Dict[str, str]
)... | 25.73913 | 73 | 0.659347 | import requests
from typing import List, Dict, Union, Optional
from WH_Utils.Objects.Event import Event
from WH_Utils.Objects.Prospect import Prospect
from WH_Utils.Objects.Company import Company
base_url = "https://db.wealthawk.com"
def get_event_by_person(
client: Union[Prospect, str], auth_header: Dict[str, ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0 |
5ab10eb6f5b697465aca37c376f1c1781dcf7fba | 625 | py | Python | Bugscan_exploits-master/exp_list/exp-2021.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 11 | 2020-05-30T13:53:49.000Z | 2021-03-17T03:20:59.000Z | Bugscan_exploits-master/exp_list/exp-2021.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-13T03:25:18.000Z | 2020-07-21T06:24:16.000Z | Bugscan_exploits-master/exp_list/exp-2021.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-30T13:53:51.000Z | 2020-12-01T21:44:26.000Z | #!/usr/bin/env python
#-*- coding:utf-8 -*-
#info:http://www.wooyun.org/bugs/wooyun-2010-0135128
if __name__ == '__main__':
audit(assign('kinggate', 'https://202.103.238.229/')[1]) | 32.894737 | 64 | 0.6192 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
#info:http://www.wooyun.org/bugs/wooyun-2010-0135128
import urlparse
def assign(service, arg):
if service == "kinggate":
arr = urlparse.urlparse(arg)
return True, '%s://%s/' % (arr.scheme, arr.netloc)
def audit(arg):
url = arg + 'src/system/... | 0 | 0 | 0 | 0 | 0 | 345 | 0 | -8 | 98 |
e6c95751c8ef6e51b53f90aba7eb71843de3e11d | 5,813 | py | Python | ros2topic/ros2topic/verb/bw.py | jpace121/ros2cli | c2ee69dcbd90706cb234a58b83ee69dd0f7f3063 | [
"Apache-2.0"
] | null | null | null | ros2topic/ros2topic/verb/bw.py | jpace121/ros2cli | c2ee69dcbd90706cb234a58b83ee69dd0f7f3063 | [
"Apache-2.0"
] | 1 | 2019-07-12T02:26:04.000Z | 2019-07-12T02:26:04.000Z | ros2topic/ros2topic/verb/bw.py | jpace121/ros2cli | c2ee69dcbd90706cb234a58b83ee69dd0f7f3063 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Software License Agreement (BSD License 2.0)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the a... | 35.882716 | 119 | 0.652847 | # Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Software License Agreement (BSD License 2.0)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the a... | 0 | 0 | 0 | 2,697 | 0 | 187 | 0 | 60 | 224 |
de70aa0b15fcb44cf76ac667cd29643bd30e8121 | 315 | py | Python | Lib/site-packages/django_core/forms/mixins/paging.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | null | null | null | Lib/site-packages/django_core/forms/mixins/paging.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | Lib/site-packages/django_core/forms/mixins/paging.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | null | null | null | from __future__ import unicode_literals
| 31.5 | 74 | 0.749206 | from __future__ import unicode_literals
from django import forms
class PagingFormMixin(forms.Form):
"""Form mixin that includes paging page number and page size."""
p = forms.IntegerField(label='Page', initial=1, required=False)
ps = forms.IntegerField(label='Page Size', initial=25, required=False)
| 0 | 0 | 0 | 225 | 0 | 0 | 0 | 3 | 46 |
7e7954468e3369ea48a5ff826bb88cf018b09bbc | 1,503 | py | Python | Python3Test/data/BirthWeight.py | qianhk/FeiPython | c87578d3c04b7345a99fef7390c8ea12c6f2c716 | [
"Apache-2.0"
] | null | null | null | Python3Test/data/BirthWeight.py | qianhk/FeiPython | c87578d3c04b7345a99fef7390c8ea12c6f2c716 | [
"Apache-2.0"
] | 15 | 2019-11-18T06:09:50.000Z | 2022-03-02T02:55:54.000Z | Python3Test/data/BirthWeight.py | qianhk/FeiPython | c87578d3c04b7345a99fef7390c8ea12c6f2c716 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# coding=utf-8
HttpUserAgent = r"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"
birthdata_url = 'https://github.com/nfmcclure/tensorflow_cookbook/raw/master/01_Introduction/07_Working_with_Data_Sources/birthweight_dat... | 30.06 | 155 | 0.682635 | #!/usr/bin/env python3
# coding=utf-8
import requests
import os
HttpUserAgent = r"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"
def download(url):
new_path = os.path.join('..', 'cache')
print('new_path', new_path)
if not os.pa... | 0 | 0 | 0 | 0 | 0 | 771 | 0 | -18 | 68 |
a76bb4dff1fe0879751b999f54a3655021638b4f | 274 | py | Python | blog/posts/urls.py | abdullah1107/Django_RestApi-New- | b4fd65d73ca95d1a373758f46093e5fe28786980 | [
"MIT"
] | 1 | 2019-12-14T06:09:01.000Z | 2019-12-14T06:09:01.000Z | blog/posts/urls.py | abdullah1107/Django_RestApi-New- | b4fd65d73ca95d1a373758f46093e5fe28786980 | [
"MIT"
] | null | null | null | blog/posts/urls.py | abdullah1107/Django_RestApi-New- | b4fd65d73ca95d1a373758f46093e5fe28786980 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
from .api import views
urlpatterns = [
path('', views.PostListView.as_view(), name=None),
path('create/', views.PostCreateView.as_view(), name=None),
path('<int:pk>/', views.PostDetailView.as_view(), name=None)
] | 30.444444 | 64 | 0.69708 | from django.urls import path
from . import views
from .api import views
urlpatterns = [
path('', views.PostListView.as_view(), name=None),
path('create/', views.PostCreateView.as_view(), name=None),
path('<int:pk>/', views.PostDetailView.as_view(), name=None)
] | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9f976a84c4217dec9f6c8413310b3e1d5b63c756 | 753 | py | Python | phac/filter_series.py | jusjusjus/phac-python | 107c1e3f2f80972ff675754af9b38e271f5005b9 | [
"MIT"
] | null | null | null | phac/filter_series.py | jusjusjus/phac-python | 107c1e3f2f80972ff675754af9b38e271f5005b9 | [
"MIT"
] | null | null | null | phac/filter_series.py | jusjusjus/phac-python | 107c1e3f2f80972ff675754af9b38e271f5005b9 | [
"MIT"
] | null | null | null | from typing import Tuple
from collections import namedtuple
_FilterSeries: Tuple[float, float, float] = namedtuple( # type: ignore
"FilterSeries", "min max width"
)
| 23.53125 | 74 | 0.657371 | from typing import List, Tuple
from collections import namedtuple
import numpy as np
from .frequency_band import FrequencyBand
_FilterSeries: Tuple[float, float, float] = namedtuple( # type: ignore
"FilterSeries", "min max width"
)
class FilterSeries(_FilterSeries):
_resolution = 2
@property
def... | 0 | 218 | 0 | 271 | 0 | 0 | 0 | 23 | 69 |
c92f6a015dd8bdb1403f9da042de577e3956d907 | 10,116 | py | Python | python/Parametrique.py | falquor/l-system | 9bef0a0e45af1011624a20954e78015042bb3c29 | [
"MIT"
] | 6 | 2017-10-06T18:46:14.000Z | 2019-08-29T05:07:56.000Z | python/Parametrique.py | falquor/l-system | 9bef0a0e45af1011624a20954e78015042bb3c29 | [
"MIT"
] | null | null | null | python/Parametrique.py | falquor/l-system | 9bef0a0e45af1011624a20954e78015042bb3c29 | [
"MIT"
] | 1 | 2018-10-05T20:16:09.000Z | 2018-10-05T20:16:09.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Oct 22 17:07:17 2014
@author: Quentin
"""
###################################### TIPE : L-Systmes - 2e anne ############################
######################################## L-systmes paramtriques ##############################
def nbr_virgule(s):
""" Compte le nomb... | 48.634615 | 494 | 0.429913 | # -*- coding: utf-8 -*-
"""
Created on Wed Oct 22 17:07:17 2014
@author: Quentin
"""
###################################### TIPE : L-Systèmes - 2e année ############################
######################################## L-systèmes paramétriques ##############################
def nbr_virgule(s):
""" Compte le ... | 116 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6ffc9f9cb09800c61e2a001653f8f7ceacdfdf3c | 7,022 | py | Python | sapling_zip32.py | zcash-hackworks/zcash-test-vectors | 61894e7793d29fc236697ee187e486d84a31d158 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13 | 2018-10-18T11:19:38.000Z | 2022-03-06T03:04:03.000Z | sapling_zip32.py | zcash-hackworks/zcash-test-vectors | 61894e7793d29fc236697ee187e486d84a31d158 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 57 | 2018-06-04T13:10:39.000Z | 2022-03-23T00:53:04.000Z | sapling_zip32.py | zcash-hackworks/zcash-test-vectors | 61894e7793d29fc236697ee187e486d84a31d158 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 16 | 2018-05-23T22:55:41.000Z | 2022-03-25T09:04:14.000Z | #!/usr/bin/env python3
import sys; assert sys.version_info[0] >= 3, "Python 3 required."
if __name__ == '__main__':
main()
| 30.267241 | 99 | 0.528197 | #!/usr/bin/env python3
import sys; assert sys.version_info[0] >= 3, "Python 3 required."
from pyblake2 import blake2b
from sapling_key_components import to_scalar, prf_expand, diversify_hash, DerivedAkNk, DerivedIvk
from sapling_generators import SPENDING_KEY_BASE, PROVING_KEY_BASE
from utils import i2leosp, i2lebsp,... | 0 | 499 | 0 | 4,115 | 0 | 1,780 | 0 | 201 | 295 |
e4800677ff8330f2c78fb5fd624da049c8f75364 | 557 | py | Python | src/database/misc.py | yang573/club-membership-py | 88ae1cc5dc8a9507e1ce876b342e3a7f3d33dd5a | [
"MIT"
] | null | null | null | src/database/misc.py | yang573/club-membership-py | 88ae1cc5dc8a9507e1ce876b342e3a7f3d33dd5a | [
"MIT"
] | null | null | null | src/database/misc.py | yang573/club-membership-py | 88ae1cc5dc8a9507e1ce876b342e3a7f3d33dd5a | [
"MIT"
] | null | null | null | from flask import Blueprint
bp = Blueprint('misc', __name__)
# TODO: Add Mailchimp stats
| 22.28 | 76 | 0.678636 | import csv, re
from flask import Blueprint, request
from . import *
from .utility import *
from .db_func import *
bp = Blueprint('misc', __name__)
# TODO: Add Mailchimp stats
@bp.route('/newsletter', methods=["GET"])
def get_newsletter_info():
cursor = conn.cursor()
sql = count(members, count_arg=members[5]... | 0 | 356 | 0 | 0 | 0 | 0 | 0 | -2 | 111 |
4802ddebbc9c780a7f58ed65ed54a751933bc816 | 8,510 | py | Python | classes/ui/ODTEditor.py | giruenf/GRIPy-3 | ea0f5175bbdd966ca2df956f4667a806d035e532 | [
"Apache-2.0"
] | null | null | null | classes/ui/ODTEditor.py | giruenf/GRIPy-3 | ea0f5175bbdd966ca2df956f4667a806d035e532 | [
"Apache-2.0"
] | null | null | null | classes/ui/ODTEditor.py | giruenf/GRIPy-3 | ea0f5175bbdd966ca2df956f4667a806d035e532 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import wx
MEDIUM_GREY = wx.Colour(224, 224, 224)
| 35.756303 | 76 | 0.622092 | # -*- coding: utf-8 -*-
import sys
import wx
from wx.lib.mixins.listctrl import CheckListCtrlMixin, TextEditMixin, \
ListCtrlAutoWidthMixin, ListRowHighlighter
from collections import OrderedDict
MEDIUM_GREY = wx.Colour(224, 224, 224)
class _ODTSectionCtrl(wx.ListCtrl, TextEditMixin, CheckListCtrlMixin,
... | 6 | 0 | 0 | 8,168 | 0 | 0 | 0 | 100 | 160 |
c329eb47ba63c766ca91ed4c7ae6a68b5ca60c5e | 17,115 | py | Python | env/lib/python3.6/site-packages/sqlalchemy/ext/baked.py | jfairf01/OrgoWebsite | 62f25faa1cc174f91377a281e1cea1dd898b0b30 | [
"MIT"
] | 6 | 2018-02-05T04:57:00.000Z | 2020-05-03T15:00:04.000Z | env/lib/python3.6/site-packages/sqlalchemy/ext/baked.py | jfairf01/OrgoWebsite | 62f25faa1cc174f91377a281e1cea1dd898b0b30 | [
"MIT"
] | 95 | 2018-01-31T20:28:13.000Z | 2018-04-10T01:55:35.000Z | temp-python/lib/python2.7/site-packages/sqlalchemy/ext/baked.py | theresaming/sx-checkin | 7323fbf5ccfd41e9ba5f2fb13e4fbbb33c16092b | [
"BSD-2-Clause"
] | 1 | 2018-04-07T02:12:46.000Z | 2018-04-07T02:12:46.000Z | # sqlalchemy/ext/baked.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Baked query extension.
Provides a creational pattern for the :class:`.que... | 32.538023 | 82 | 0.614081 | # sqlalchemy/ext/baked.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Baked query extension.
Provides a creational pattern for the :class:`.que... | 0 | 3,683 | 0 | 11,120 | 0 | 0 | 0 | 88 | 228 |
558f24d01dc9aa1542923ec1e4f328d6e8b11c73 | 14 | py | Python | build/lib/mpesa/api/__init__.py | Arlus/python-mpesa | 4113d9a59211c05f4c6881965710c4f67a5157b2 | [
"MIT"
] | 26 | 2018-08-02T06:59:50.000Z | 2022-01-15T16:46:39.000Z | build/lib/mpesa/api/__init__.py | Arlus/python-mpesa | 4113d9a59211c05f4c6881965710c4f67a5157b2 | [
"MIT"
] | 1 | 2021-10-10T19:19:20.000Z | 2021-10-10T19:19:20.000Z | build/lib/mpesa/api/__init__.py | Arlus/python-mpesa | 4113d9a59211c05f4c6881965710c4f67a5157b2 | [
"MIT"
] | 38 | 2018-07-26T18:11:18.000Z | 2022-01-02T10:10:54.000Z | name = "mpesa" | 14 | 14 | 0.642857 | name = "mpesa" | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8f872778bda8eb27a70dae4a7da1121123bcd52f | 2,192 | py | Python | survey/tests/exporter/tex/test_survey2tex.py | TheWITProject/MentorApp | 2f08b87a7cde6d180e16d6f37d0b8019b8361638 | [
"MIT"
] | null | null | null | survey/tests/exporter/tex/test_survey2tex.py | TheWITProject/MentorApp | 2f08b87a7cde6d180e16d6f37d0b8019b8361638 | [
"MIT"
] | 65 | 2020-02-04T22:31:07.000Z | 2022-01-13T02:39:19.000Z | survey/tests/exporter/tex/test_survey2tex.py | TheWITProject/MentorApp | 2f08b87a7cde6d180e16d6f37d0b8019b8361638 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 34.25 | 84 | 0.578923 | # -*- coding: utf-8 -*-
from pathlib import Path
from survey.exporter.tex.configuration import Configuration
from survey.exporter.tex.survey2tex import Survey2Tex
from survey.models import Survey
from survey.tests.management.test_management import TestManagement
class TestSurvey2Tex(TestManagement):
def setUp(s... | 14 | 0 | 0 | 1,896 | 0 | 0 | 0 | 129 | 135 |
2aa63dd82f508e9240a1d2542bd18c69d46d55de | 134 | py | Python | src/Domains/__init__.py | MarcelFox/api-modelo | 1ca862446893d0f0d079cde1b10931b8fd188c57 | [
"CC0-1.0"
] | 1 | 2020-09-29T14:55:08.000Z | 2020-09-29T14:55:08.000Z | src/Domains/__init__.py | MarcelFox/api-modelo | 1ca862446893d0f0d079cde1b10931b8fd188c57 | [
"CC0-1.0"
] | null | null | null | src/Domains/__init__.py | MarcelFox/api-modelo | 1ca862446893d0f0d079cde1b10931b8fd188c57 | [
"CC0-1.0"
] | null | null | null | # from .File.Repository import RepositoryController
| 33.5 | 51 | 0.850746 | from .File.Controller import FileController
from .File.Service import FileService
# from .File.Repository import RepositoryController
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 38 | 44 |
67cde7b7bf5c8bada936d94d5b41da6e856e54d6 | 17,860 | py | Python | thornode_client/thornode_client/models/node.py | hoodieonwho/thorchain-python-client | fccfd66552e16bdab1dbb90b68022475c7a9693d | [
"MIT"
] | null | null | null | thornode_client/thornode_client/models/node.py | hoodieonwho/thorchain-python-client | fccfd66552e16bdab1dbb90b68022475c7a9693d | [
"MIT"
] | null | null | null | thornode_client/thornode_client/models/node.py | hoodieonwho/thorchain-python-client | fccfd66552e16bdab1dbb90b68022475c7a9693d | [
"MIT"
] | null | null | null | # coding: utf-8
"""
THORChain API
This documentation outlines the API for THORChain. NOTE: This document is a **work in progress**. # noqa: E501
OpenAPI spec version:
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
| 29.966443 | 408 | 0.610694 | # coding: utf-8
"""
THORChain API
This documentation outlines the API for THORChain. NOTE: This document is a **work in progress**. # noqa: E501
OpenAPI spec version:
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from... | 0 | 10,404 | 0 | 7,060 | 0 | 0 | 0 | 3 | 128 |
2fe4e572509ddd25b34bc893ea9b790e62192f26 | 1,493 | py | Python | reproman/interface/common_opts.py | kyleam/niceman | f4f026d2827e03dce272c7c2d1c6fc11a6abc3b5 | [
"MIT"
] | 13 | 2017-03-02T16:33:08.000Z | 2019-01-12T19:19:08.000Z | reproman/interface/common_opts.py | kyleam/niceman | f4f026d2827e03dce272c7c2d1c6fc11a6abc3b5 | [
"MIT"
] | 313 | 2017-01-13T03:36:30.000Z | 2019-01-24T19:16:08.000Z | reproman/interface/common_opts.py | kyleam/niceman | f4f026d2827e03dce272c7c2d1c6fc11a6abc3b5 | [
"MIT"
] | 6 | 2017-01-12T19:44:01.000Z | 2019-01-12T19:19:18.000Z | # ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the reproman package for the
# copyright and license terms.
#
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
"""Common interfac... | 29.27451 | 84 | 0.61353 | # ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the reproman package for the
# copyright and license terms.
#
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
"""Common interfac... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 0 |
de7ef249e1c2f237d2a039188c121cbb3b1bdb66 | 2,242 | py | Python | edit/ts_unmerge.py | lokal-profil/isfdb_site | 0ce20d6347849926d4eda961ea9249c31519eea5 | [
"BSD-3-Clause"
] | null | null | null | edit/ts_unmerge.py | lokal-profil/isfdb_site | 0ce20d6347849926d4eda961ea9249c31519eea5 | [
"BSD-3-Clause"
] | null | null | null | edit/ts_unmerge.py | lokal-profil/isfdb_site | 0ce20d6347849926d4eda961ea9249c31519eea5 | [
"BSD-3-Clause"
] | null | null | null | #!_PYTHONLOC
#
# (C) COPYRIGHT 2005-2014 Al von Ruff and Ahasuerus
# ALL RIGHTS RESERVED
#
# The copyright notice above does not evidence any actual or
# intended publication of such source code.
#
# Version: $Revision$
# Date: $Date$
import cgi
import sys
import MySQLdb
from viewers import Di... | 29.116883 | 105 | 0.636485 | #!_PYTHONLOC
#
# (C) COPYRIGHT 2005-2014 Al von Ruff and Ahasuerus
# ALL RIGHTS RESERVED
#
# The copyright notice above does not evidence any actual or
# intended publication of such source code.
#
# Version: $Revision$
# Date: $Date$
import cgi
import sys
import MySQLdb
from isfdb import *
fr... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 132 |
f9e094455ea7ec4c1d2901e13decee1c343e90d0 | 525 | py | Python | services/web/server/src/simcore_service_webserver/activity/config.py | KZzizzle/osparc-simcore | 981bc8d193f3f5d507e3225f857e0308c339e163 | [
"MIT"
] | null | null | null | services/web/server/src/simcore_service_webserver/activity/config.py | KZzizzle/osparc-simcore | 981bc8d193f3f5d507e3225f857e0308c339e163 | [
"MIT"
] | null | null | null | services/web/server/src/simcore_service_webserver/activity/config.py | KZzizzle/osparc-simcore | 981bc8d193f3f5d507e3225f857e0308c339e163 | [
"MIT"
] | null | null | null | """ Activity manager configuration
- config-file schema
- prometheus endpoint information
"""
import trafaret as T
CONFIG_SECTION_NAME = "activity"
schema = T.Dict(
{
T.Key("enabled", default=True, optional=True): T.Bool(),
T.Key(
"prometheus_host", default="http://prometheus",... | 27.631579 | 82 | 0.630476 | """ Activity manager configuration
- config-file schema
- prometheus endpoint information
"""
import trafaret as T
CONFIG_SECTION_NAME = "activity"
schema = T.Dict(
{
T.Key("enabled", default=True, optional=True): T.Bool(),
T.Key(
"prometheus_host", default="http://prometheus",... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1518a9e3aad2821f92857cdeb3d245d808b92d59 | 855 | py | Python | rubin_sim/scheduler/schedulers/filter_scheduler.py | RileyWClarke/flarubin | eb7b1ee21c828523f8a5374fe4510fe6e5ec2a2a | [
"MIT"
] | null | null | null | rubin_sim/scheduler/schedulers/filter_scheduler.py | RileyWClarke/flarubin | eb7b1ee21c828523f8a5374fe4510fe6e5ec2a2a | [
"MIT"
] | null | null | null | rubin_sim/scheduler/schedulers/filter_scheduler.py | RileyWClarke/flarubin | eb7b1ee21c828523f8a5374fe4510fe6e5ec2a2a | [
"MIT"
] | null | null | null |
__all__ = ['filter_swap_scheduler', 'simple_filter_sched']
| 25.147059 | 67 | 0.609357 | from rubin_sim.scheduler.utils import int_rounded
__all__ = ['filter_swap_scheduler', 'simple_filter_sched']
class filter_swap_scheduler(object):
"""A simple way to schedule what filter to load
"""
def __init__(self):
pass
def add_observation(self, observation):
pass
def __call_... | 0 | 0 | 0 | 697 | 0 | 0 | 0 | 28 | 68 |
be8c1791ab0e52ff0f6527cd775abd8e18004ced | 30,567 | py | Python | perma_web/api/views.py | abziegler/perma | 3d04661fc1d3b40ff2b3120b485fa195f72169ae | [
"MIT",
"Unlicense"
] | null | null | null | perma_web/api/views.py | abziegler/perma | 3d04661fc1d3b40ff2b3120b485fa195f72169ae | [
"MIT",
"Unlicense"
] | null | null | null | perma_web/api/views.py | abziegler/perma | 3d04661fc1d3b40ff2b3120b485fa195f72169ae | [
"MIT",
"Unlicense"
] | null | null | null |
### BASE VIEW ###
### ORGANIZATION VIEWS ###
# /organizations
# /organizations/:id
### FOLDER VIEWS ###
# /folders
# /folders/:parent_id/folders
# /folders/:id
# /folders/:parent_id/folders/:id
### CAPTUREJOB VIEWS ###
# /capture_jobs
# /capture_jobs/:id
# /capture_jobs/:guid
### LINK VIEWS ###
# /pu... | 41.362652 | 185 | 0.637779 | from collections import OrderedDict
import csv
import django_filters
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist, ValidationError as DjangoValidationError
from django.db import transaction
from django.http import Http404, HttpResponse, HttpResponseRedirect
from mptt.exceptions... | 0 | 11,226 | 0 | 16,935 | 0 | 0 | 0 | 830 | 889 |
ba10d3a5f98205fbafdb26cbf604fba88bbe0b09 | 184 | py | Python | tests/apitests/linearGradient.py | jenskutilek/drawbot-skia | e636316ab40843b410c88ce7e5ba628aeb7d1a2c | [
"Apache-2.0"
] | 60 | 2020-09-17T19:08:33.000Z | 2022-02-02T07:27:13.000Z | tests/apitests/linearGradient.py | jenskutilek/drawbot-skia | e636316ab40843b410c88ce7e5ba628aeb7d1a2c | [
"Apache-2.0"
] | 47 | 2020-09-17T18:58:52.000Z | 2022-03-28T17:36:07.000Z | tests/apitests/linearGradient.py | jenskutilek/drawbot-skia | e636316ab40843b410c88ce7e5ba628aeb7d1a2c | [
"Apache-2.0"
] | 9 | 2020-09-18T13:42:20.000Z | 2022-03-10T23:17:18.000Z | size(200, 200)
linearGradient((25, 25), (175, 175), [(1, 0, 0), (0, 1, 0), (0, 0, 1)], [0, 0.25, 1])
rect(0, 0, 200, 200)
stroke(0)
strokeWidth(4)
fill(1, 0.5)
rect(50, 50, 100, 100)
| 20.444444 | 85 | 0.543478 | size(200, 200)
linearGradient((25, 25), (175, 175), [(1, 0, 0), (0, 1, 0), (0, 0, 1)], [0, 0.25, 1])
rect(0, 0, 200, 200)
stroke(0)
strokeWidth(4)
fill(1, 0.5)
rect(50, 50, 100, 100)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
16e34b9be8cec1ccfae69ab4dca43ca452373e95 | 2,633 | py | Python | TweetListener.py | hozongsien/TwitterSentiment | 9855bc73aa6bfe3da98d27724e48142be5069f54 | [
"MIT"
] | null | null | null | TweetListener.py | hozongsien/TwitterSentiment | 9855bc73aa6bfe3da98d27724e48142be5069f54 | [
"MIT"
] | null | null | null | TweetListener.py | hozongsien/TwitterSentiment | 9855bc73aa6bfe3da98d27724e48142be5069f54 | [
"MIT"
] | null | null | null | import tweepy
if __name__ == "__main__":
keywords = ['crypto', 'cryptocurrency']
credentials = get_credentials()
test_authentication(
credentials['consumer_key'],
credentials['consumer_secret'],
credentials['access_token'],
credentials['access_token_secret']
)
api = create_api(
c... | 27.14433 | 90 | 0.698063 | import tweepy
import socket
import json
import os
class TweetListener(tweepy.StreamListener):
def __init__(self, api, csocket):
self.api = api
self.me = api.me()
self.client_socket = csocket
def on_status(self, status):
print(status.text)
def on_data(self, data):
... | 0 | 0 | 0 | 572 | 0 | 1,210 | 0 | -30 | 181 |
ceb043d41ea0d43d03aee988b1c0a2b642bf5c7d | 6,249 | py | Python | Legacy/lastPython.py | ClarkGuilty/Tesis | 2d0af394a8555bcfe8c977570fa584719ed7b037 | [
"MIT"
] | 1 | 2018-10-25T08:28:26.000Z | 2018-10-25T08:28:26.000Z | Legacy/lastPython.py | ClarkGuilty/Tesis | 2d0af394a8555bcfe8c977570fa584719ed7b037 | [
"MIT"
] | null | null | null | Legacy/lastPython.py | ClarkGuilty/Tesis | 2d0af394a8555bcfe8c977570fa584719ed7b037 | [
"MIT"
] | 3 | 2018-10-02T02:09:24.000Z | 2020-12-13T07:03:52.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 3 17:30:52 2018
@author: Javier Alejandro Acevedo Barroso
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from matplotlib import rcParams
fsize = 16
rcParams.update({'figure.autolayout': True})
#plt.rcPar... | 37.196429 | 150 | 0.647784 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 3 17:30:52 2018
@author: Javier Alejandro Acevedo Barroso
"""
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from matplotlib import rcParams
fsize = 16
rcParams.update({'figure.autol... | 8 | 0 | 0 | 0 | 0 | 100 | 0 | 3 | 45 |
5e12a6b19caf0aaba8345fd16cffdc1341c46fdf | 147 | py | Python | models/__init__.py | lijj0812/UIAutoDemo | 3e13380adeb6cf92410676ff7c125dbee598427f | [
"Apache-2.0"
] | null | null | null | models/__init__.py | lijj0812/UIAutoDemo | 3e13380adeb6cf92410676ff7c125dbee598427f | [
"Apache-2.0"
] | null | null | null | models/__init__.py | lijj0812/UIAutoDemo | 3e13380adeb6cf92410676ff7c125dbee598427f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2021/3/2 16:53
# @Author : Gavin | 21 | 30 | 0.632653 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2021/3/2 16:53
# @Author : Gavin
from .osDriver import osSystem
from .url import Url | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 45 |
6a5215c98f27a8c1cd58ae0e8976d6549f4c2e3d | 2,816 | py | Python | model/utils.py | Seondong/Customs-Fraud-Detection | eb9e4641a78cb32d73787de86dd72ebb09df1452 | [
"MIT"
] | 7 | 2021-07-07T09:22:11.000Z | 2022-02-11T01:54:56.000Z | model/utils.py | Seondong/Customs-Fraud-Detection | eb9e4641a78cb32d73787de86dd72ebb09df1452 | [
"MIT"
] | 3 | 2021-08-01T07:26:42.000Z | 2021-09-13T01:03:01.000Z | model/utils.py | Seondong/Customs-Fraud-Detection | eb9e4641a78cb32d73787de86dd72ebb09df1452 | [
"MIT"
] | 2 | 2021-08-03T08:38:12.000Z | 2022-01-21T05:31:21.000Z | import torch.nn as nn | 39.661972 | 121 | 0.655185 | import torch
import torch.nn.functional as F
import torch.nn as nn
import torch.utils.data as Data
import numpy as np
class FocalLoss(nn.Module):
""" Focal loss for better handling imbalanced class distribution. """
def __init__(self, alpha=1, gamma=2, logits=False, reduce=True):
super(FocalLoss, self... | 0 | 0 | 0 | 2,644 | 0 | 0 | 0 | 8 | 143 |
34732e2614fcb054db86eae81e82d5fdbaaa21cc | 1,479 | py | Python | examples/mpi/project.py | CryoZEUS/signac-docs | 9b836b8fff5024fb58a56094d5aa07f3931007d9 | [
"BSD-3-Clause"
] | null | null | null | examples/mpi/project.py | CryoZEUS/signac-docs | 9b836b8fff5024fb58a56094d5aa07f3931007d9 | [
"BSD-3-Clause"
] | null | null | null | examples/mpi/project.py | CryoZEUS/signac-docs | 9b836b8fff5024fb58a56094d5aa07f3931007d9 | [
"BSD-3-Clause"
] | null | null | null | from flow import FlowProject
# MPI-parallelized operation using mpi4py:
# Execute directly with:
# $ mpiexec -n 2 python project.py exec mpi_hello_world
# or
# $ mpiexec -n 2 python project.py run -o mpi_hello_world
# To generate scripts you would need to take one of the two
# approaches shown below.
# This cmd-ope... | 31.468085 | 74 | 0.753888 | from flow import FlowProject, cmd, directives
# MPI-parallelized operation using mpi4py:
# Execute directly with:
# $ mpiexec -n 2 python project.py exec mpi_hello_world
# or
# $ mpiexec -n 2 python project.py run -o mpi_hello_world
# To generate scripts you would need to take one of the two
# approaches shown below.... | 0 | 477 | 0 | 0 | 0 | 0 | 0 | 17 | 66 |
05cc354a5a368d7581b61330769ad7bde8c727b0 | 1,961 | py | Python | utils/torch_complex.py | fy255/perceptual_cgh | 71a999a8ca8fb355d2f8fb41f97321e48f219324 | [
"MIT"
] | 2 | 2022-02-24T16:19:17.000Z | 2022-03-27T01:13:33.000Z | utils/torch_complex.py | fy255/perceptual_cgh | 71a999a8ca8fb355d2f8fb41f97321e48f219324 | [
"MIT"
] | null | null | null | utils/torch_complex.py | fy255/perceptual_cgh | 71a999a8ca8fb355d2f8fb41f97321e48f219324 | [
"MIT"
] | 1 | 2022-03-27T01:13:34.000Z | 2022-03-27T01:13:34.000Z |
eps = 2.2204e-16
##Tensor operation
| 27.236111 | 84 | 0.664967 | import numpy as np
import torch
eps = 2.2204e-16
##Tensor operation
def np2tensor_complex(complex_num, dtype):
# numpy complex to torch complex
real = torch.tensor(complex_num.real, dtype=dtype)
imag = torch.tensor(complex_num.imag, dtype=dtype)
tensor_complex = torch.complex(real, imag)
return ... | 0 | 0 | 0 | 0 | 0 | 1,699 | 0 | -12 | 228 |
bf147825412b56b22c16ab18fb1054a03a991aa6 | 19 | py | Python | part_c/c_constants.py | cconnerolson/aerospace_assignment_6 | adeb4aaee29198cac06321f2a7a23efd20cf56e6 | [
"MIT"
] | 1 | 2020-11-28T05:16:22.000Z | 2020-11-28T05:16:22.000Z | part_c/c_constants.py | cconnerolson/aerospace_assignment_6 | adeb4aaee29198cac06321f2a7a23efd20cf56e6 | [
"MIT"
] | null | null | null | part_c/c_constants.py | cconnerolson/aerospace_assignment_6 | adeb4aaee29198cac06321f2a7a23efd20cf56e6 | [
"MIT"
] | 1 | 2020-11-28T05:16:29.000Z | 2020-11-28T05:16:29.000Z | A_e = 4.478 # m**2 | 19 | 19 | 0.473684 | A_e = 4.478 # m**2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
29e5d5212161956ff2ed5f4937ed27b567a7c9fc | 1,121 | py | Python | grokking-the-coding-interview/two-pointers/Subarrays-with-Product-Less-than-a-Target-(medium).py | huandrew99/LeetCode | aa36b48d06100ce5f0bc64c789a906ec29409440 | [
"MIT"
] | 36 | 2021-12-23T15:44:41.000Z | 2022-03-31T04:26:26.000Z | grokking-the-coding-interview/two-pointers/Subarrays-with-Product-Less-than-a-Target-(medium).py | wzy0766/LeetCode-1 | 3070e672c519e8af74966811b8058a9baef8c0bc | [
"MIT"
] | null | null | null | grokking-the-coding-interview/two-pointers/Subarrays-with-Product-Less-than-a-Target-(medium).py | wzy0766/LeetCode-1 | 3070e672c519e8af74966811b8058a9baef8c0bc | [
"MIT"
] | 11 | 2022-02-26T22:41:26.000Z | 2022-03-02T07:18:41.000Z | """
LC 713
Given an array with positive numbers and a positive target number, find all of its contiguous subarrays whose product is less than the target number.
Example 1:
Input: [2, 5, 3, 10], target=30
Output: [2], [5], [2, 5], [3], [5, 3], [10]
Explanation: There are six contiguous subarrays whose product is less... | 24.911111 | 149 | 0.615522 | """
LC 713
Given an array with positive numbers and a positive target number, find all of its contiguous subarrays whose product is less than the target number.
Example 1:
Input: [2, 5, 3, 10], target=30
Output: [2], [5], [2, 5], [3], [5, 3], [10]
Explanation: There are six contiguous subarrays whose product is less... | 0 | 0 | 0 | 0 | 0 | 464 | 0 | 0 | 46 |
77b42aa8ffdae9dcef75e138600277e1d0820739 | 2,758 | py | Python | Python/src/functions/newton.py | mnk400/INFO6205 | 1a30679b9a7ebe8ec6b22b385091b24aa5a67720 | [
"Apache-2.0"
] | null | null | null | Python/src/functions/newton.py | mnk400/INFO6205 | 1a30679b9a7ebe8ec6b22b385091b24aa5a67720 | [
"Apache-2.0"
] | null | null | null | Python/src/functions/newton.py | mnk400/INFO6205 | 1a30679b9a7ebe8ec6b22b385091b24aa5a67720 | [
"Apache-2.0"
] | null | null | null |
if __name__ == "__main__":
main()
| 42.430769 | 118 | 0.581581 | import math
from typing import Callable, Union, Tuple
class Newton:
"""
This class models the Newton-Raphson Approximation algorithm.
See https://en.wikipedia.org/wiki/Newton%27s_method
It is an example of a non-deterministic algorithm inasmuch as the convergence (or lack thereof) is very de... | 0 | 0 | 0 | 2,352 | 0 | 252 | 0 | 10 | 96 |
9bce6a2b4e6803c11e5214febb8b6f6ef8ea4050 | 762 | py | Python | Exercices/20200425 Turtle Polygone.py | FredC94/MOOC-Python3 | bb8d15fabc5c0cb240198f968aed4be0d3e0900b | [
"MIT"
] | null | null | null | Exercices/20200425 Turtle Polygone.py | FredC94/MOOC-Python3 | bb8d15fabc5c0cb240198f968aed4be0d3e0900b | [
"MIT"
] | null | null | null | Exercices/20200425 Turtle Polygone.py | FredC94/MOOC-Python3 | bb8d15fabc5c0cb240198f968aed4be0d3e0900b | [
"MIT"
] | null | null | null | import turtle
turtle.up()
turtle.shape('turtle')
turtle.goto(0,0)
turtle.color('black')
turtle.down()
turtle.begin_fill()
turtle.forward(100)
turtle.right(120)
turtle.forward(100)
turtle.right(60)
turtle.forward(100)
turtle.right(120)
turtle.forward(100)
turtle.end_fill()
turtle.up()
turtle.shape('turtle')
turtle.goto... | 16.933333 | 22 | 0.761155 | import turtle
turtle.up()
turtle.shape('turtle')
turtle.goto(0,0)
turtle.color('black')
turtle.down()
turtle.begin_fill()
turtle.forward(100)
turtle.right(120)
turtle.forward(100)
turtle.right(60)
turtle.forward(100)
turtle.right(120)
turtle.forward(100)
turtle.end_fill()
turtle.up()
turtle.shape('turtle')
turtle.goto... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d11e166e7f9569b6475bd488a3934f4bf70e1ffc | 3,296 | py | Python | candied/server.py | BartoszBiernacki/AG | 1aec90de4d6ea3c31dd2096b3581955433431cb4 | [
"MIT"
] | null | null | null | candied/server.py | BartoszBiernacki/AG | 1aec90de4d6ea3c31dd2096b3581955433431cb4 | [
"MIT"
] | null | null | null | candied/server.py | BartoszBiernacki/AG | 1aec90de4d6ea3c31dd2096b3581955433431cb4 | [
"MIT"
] | null | null | null | """Defines the visualization server."""
from mesa.visualization.ModularVisualization import (ModularServer)
from mesa.visualization.modules import ChartModule
from mesa.visualization.UserParam import UserSettableParameter
from .model import Evolution
canvas_element = SimpleCanvas()
creatures_slider = UserSettablePa... | 28.912281 | 77 | 0.585862 | """Defines the visualization server."""
from mesa.visualization.ModularVisualization import (ModularServer,
VisualizationElement)
from mesa.visualization.modules import ChartModule
from mesa.visualization.UserParam import UserSettableParameter
from .agent import Can... | 0 | 1,007 | 0 | 863 | 0 | 0 | 0 | 88 | 46 |
60a72af15d6da5f098d27532b6afa2af4de9bfd8 | 645 | py | Python | app/migrations/0004_alter_list_products_alter_list_tags.py | djyasin/GrocerEase | ec0cad32f0a45a20bed808bd3fc47d8983ceeb9e | [
"MIT"
] | 1 | 2022-02-11T18:34:36.000Z | 2022-02-11T18:34:36.000Z | app/migrations/0004_alter_list_products_alter_list_tags.py | djyasin/GrocerEase | ec0cad32f0a45a20bed808bd3fc47d8983ceeb9e | [
"MIT"
] | null | null | null | app/migrations/0004_alter_list_products_alter_list_tags.py | djyasin/GrocerEase | ec0cad32f0a45a20bed808bd3fc47d8983ceeb9e | [
"MIT"
] | null | null | null | # Generated by Django 4.0.1 on 2022-01-19 15:53
| 26.875 | 93 | 0.609302 | # Generated by Django 4.0.1 on 2022-01-19 15:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0003_tag_alter_list_options_list_date_created_list_tags'),
]
operations = [
migrations.AlterField(
model_name='list',
... | 0 | 0 | 0 | 531 | 0 | 0 | 0 | 19 | 46 |
d1ff4131fe76f3a4a1d7a638a17388adfdbfbd9a | 853 | py | Python | pandapower/rundcpf.py | lucassm/cigre-montecarlo | fd354b9c3ade460b46687ba312f51212dad17151 | [
"MIT"
] | null | null | null | pandapower/rundcpf.py | lucassm/cigre-montecarlo | fd354b9c3ade460b46687ba312f51212dad17151 | [
"MIT"
] | null | null | null | pandapower/rundcpf.py | lucassm/cigre-montecarlo | fd354b9c3ade460b46687ba312f51212dad17151 | [
"MIT"
] | null | null | null | # Copyright (c) 2016 by University of Kassel and Fraunhofer Institute for Wind Energy and Energy
# System Technology (IWES), Kassel. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""Runs a DC power flow.
"""
from os.path import dirname, join
... | 27.516129 | 97 | 0.710434 | # Copyright (c) 2016 by University of Kassel and Fraunhofer Institute for Wind Energy and Energy
# System Technology (IWES), Kassel. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""Runs a DC power flow.
"""
from os.path import dirname, join
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bfe999e70e82bb56b5e80268a2ce83ee9326ec2d | 1,827 | py | Python | algoexpert.io/python/BST_Traversal.py | XSoyOscar/Algorithms | 6e1626d4b0f7804494f0a651698966ad6fd0fe18 | [
"MIT"
] | 713 | 2019-11-19T16:11:25.000Z | 2022-03-31T02:27:52.000Z | algoexpert.io/python/BST_Traversal.py | arunsank/coding-interview-gym | 8131e3a82795707e144fe55d765b6c15bdb97306 | [
"MIT"
] | 7 | 2020-01-16T17:07:18.000Z | 2021-11-15T18:24:39.000Z | algoexpert.io/python/BST_Traversal.py | arunsank/coding-interview-gym | 8131e3a82795707e144fe55d765b6c15bdb97306 | [
"MIT"
] | 393 | 2019-11-18T17:55:45.000Z | 2022-03-28T20:26:32.000Z | # https://www.algoexpert.io/questions/BST%20Traversal
# O(n) time | O(n) space
# O(n) time | O(n) space
# O(n) time | O(n) space
# driver/test code
test_tree = BST(100).insert(5).insert(15).insert(5).insert(2).insert(1).insert(22) \
.insert(1).insert(1).insert(3).insert(1).insert(1).insert(502).insert(55000... | 29.467742 | 84 | 0.591133 | # https://www.algoexpert.io/questions/BST%20Traversal
class BST:
def __init__(self, value):
self.value = value
self.left = None
self.right = None
# Average: O(log(n)) time | O(1) space
# Worst: O(n) time | O(1) space
def insert(self, value):
currentNode = self
while ... | 0 | 0 | 0 | 720 | 0 | 537 | 0 | 0 | 89 |
78e9b22e9f7377b867fcd846be9640def5f97220 | 22,355 | py | Python | ldaptor/test/test_inmemory.py | twisted/ldaptor | a7f992adef3a392f568774a0ae84e67d13d49c84 | [
"MIT"
] | 133 | 2015-02-03T08:40:56.000Z | 2022-03-26T06:36:36.000Z | ldaptor/test/test_inmemory.py | twisted/ldaptor | a7f992adef3a392f568774a0ae84e67d13d49c84 | [
"MIT"
] | 193 | 2015-01-02T00:35:01.000Z | 2022-03-12T15:00:04.000Z | ldaptor/test/test_inmemory.py | twisted/ldaptor | a7f992adef3a392f568774a0ae84e67d13d49c84 | [
"MIT"
] | 51 | 2015-05-08T08:11:07.000Z | 2021-07-28T02:52:02.000Z | """
Test cases for ldaptor.inmemory module.
"""
| 26.772455 | 110 | 0.473988 | """
Test cases for ldaptor.inmemory module.
"""
from io import BytesIO
from twisted.trial import unittest
from ldaptor import inmemory, delta, testutil
from ldaptor.protocols.ldap import distinguishedname, ldaperrors
class SubclassEntry(inmemory.ReadOnlyInMemoryLDAPEntry):
pass
class TestInMemoryDatabase(unit... | 0 | 0 | 0 | 22,040 | 0 | 0 | 0 | 81 | 182 |
1dd976cb0cf24793aa9e45fa82c3cab0daed298e | 3,037 | py | Python | real_estate_agency/real_estate/views.py | Dybov/real_estate_agency | a4392b18c5169ff89c3c7b63afe017f6ede0b431 | [
"MIT"
] | 1 | 2017-09-24T18:53:59.000Z | 2017-09-24T18:53:59.000Z | real_estate_agency/real_estate/views.py | Dybov/real_estate_agency | a4392b18c5169ff89c3c7b63afe017f6ede0b431 | [
"MIT"
] | null | null | null | real_estate_agency/real_estate/views.py | Dybov/real_estate_agency | a4392b18c5169ff89c3c7b63afe017f6ede0b431 | [
"MIT"
] | null | null | null | import re
REGEX_FOR_ANY_TEXT_FIELD = re.compile(r'[^\w]', re.I | re.U)
| 37.493827 | 94 | 0.586105 | import re
from django.db.models import Q
from django.shortcuts import Http404
REGEX_FOR_ANY_TEXT_FIELD = re.compile(r'[^\w]', re.I | re.U)
class ApartmentFilterMixin(object):
"""ApartmentFilterMixin is an mixin for searching in CBV
it filter self.apartment_list using data from self.form
"""
def apa... | 0 | 0 | 0 | 2,872 | 0 | 0 | 0 | 24 | 68 |
30020526f3a413ecc0b6f91b2784f80e8493c2f2 | 7,137 | py | Python | src/orion/core/worker/consumer.py | aimar1986bupt/orion | 6d217af1f9002aa671f8a3260a687c540ca5336d | [
"BSD-3-Clause"
] | 4 | 2019-09-02T19:41:04.000Z | 2020-04-07T13:05:47.000Z | src/orion/core/worker/consumer.py | aimar1986bupt/orion | 6d217af1f9002aa671f8a3260a687c540ca5336d | [
"BSD-3-Clause"
] | 2 | 2018-06-26T19:17:09.000Z | 2022-02-23T13:40:04.000Z | src/orion/core/worker/consumer.py | aimar1986bupt/orion | 6d217af1f9002aa671f8a3260a687c540ca5336d | [
"BSD-3-Clause"
] | 2 | 2019-08-26T11:36:47.000Z | 2020-04-07T13:05:48.000Z | # -*- coding: utf-8 -*-
"""
:mod:`orion.core.worker.consumer` -- Evaluate objective on a set of parameters
==============================================================================
.. module:: consumer
:platform: Unix
:synopsis: Call user's script as a black box process to evaluate a trial.
"""
import logg... | 35.685 | 99 | 0.629256 | # -*- coding: utf-8 -*-
"""
:mod:`orion.core.worker.consumer` -- Evaluate objective on a set of parameters
==============================================================================
.. module:: consumer
:platform: Unix
:synopsis: Call user's script as a black box process to evaluate a trial.
"""
import logg... | 2 | 0 | 0 | 6,334 | 0 | 79 | 0 | 79 | 245 |
5ac427e9a4cc934755e72823a62df1b615163ef6 | 1,342 | py | Python | jaraco/office/grep.py | jaraco/jaraco.office | 160b8f1aceab8f5733f660233702c290abd24830 | [
"MIT"
] | null | null | null | jaraco/office/grep.py | jaraco/jaraco.office | 160b8f1aceab8f5733f660233702c290abd24830 | [
"MIT"
] | null | null | null | jaraco/office/grep.py | jaraco/jaraco.office | 160b8f1aceab8f5733f660233702c290abd24830 | [
"MIT"
] | null | null | null |
from win32com.client import Dispatch
try:
app = Dispatch('Excel.Application')
except Exception:
app = None
# wb = app.Workbooks.Open(filename)
default_pattern = 'Total'
def DeleteUnmatchedRows():
"""
Delete rows that don't match the pattern; you'll have to run this
multiple times if you ... | 21.645161 | 87 | 0.669896 | import re
from win32com.client import Dispatch
try:
app = Dispatch('Excel.Application')
except Exception:
app = None
# wb = app.Workbooks.Open(filename)
default_pattern = 'Total'
def CleanRow(row):
return filter(None, row.Value[0])
def HasPattern(row, pattern=default_pattern):
strings = map(str... | 0 | 0 | 0 | 0 | 88 | 438 | 0 | -12 | 183 |
407d305954f47f692191670259840509dbb48a09 | 1,166 | py | Python | pkg/build-agent/file_server.py | rileyhazard/SmartVA-Analyze-1 | 0573eeff27d03f54e7506db4f1631c0cd9f54bbb | [
"MIT"
] | 4 | 2019-01-23T12:57:47.000Z | 2020-04-18T17:13:08.000Z | pkg/build-agent/file_server.py | rileyhazard/SmartVA-Analyze-1 | 0573eeff27d03f54e7506db4f1631c0cd9f54bbb | [
"MIT"
] | 4 | 2019-01-09T22:10:07.000Z | 2022-02-16T04:57:06.000Z | pkg/build-agent/file_server.py | rileyhazard/SmartVA-Analyze-1 | 0573eeff27d03f54e7506db4f1631c0cd9f54bbb | [
"MIT"
] | 11 | 2018-12-11T22:01:13.000Z | 2022-01-07T11:38:02.000Z | import signal
import time
import threading
import BaseHTTPServer
watched_files = ['SmartVA-Analyze.exe'.lower()]
start = time.time()
run_time = 60
httpd = BaseHTTPServer.HTTPServer(('0.0.0.0', 8000), SimpleHTTPRequestHandlerFileWatcher)
print('{address[0]}:{address[1]} - - Listening...'.format(address=httpd.server... | 27.116279 | 94 | 0.729846 | import os
import signal
import time
import threading
import BaseHTTPServer
import SimpleHTTPServer
watched_files = ['SmartVA-Analyze.exe'.lower()]
start = time.time()
run_time = 60
class SimpleHTTPRequestHandlerFileWatcher(SimpleHTTPServer.SimpleHTTPRequestHandler):
def copyfile(self, source, outputfile):
... | 0 | 0 | 0 | 389 | 0 | 176 | 0 | -10 | 90 |
69b93ae247565f3b4e6660aee30a954a45a30f1e | 2,024 | py | Python | flask_security/__init__.py | inveniosoftware/flask-security-fork | fc71b652bc12f97ebdcff13a8f3ca6a88e4cde6e | [
"MIT"
] | 30 | 2016-11-09T00:21:44.000Z | 2019-09-25T10:18:05.000Z | flask_security/__init__.py | inveniosoftware/flask-security-fork | fc71b652bc12f97ebdcff13a8f3ca6a88e4cde6e | [
"MIT"
] | 22 | 2016-11-15T14:56:59.000Z | 2017-08-19T12:07:31.000Z | flask_security/__init__.py | inveniosoftware/flask-security-invenio | fc71b652bc12f97ebdcff13a8f3ca6a88e4cde6e | [
"MIT"
] | 17 | 2016-10-28T19:27:44.000Z | 2019-11-29T15:35:15.000Z | # -*- coding: utf-8 -*-
"""
flask_security
~~~~~~~~~~~~~~
Flask-Security is a Flask extension that aims to add quick and simple
security via Flask-Login, Flask-Principal, Flask-WTF, and passlib.
:copyright: (c) 2012 by Matt Wright.
:license: MIT, see LICENSE for more details.
"""
# Monkey pat... | 30.666667 | 79 | 0.729249 | # -*- coding: utf-8 -*-
"""
flask_security
~~~~~~~~~~~~~~
Flask-Security is a Flask extension that aims to add quick and simple
security via Flask-Login, Flask-Principal, Flask-WTF, and passlib.
:copyright: (c) 2012 by Matt Wright.
:license: MIT, see LICENSE for more details.
"""
# Monkey pat... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 18 | 0 |
bc66aec79de90693192d685559c1ab2a429d7bba | 1,189 | py | Python | deep_learning_with_pytorch_a_60_minute_blitz/what_is_pytorch.py | Ronalmoo/pytorch_tutorials | 962c256e41d0bdf1003d4f6f03445c9f151dcffc | [
"MIT"
] | 1 | 2019-07-10T14:15:40.000Z | 2019-07-10T14:15:40.000Z | deep_learning_with_pytorch_a_60_minute_blitz/what_is_pytorch.py | Ronalmoo/pytorch_tutorials | 962c256e41d0bdf1003d4f6f03445c9f151dcffc | [
"MIT"
] | null | null | null | deep_learning_with_pytorch_a_60_minute_blitz/what_is_pytorch.py | Ronalmoo/pytorch_tutorials | 962c256e41d0bdf1003d4f6f03445c9f151dcffc | [
"MIT"
] | null | null | null | import torch
import numpy as np
# Tensors
x = torch.empty(5, 3)
print(x)
x = torch.rand(5, 3)
print(x)
x = torch.zeros(5, 3, dtype=torch.long)
print(x)
x = torch.tensor([5.5, 3])
print(x)
x = x.new_ones(5, 3, dtype=torch.double) # new_* methods take in sizes
print(x)
x = torch.randn_like(x, dtype=torch.float) # ... | 16.985714 | 84 | 0.664424 | import torch
import numpy as np
# Tensors
x = torch.empty(5, 3)
print(x)
x = torch.rand(5, 3)
print(x)
x = torch.zeros(5, 3, dtype=torch.long)
print(x)
x = torch.tensor([5.5, 3])
print(x)
x = x.new_ones(5, 3, dtype=torch.double) # new_* methods take in sizes
print(x)
x = torch.randn_like(x, dtype=torch.float) # ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9280733c89d0c8382ff4bc66476a583a719b4cce | 368 | py | Python | djangologdb/middleware.py | cgroschupp/django-logdb | 6815f48b531290857601f90b35f79ee65498df6b | [
"MIT"
] | 5 | 2015-09-09T08:24:35.000Z | 2021-09-30T11:02:27.000Z | djangologdb/middleware.py | cgroschupp/django-logdb | 6815f48b531290857601f90b35f79ee65498df6b | [
"MIT"
] | null | null | null | djangologdb/middleware.py | cgroschupp/django-logdb | 6815f48b531290857601f90b35f79ee65498df6b | [
"MIT"
] | 1 | 2015-02-27T18:38:11.000Z | 2015-02-27T18:38:11.000Z | import logging
logger = logging.getLogger(__name__)
__all__ = ('LoggingMiddleware',)
| 26.285714 | 65 | 0.76087 | import logging
from django.http import Http404
from django.utils.encoding import smart_unicode
logger = logging.getLogger(__name__)
__all__ = ('LoggingMiddleware',)
class LoggingMiddleware(object):
def process_exception(self, request, exception):
if not isinstance(exception, Http404):
logger... | 0 | 0 | 0 | 177 | 0 | 0 | 0 | 36 | 68 |
1deb6099f60b2ef9bf6f804988f25ed87fdbbab3 | 1,522 | py | Python | main.py | SuiMingYang/BilibiliBulletComment | b4270c1bc5b242c6d5c3ddcc17a176f3e976ad35 | [
"MIT"
] | 2 | 2020-11-23T13:06:43.000Z | 2021-04-15T09:28:13.000Z | main.py | SuiMingYang/BilibiliBulletComment | b4270c1bc5b242c6d5c3ddcc17a176f3e976ad35 | [
"MIT"
] | null | null | null | main.py | SuiMingYang/BilibiliBulletComment | b4270c1bc5b242c6d5c3ddcc17a176f3e976ad35 | [
"MIT"
] | null | null | null | import schedule
import time
from up_fan_rank import stat
schedule.every().minutes.do(stat,'fans') # 10 job
schedule.every().minutes.do(stat,'playNum') # 10 job
# schedule.every(10).minutes.do(stat,time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())),'playNum') ... | 69.181818 | 150 | 0.600526 | import schedule
import time
from up_fan_rank import stat
schedule.every().minutes.do(stat,'fans') # 每隔 10 分钟运行一次 job 函数
schedule.every().minutes.do(stat,'playNum') # 每隔 10 分钟运行一次 job 函数
# schedule.every(10).minutes.do(stat,time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())),'play... | 468 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9daf214b77020c19d614d343722da1cfacc35da8 | 1,602 | py | Python | modules/apis/module_ocr.py | Fogapod/KiwiBot | 49743118661abecaab86388cb94ff8a99f9011a8 | [
"MIT"
] | 18 | 2018-05-25T08:50:12.000Z | 2021-10-04T07:13:09.000Z | modules/apis/module_ocr.py | Fogapod/BotMyBot | 49743118661abecaab86388cb94ff8a99f9011a8 | [
"MIT"
] | 4 | 2018-10-20T21:10:38.000Z | 2019-06-25T13:12:07.000Z | modules/apis/module_ocr.py | Fogapod/BotMyBot | 49743118661abecaab86388cb94ff8a99f9011a8 | [
"MIT"
] | 6 | 2018-10-20T21:06:24.000Z | 2021-11-08T05:51:14.000Z |
API_URL = 'https://api.tsu.sh/google/ocr'
| 29.666667 | 88 | 0.510612 | from objects.modulebase import ModuleBase
from utils.funcs import find_image
API_URL = 'https://api.tsu.sh/google/ocr'
class Module(ModuleBase):
usage_doc = '{prefix}{aliases} [image]'
short_doc = 'Optical Character Recognition'
name = 'ocr'
aliases = (name, )
category = 'Services'
ratelim... | 0 | 0 | 1,243 | 214 | 0 | 0 | 0 | 33 | 68 |
aa68f4302746639b8d80cff7da5e8e044e3c10ba | 647 | py | Python | sfa/util/policy.py | planetlab/sfa | d0f743e245e0bb24d7ed1016bcc6e61d1e558a95 | [
"MIT"
] | 1 | 2015-11-19T13:34:45.000Z | 2015-11-19T13:34:45.000Z | sfa/util/policy.py | planetlab/sfa | d0f743e245e0bb24d7ed1016bcc6e61d1e558a95 | [
"MIT"
] | null | null | null | sfa/util/policy.py | planetlab/sfa | d0f743e245e0bb24d7ed1016bcc6e61d1e558a95 | [
"MIT"
] | null | null | null | ### $Id$
### $URL$
| 28.130435 | 77 | 0.534776 | ### $Id$
### $URL$
import os
from sfa.util.storage import *
class Policy(SimpleStorage):
def __init__(self, api):
self.api = api
path = self.api.config.SFA_CONFIG_DIR
filename = ".".join([self.api.interface, self.api.hrn, "policy"])
filepath = path + os.sep + filename
... | 0 | 0 | 0 | 550 | 0 | 0 | 0 | -3 | 79 |
5774603052646b867d0ece09945cf3168a777ef3 | 6,829 | py | Python | varvault/vaultflags.py | data-ductus/varvault | d7f489eb0501ec2d931d6f62717d69b6aded8d95 | [
"Apache-2.0"
] | 1 | 2021-11-12T17:23:08.000Z | 2021-11-12T17:23:08.000Z | varvault/vaultflags.py | data-ductus/varvault | d7f489eb0501ec2d931d6f62717d69b6aded8d95 | [
"Apache-2.0"
] | null | null | null | varvault/vaultflags.py | data-ductus/varvault | d7f489eb0501ec2d931d6f62717d69b6aded8d95 | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
| 54.198413 | 196 | 0.728804 | from __future__ import annotations
class VaultFlags(str):
"""Class that represents flags that may be used for a vaulted
function to tweak the behavior of the vaulted function."""
_RETURN_VALUES_CANNOT_BE_NONE = "return_values_cannot_be_none"
_PERMIT_MODIFICATIONS = "permit_modifications"
_INPUT_K... | 0 | 5,088 | 0 | 1,682 | 0 | 0 | 0 | 0 | 23 |
bc8be470b12ee419990e84f9fcd0b87dc75fcfe0 | 5,761 | py | Python | openpyxlzip/worksheet/tests/test_header.py | ankitJoshi03/openpyxlzip | f3b8aa2f80f9d8bc31ce5fcf05c822d88d2ff647 | [
"MIT"
] | null | null | null | openpyxlzip/worksheet/tests/test_header.py | ankitJoshi03/openpyxlzip | f3b8aa2f80f9d8bc31ce5fcf05c822d88d2ff647 | [
"MIT"
] | null | null | null | openpyxlzip/worksheet/tests/test_header.py | ankitJoshi03/openpyxlzip | f3b8aa2f80f9d8bc31ce5fcf05c822d88d2ff647 | [
"MIT"
] | null | null | null | # Copyright (c) 2010-2020 openpyxlzip
| 30.643617 | 211 | 0.623329 | # Copyright (c) 2010-2020 openpyxlzip
import pytest
from openpyxlzip.xml.functions import fromstring, tostring
from openpyxlzip.tests.helper import compare_xml
def test_split_into_parts():
from .. header_footer import _split_string
headers = _split_string("&Ltest header")
assert headers['left'] == "tes... | 0 | 743 | 0 | 3,581 | 0 | 1,035 | 0 | 56 | 298 |
17819873bd1910b8dc14068f78b0c4b384601523 | 103 | py | Python | nodewox/thing/__init__.py | nupha/nodewox-pything | d67060e4332f7af122e221735b25cddcc82a5161 | [
"MIT"
] | null | null | null | nodewox/thing/__init__.py | nupha/nodewox-pything | d67060e4332f7af122e221735b25cddcc82a5161 | [
"MIT"
] | null | null | null | nodewox/thing/__init__.py | nupha/nodewox-pything | d67060e4332f7af122e221735b25cddcc82a5161 | [
"MIT"
] | null | null | null | # topic prefix
NX_PREFIX = ""
| 14.714286 | 46 | 0.786408 | # topic prefix
NX_PREFIX = ""
from thing import Thing
from channel import MaleChannel, FemaleChannel
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 27 | 45 |
feaf4fbc50c47643538f35d663c3dfe887ea809a | 570 | py | Python | update_existing_uploaders.py | Ratheronfire/YouTube-Playlist-Manager | ac3c51201b65432ce5f6e7d384eed9f828b9547d | [
"MIT"
] | 2 | 2016-10-19T17:07:43.000Z | 2017-09-15T01:01:29.000Z | update_existing_uploaders.py | Ratheronfire/YouTube-Playlist-Manager | ac3c51201b65432ce5f6e7d384eed9f828b9547d | [
"MIT"
] | null | null | null | update_existing_uploaders.py | Ratheronfire/YouTube-Playlist-Manager | ac3c51201b65432ce5f6e7d384eed9f828b9547d | [
"MIT"
] | 1 | 2021-04-03T17:17:24.000Z | 2021-04-03T17:17:24.000Z | __author__ = "David"
from youtube_playlist import load_config
config = load_config()
if __name__ == "__main__":
update_existing_uploaders() | 25.909091 | 87 | 0.7 | __author__ = "David"
import json
from find_account_playlists import find_account_playlists
from youtube_playlist import load_config
config = load_config()
def update_existing_uploaders():
with open(config["video_prefs_path"], "r") as prefs:
prefs_json = json.load(prefs)
for uploader in prefs_json["... | 0 | 0 | 0 | 0 | 0 | 329 | 0 | 26 | 68 |
83171a9a57448cb013f3719bfa8bd196460dd176 | 571 | py | Python | challenge(december)/tricky_dice2.py | tkanicka/python_learning | 67fc0e8ca6333571f8b0d30f835b759d670a8643 | [
"Unlicense"
] | null | null | null | challenge(december)/tricky_dice2.py | tkanicka/python_learning | 67fc0e8ca6333571f8b0d30f835b759d670a8643 | [
"Unlicense"
] | null | null | null | challenge(december)/tricky_dice2.py | tkanicka/python_learning | 67fc0e8ca6333571f8b0d30f835b759d670a8643 | [
"Unlicense"
] | null | null | null |
import matplotlib.pyplot as plt
import csv
file = open("tricky.csv")
reader = csv.reader(file)
data = []
for row in reader:
data.append(row)
data = make_int(data)
data10 = []
for x in range(1, len(data), 3):
data10.append(data[x])
plt.hist(data10, 6, rwidth=0.9)
plt.grid(True)
plt.xlabel("values ")
plt.yl... | 16.794118 | 48 | 0.654991 |
import matplotlib.pyplot as plt
import csv
def make_int(data):
final_data = []
for x in data:
for element in x:
final_data.append(int(element))
return final_data
file = open("tricky.csv")
reader = csv.reader(file)
data = []
for row in reader:
data.append(row)
data = make_int(da... | 0 | 0 | 0 | 0 | 0 | 130 | 0 | 0 | 23 |
487ca86d4aa7afbe6563ea169b1a738e5afa6a45 | 61 | py | Python | src/mud/_study/relative_imports/packages/subpackage2/sub2_subpackage1/test21.py | Martakan/YUMS | 57c8c02eac70a62233f9a48d78becb1a25bed64e | [
"MIT"
] | null | null | null | src/mud/_study/relative_imports/packages/subpackage2/sub2_subpackage1/test21.py | Martakan/YUMS | 57c8c02eac70a62233f9a48d78becb1a25bed64e | [
"MIT"
] | null | null | null | src/mud/_study/relative_imports/packages/subpackage2/sub2_subpackage1/test21.py | Martakan/YUMS | 57c8c02eac70a62233f9a48d78becb1a25bed64e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*- | 15.25 | 25 | 0.52459 | # -*- coding: utf-8 -*-
def run():
print("Fired test21") | 0 | 0 | 0 | 0 | 0 | 15 | 0 | 0 | 23 |
7bdb8d86ac5976c01cf72aa52d19ca4934f1e0c8 | 396 | py | Python | submissions/keyence2019/a.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | 1 | 2021-05-10T01:16:28.000Z | 2021-05-10T01:16:28.000Z | submissions/keyence2019/a.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | 3 | 2021-05-11T06:14:15.000Z | 2021-06-19T08:18:36.000Z | submissions/keyence2019/a.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | null | null | null | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
from collections import Counter
s = readline().rstrip().decode()
check = ['1', '4', '7', '9']
counter = list(Counter(list(s)))
for k in counter:
if k in check:
... | 20.842105 | 38 | 0.669192 | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
from collections import Counter
s = readline().rstrip().decode()
check = ['1', '4', '7', '9']
counter = list(Counter(list(s)))
for k in counter:
if k in check:
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
706511e907e707e79dc2e3b66d1650d57e2c62ec | 5,898 | py | Python | pipeline/setup.py | NVIDIA-AI-IOT/centernet_kinect | 92438e9f1469d1d8deffb33569068d2b635f99b6 | [
"MIT"
] | 17 | 2020-12-21T04:10:16.000Z | 2022-02-03T18:12:42.000Z | pipeline/setup.py | NVIDIA-AI-IOT/centernet_kinect | 92438e9f1469d1d8deffb33569068d2b635f99b6 | [
"MIT"
] | null | null | null | pipeline/setup.py | NVIDIA-AI-IOT/centernet_kinect | 92438e9f1469d1d8deffb33569068d2b635f99b6 | [
"MIT"
] | 3 | 2020-12-24T02:55:31.000Z | 2021-05-22T02:27:21.000Z | '''
Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, ... | 45.022901 | 460 | 0.652933 | '''
Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, ... | 0 | 0 | 0 | 4,313 | 0 | 0 | 0 | 129 | 178 |
744953a33d13dce6a8e313b4de8e7bbc4605a9b1 | 1,954 | py | Python | main.py | tvirus-01/scraping-seekingalpha | 0dedd14195a9f4f354475a3cbe1728325cb45b33 | [
"MIT"
] | 1 | 2021-05-18T16:27:06.000Z | 2021-05-18T16:27:06.000Z | main.py | tvirus-01/scraping-seekingalpha | 0dedd14195a9f4f354475a3cbe1728325cb45b33 | [
"MIT"
] | null | null | null | main.py | tvirus-01/scraping-seekingalpha | 0dedd14195a9f4f354475a3cbe1728325cb45b33 | [
"MIT"
] | null | null | null | from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from bs4 import BeautifulSoup
import time
import csv
root_url = "https://seekingalpha.com"
query = "stock repurchase program"
url = "https://seekingalpha.com/search?q="+query.replcae(" ", "+")
chrome_driver_path = "/usr/lib/chromium-b... | 30.53125 | 153 | 0.680655 | from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from bs4 import BeautifulSoup
import requests
import time
import os
import csv
root_url = "https://seekingalpha.com"
query = "stock repurchase program"
url = "https://seekingalpha.com/search?q="+query.replcae(" ", "+")
chrome_driver_p... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -18 | 44 |
f9f7c2bceb6ed21639c221add80a6d0ee1cb19df | 1,265 | py | Python | unit1/problem_sets/5_1/solution/5_1_2f_2g.py | ga-at-socs/pa-2021-code | 6ba504ad7725d7248f6792975cb20cf3949b2418 | [
"MIT"
] | null | null | null | unit1/problem_sets/5_1/solution/5_1_2f_2g.py | ga-at-socs/pa-2021-code | 6ba504ad7725d7248f6792975cb20cf3949b2418 | [
"MIT"
] | null | null | null | unit1/problem_sets/5_1/solution/5_1_2f_2g.py | ga-at-socs/pa-2021-code | 6ba504ad7725d7248f6792975cb20cf3949b2418 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Practical Algorthns
Problem set: 5.1 - Working with Data Structures
2f) Write a function join which, given two lists, it returns a list in which each element
is a list of two elements, one from each of the given lists. For example:
join( [1,2,3] , ["a","b","c"] )
returns: [ [1, ... | 19.765625 | 91 | 0.622134 | # -*- coding: utf-8 -*-
"""
Practical Algorthns
Problem set: 5.1 - Working with Data Structures
2f) Write a function join which, given two lists, it returns a list in which each element
is a list of two elements, one from each of the given lists. For example:
join( [1,2,3] , ["a","b","c"] )
returns: [ [1, ... | 0 | 0 | 0 | 0 | 0 | 361 | 0 | 0 | 44 |
80d5a98134a66c4796a3d7b2239c8c273d6316b4 | 31,563 | py | Python | support.py | belikor/lbrytools | 1f2e645abfb244ca89a0656737588e680bdc9054 | [
"MIT"
] | 9 | 2021-05-28T11:24:38.000Z | 2022-03-20T05:48:57.000Z | support.py | belikor/lbrytools | 1f2e645abfb244ca89a0656737588e680bdc9054 | [
"MIT"
] | 13 | 2021-05-18T21:42:50.000Z | 2022-02-21T07:19:28.000Z | support.py | belikor/lbrytools | 1f2e645abfb244ca89a0656737588e680bdc9054 | [
"MIT"
] | 2 | 2021-08-12T15:12:18.000Z | 2021-09-25T10:33:34.000Z | #!/usr/bin/env python3
# --------------------------------------------------------------------------- #
# The MIT License (MIT) #
# #
# Copyright (c) 2021 Eliud Cabrera Castillo <e.cabrera-ca... | 36.489017 | 79 | 0.573773 | #!/usr/bin/env python3
# --------------------------------------------------------------------------- #
# The MIT License (MIT) #
# #
# Copyright (c) 2021 Eliud Cabrera Castillo <e.cabrera-ca... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
47ac51c5e60723f4204bc0b14f14ddbff3dad465 | 364 | py | Python | mvall.py | efe3535/pythonexamples | 676aeb5d730dc0fc364083fccbd8c241de5bdc0a | [
"CC0-1.0"
] | 1 | 2020-11-30T06:53:06.000Z | 2020-11-30T06:53:06.000Z | mvall.py | efeduino/pythonexamples | 676aeb5d730dc0fc364083fccbd8c241de5bdc0a | [
"CC0-1.0"
] | 2 | 2021-05-16T06:34:36.000Z | 2021-06-05T16:44:15.000Z | mvall.py | efeduino/pythonexamples | 676aeb5d730dc0fc364083fccbd8c241de5bdc0a | [
"CC0-1.0"
] | 1 | 2021-06-04T12:17:31.000Z | 2021-06-04T12:17:31.000Z | import os, shutil, send2trash
fname = __file__+"_folder"
if(not os.path.isdir(fname)):
os.system("mkdir "+fname)
try:
for dosya in os.listdir():
if not dosya.endswith(".py"):
shutil.move(dosya,fname)
send2trash.send2trash(fname)
except shutil.Error:
print("Bu Sc... | 28 | 62 | 0.637363 | import os,shutil,send2trash
fname = __file__+"_folder"
if(not os.path.isdir(fname)):
os.system("mkdir "+fname)
try:
for dosya in os.listdir():
if not dosya.endswith(".py"):
shutil.move(dosya,fname)
send2trash.send2trash(fname)
except shutil.Error:
print("Bu Scri... | 16 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 0 |
fb516681f961d46f12abbd22c1f9ec3950bdad46 | 4,454 | py | Python | main.py | ilwindcunha/Assignment2 | c7fbe6e568dc5dd7ea047a1d5dcfb999b2dc954d | [
"MIT"
] | null | null | null | main.py | ilwindcunha/Assignment2 | c7fbe6e568dc5dd7ea047a1d5dcfb999b2dc954d | [
"MIT"
] | null | null | null | main.py | ilwindcunha/Assignment2 | c7fbe6e568dc5dd7ea047a1d5dcfb999b2dc954d | [
"MIT"
] | null | null | null | from flask import Flask
import pypyodbc
#import sqlite3 as sql
# import pyodbc
app = Flask(__name__)
##################
server = 'ilwin.database.windows.net'
database = 'ilwin'
username = 'ilwin'
password = 'esxi@S5n'
driver = '{SQL Server}'
cnxn = pypyodbc.connect("Driver={ODBC Driver 13 for SQL Server};"
... | 32.043165 | 151 | 0.588235 | from flask import Flask, render_template, request, redirect, url_for, send_from_directory
import pypyodbc
#import sqlite3 as sql
# import pyodbc
from datetime import datetime
from datetime import timedelta
import csv
import os
app = Flask(__name__)
import sqlite3
##################
server = 'ilwin.database.windows.... | 3 | 1,996 | 0 | 0 | 0 | 0 | 0 | 53 | 226 |
a3376f4f9d3aa0dfa95b8fc41b1d7ddae2f1e63e | 9,098 | py | Python | arm64/Arm64Preprocessor.py | alibaba-edu/Driver-Security-Analyzer | 0c562975c1477da8d65a14eb872a981f709d6b94 | [
"MIT"
] | 35 | 2020-10-27T02:53:06.000Z | 2022-02-09T09:19:36.000Z | arm64/Arm64Preprocessor.py | alibaba-edu/Driver-Security-Analyzer | 0c562975c1477da8d65a14eb872a981f709d6b94 | [
"MIT"
] | null | null | null | arm64/Arm64Preprocessor.py | alibaba-edu/Driver-Security-Analyzer | 0c562975c1477da8d65a14eb872a981f709d6b94 | [
"MIT"
] | 9 | 2020-10-27T02:36:25.000Z | 2022-03-08T08:08:09.000Z | # Copyright (C) 2020 Alibaba Group Holding Limited
idaapi.require("Arm64Utils")
import tagged_pointers
print "[+] Arm64Preprocessor loaded"
| 33.821561 | 169 | 0.631677 | # Copyright (C) 2020 Alibaba Group Holding Limited
from Arm64Utils import *
idaapi.require("Arm64Utils")
import tagged_pointers
def untagAllPointers():
tagged_pointers.untag_pointers()
def healFunctionsInTextSeg(segStartEA):
textSegEA = segStartEA
textSegStartEA = SegStart(textSegEA)
textSegEndEA = S... | 0 | 0 | 0 | 0 | 0 | 8,364 | 0 | 3 | 575 |
67e8fbc27c88082836c375f36d6d95986d91046e | 901 | py | Python | tudo/ex084.py | Ramon-Erik/Exercicios-Python | 158a7f1846dd3d486aa0517fa337d46d73aab649 | [
"MIT"
] | 1 | 2021-07-08T00:35:57.000Z | 2021-07-08T00:35:57.000Z | tudo/ex084.py | Ramon-Erik/Exercicios-Python | 158a7f1846dd3d486aa0517fa337d46d73aab649 | [
"MIT"
] | null | null | null | tudo/ex084.py | Ramon-Erik/Exercicios-Python | 158a7f1846dd3d486aa0517fa337d46d73aab649 | [
"MIT"
] | null | null | null | cads = [[], [], []]
soma = 0
while True:
print('-=-' * 16)
nome = str(input('Nome: ')).strip().title()
cads[0].append(nome)
peso = float(input('Peso: '))
cads[1].append(peso)
soma += peso
m = max(cads[1])
if peso == m:
cads[2].append(nome)
resp = str(input('Co... | 20.477273 | 65 | 0.527192 | cads = [[], [], []]
soma = 0
while True:
print('-=-' * 16)
nome = str(input('Nome: ')).strip().title()
cads[0].append(nome)
peso = float(input('Peso: '))
cads[1].append(peso)
soma += peso
m = max(cads[1])
if peso == m:
cads[2].append(nome)
resp = str(input('Co... | 6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bfcf77b605010ec1d948fcb8320574ae9bd77c16 | 780 | py | Python | apytl/example/example_bars.py | anadolski/apytl | eab20a143e73aef2187c552021ed4e02744f39fb | [
"BSD-3-Clause"
] | null | null | null | apytl/example/example_bars.py | anadolski/apytl | eab20a143e73aef2187c552021ed4e02744f39fb | [
"BSD-3-Clause"
] | 1 | 2019-05-24T16:13:37.000Z | 2019-05-24T18:17:26.000Z | apytl/example/example_bars.py | anadolski/apytl | eab20a143e73aef2187c552021ed4e02744f39fb | [
"BSD-3-Clause"
] | null | null | null | import time
import apytl
NTOTAL = 25
WAIT = 0.01
TEST_BAR = apytl.Bar()
tstring = 'Are these octothorpes?'
vs = 'V'*len(tstring)
print(tstring)
print(vs)
for ind, val in enumerate(range(NTOTAL)):
TEST_BAR.drawbar(ind, NTOTAL)
time.sleep(WAIT)
print('')
for emojikey, emojicode in TEST_BAR._EMOJI.items():
... | 21.666667 | 53 | 0.670513 | import time
import apytl
NTOTAL = 25
WAIT = 0.01
TEST_BAR = apytl.Bar()
tstring = 'Are these octothorpes?'
vs = 'V'*len(tstring)
print(tstring)
print(vs)
for ind, val in enumerate(range(NTOTAL)):
TEST_BAR.drawbar(ind, NTOTAL)
time.sleep(WAIT)
print('')
for emojikey, emojicode in TEST_BAR._EMOJI.items():
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6a56960a94ea3a094b243d5299fbc6f8d5456815 | 5,423 | py | Python | bala7/settings/base.py | Ibrahem3amer/bala7 | 70638c121ea85ff0e6a650c5f2641b0b3b04d6d0 | [
"Apache-2.0"
] | null | null | null | bala7/settings/base.py | Ibrahem3amer/bala7 | 70638c121ea85ff0e6a650c5f2641b0b3b04d6d0 | [
"Apache-2.0"
] | null | null | null | bala7/settings/base.py | Ibrahem3amer/bala7 | 70638c121ea85ff0e6a650c5f2641b0b3b04d6d0 | [
"Apache-2.0"
] | null | null | null | import os
import json
from django.core.exceptions import ImproperlyConfigured
path = os.path.dirname(__file__) + '/secrets.json'
with open(path) as f:
secrets = json.loads(f.read())
def get_secret(var_name):
"""Get the environment variable or return exception."""
try:
return secrets[var_name]
... | 30.296089 | 91 | 0.7234 | import os
import json
from django.core.exceptions import ImproperlyConfigured
path = os.path.dirname(__file__) + '/secrets.json'
with open(path) as f:
secrets = json.loads(f.read())
def get_secret(var_name):
"""Get the environment variable or return exception."""
try:
return secrets[var_name]
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0a5fa46c6835ee4a01da2132a4783945ce35e4fc | 7,116 | py | Python | pycryptoki/mechanism/aes.py | LudovicRousseau/pycryptoki | c9b4dbafa3e582071bd1487faa409e8999c72ee5 | [
"Apache-2.0"
] | 24 | 2016-08-17T13:52:07.000Z | 2019-12-26T17:16:39.000Z | pycryptoki/mechanism/aes.py | LudovicRousseau/pycryptoki | c9b4dbafa3e582071bd1487faa409e8999c72ee5 | [
"Apache-2.0"
] | 8 | 2020-08-06T15:19:46.000Z | 2022-03-25T17:52:00.000Z | pycryptoki/mechanism/aes.py | LudovicRousseau/pycryptoki | c9b4dbafa3e582071bd1487faa409e8999c72ee5 | [
"Apache-2.0"
] | 12 | 2016-11-22T05:43:18.000Z | 2020-02-12T17:45:05.000Z | """
AES-specific mechanism implementations.
"""
import logging
LOG = logging.getLogger(__name__)
| 33.408451 | 92 | 0.631535 | """
AES-specific mechanism implementations.
"""
import logging
from ctypes import c_void_p, cast, pointer, sizeof
from . import Mechanism
from ..attributes import to_byte_array
from ..cryptoki import (
CK_ULONG,
CK_BYTE,
CK_BYTE_PTR,
CK_AES_XTS_PARAMS,
CK_AES_GCM_PARAMS,
CK_KEY_DERIVATION_STRIN... | 0 | 0 | 0 | 6,511 | 0 | 0 | 0 | 250 | 250 |
0e4ad917c80d49827759d8d511315294511cabb6 | 590 | py | Python | python/src/main/python/projecteuler/problem59.py | jaredsburrows/Project-Euler | 032b60140ee33166df57e8723a532dc4bd7b0faf | [
"Apache-2.0"
] | 56 | 2016-04-21T13:17:55.000Z | 2022-03-13T16:32:37.000Z | python/src/main/python/projecteuler/problem59.py | jaredsburrows/Project-Euler | 032b60140ee33166df57e8723a532dc4bd7b0faf | [
"Apache-2.0"
] | 4 | 2016-06-09T04:33:18.000Z | 2019-06-09T22:44:14.000Z | python/src/main/python/projecteuler/problem59.py | jaredsburrows/Project-Euler | 032b60140ee33166df57e8723a532dc4bd7b0faf | [
"Apache-2.0"
] | 12 | 2016-11-30T19:09:17.000Z | 2022-01-26T22:35:34.000Z | #!/usr/bin/python
"""
XOR decryption
https://projecteuler.net/problem=59
"""
if __name__ == "__main__":
main()
| 21.071429 | 72 | 0.542373 | #!/usr/bin/python
"""
XOR decryption
https://projecteuler.net/problem=59
"""
import itertools
import re
import string
def main():
cipher_file = open("cipher1.txt").read().split(",")
for key in itertools.permutations(string.ascii_lowercase[:26], r=3):
temp, t, total = "", "", 0
for i in range... | 0 | 0 | 0 | 0 | 0 | 407 | 0 | -25 | 90 |
acd978b8b6cc323714b50265705269bc4de7743e | 639 | py | Python | prototypes/word-embeddings.py | Kandy16/constituency-parsing | 8afc3997bc5fd70972a720abd6d34b69e9a901f9 | [
"Apache-2.0"
] | null | null | null | prototypes/word-embeddings.py | Kandy16/constituency-parsing | 8afc3997bc5fd70972a720abd6d34b69e9a901f9 | [
"Apache-2.0"
] | null | null | null | prototypes/word-embeddings.py | Kandy16/constituency-parsing | 8afc3997bc5fd70972a720abd6d34b69e9a901f9 | [
"Apache-2.0"
] | 1 | 2019-02-11T08:20:25.000Z | 2019-02-11T08:20:25.000Z | import tensorflow as tf
import pandas as pd
import os
from timeit import default_timer as timer
start = timer()
dirname = os.getcwd()
dirname = os.path.dirname(dirname)
dataset_path = os.path.join(dirname, 'datasets/')
print(dataset_path)
gloveVectors = pd.read_csv(dataset_path+'glove.42B.10d.txt', sep=' ', header... | 25.56 | 105 | 0.751174 | import tensorflow as tf
import pandas as pd
import os
from timeit import default_timer as timer
start = timer()
dirname = os.getcwd()
dirname = os.path.dirname(dirname)
dataset_path = os.path.join(dirname, 'datasets/')
print(dataset_path)
gloveVectors = pd.read_csv(dataset_path+'glove.42B.10d.txt', sep=' ', header... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a8d3d534ae21ec24ca1f1945d473017afdc4ef82 | 2,436 | py | Python | rastervision/v2/core/runner/aws_batch_runner.py | carderne/raster-vision | 915fbcd3263d8f2193e65c2cd0eb53e050a47a01 | [
"Apache-2.0"
] | 1 | 2019-11-07T10:02:23.000Z | 2019-11-07T10:02:23.000Z | rastervision/v2/core/runner/aws_batch_runner.py | carderne/raster-vision | 915fbcd3263d8f2193e65c2cd0eb53e050a47a01 | [
"Apache-2.0"
] | null | null | null | rastervision/v2/core/runner/aws_batch_runner.py | carderne/raster-vision | 915fbcd3263d8f2193e65c2cd0eb53e050a47a01 | [
"Apache-2.0"
] | null | null | null | import logging
log = logging.getLogger(__name__)
AWS_BATCH = 'aws_batch'
| 29 | 79 | 0.554598 | import uuid
import logging
from rastervision.v2.core import _rv_config
log = logging.getLogger(__name__)
AWS_BATCH = 'aws_batch'
def submit_job(cmd,
debug=False,
profile=False,
attempts=5,
parent_job_ids=None,
num_array_jobs=None,
... | 0 | 0 | 0 | 816 | 0 | 1,441 | 0 | 12 | 91 |
558d4dfa0486b881426a83b647644402d349fd91 | 113 | py | Python | yc302/1579.py | c-yan/yukicoder | cdbbd65402177225dd989df7fe01f67908484a69 | [
"MIT"
] | null | null | null | yc302/1579.py | c-yan/yukicoder | cdbbd65402177225dd989df7fe01f67908484a69 | [
"MIT"
] | null | null | null | yc302/1579.py | c-yan/yukicoder | cdbbd65402177225dd989df7fe01f67908484a69 | [
"MIT"
] | null | null | null | A, B = map(int, input().split())
if min(A, B) % 2 == 1 and abs(A - B) <= 1:
print('Q')
else:
print('P')
| 16.142857 | 42 | 0.460177 | A, B = map(int, input().split())
if min(A, B) % 2 == 1 and abs(A - B) <= 1:
print('Q')
else:
print('P')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cb279d949d6fcac99c07cc8459d9bd3f789d3d08 | 14,218 | py | Python | src/tests/unit_tests.py | juiceboard/juiceboard | 4bf5d3105a25ad333ed328bbff01dfcf2452b94c | [
"MIT"
] | null | null | null | src/tests/unit_tests.py | juiceboard/juiceboard | 4bf5d3105a25ad333ed328bbff01dfcf2452b94c | [
"MIT"
] | null | null | null | src/tests/unit_tests.py | juiceboard/juiceboard | 4bf5d3105a25ad333ed328bbff01dfcf2452b94c | [
"MIT"
] | null | null | null | # Unit tests for the Juiceboard app using the python unittest framework
import sys
# Change working dir to juiceboard src folder
sys.path.append("..\\juiceboard\\")
import unittest
import subprocess
# Source modules
TEST_ID_INT = 170841655
TEST_ID_REG = 168754280
TEST_FEEDBACK_NONE = 171948923
TEST_... | 37.122715 | 137 | 0.608173 | # Unit tests for the Juiceboard app using the python unittest framework
import sys
# Change working dir to juiceboard src folder
sys.path.append("..\\juiceboard\\")
import unittest
import subprocess
import dash
# Source modules
from database_helper import *
from visualizer_helper import *
from juicebo... | 0 | 0 | 0 | 13,220 | 0 | 0 | 0 | 11 | 367 |
0835d0020a30d7003e4ac72d6ea9653330e69958 | 4,905 | py | Python | network-design-qap/network-design-qap-gurobi/a-frieze-yadegar-qap.py | Grieverwzn/network-design-qap | 6d1a55c8d3e5dd9a97bffa7b3e8de7391a3a0843 | [
"MIT"
] | 1 | 2021-04-16T07:03:32.000Z | 2021-04-16T07:03:32.000Z | network-design-qap/network-design-qap-gurobi/a-frieze-yadegar-qap.py | Grieverwzn/network-design-qap | 6d1a55c8d3e5dd9a97bffa7b3e8de7391a3a0843 | [
"MIT"
] | null | null | null | network-design-qap/network-design-qap-gurobi/a-frieze-yadegar-qap.py | Grieverwzn/network-design-qap | 6d1a55c8d3e5dd9a97bffa7b3e8de7391a3a0843 | [
"MIT"
] | 1 | 2021-04-16T07:03:33.000Z | 2021-04-16T07:03:33.000Z | import pandas as pd
import os
R_A_FY_QAP=0 # RDD lower bound or original FY model (1) 1: RDD lowerbound, 0: A-FY-QAP
cwd = r'..\NEOS_6'
link_df=pd.read_csv(os.path.join(cwd,'input_link.csv'))
agent_df=pd.read_csv(os.path.join(cwd,'input_agent.csv'))
node_df=pd.read_csv(os.path.join(cwd,'input_node.csv'))
agent_df['o... | 42.652174 | 166 | 0.712946 | from gurobipy import *
import numpy as np
import pandas as pd
import os
R_A_FY_QAP=0 # RDD lower bound or original FY model (1) 1: RDD lowerbound, 0: A-FY-QAP
cwd = r'..\NEOS_6'
link_df=pd.read_csv(os.path.join(cwd,'input_link.csv'))
agent_df=pd.read_csv(os.path.join(cwd,'input_agent.csv'))
node_df=pd.read_csv(os.pat... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 44 |
899be7db3080a3db690e051a325a16fa2a3887e0 | 9,075 | py | Python | baselines/markov.py | Asichurter/APISeqFewShot | b4b7843da1f53cdc1d1711537c31305e7d5c6555 | [
"MIT"
] | 8 | 2020-05-14T19:29:41.000Z | 2022-03-09T03:29:51.000Z | baselines/markov.py | Asichurter/APISeqFewShot | b4b7843da1f53cdc1d1711537c31305e7d5c6555 | [
"MIT"
] | null | null | null | baselines/markov.py | Asichurter/APISeqFewShot | b4b7843da1f53cdc1d1711537c31305e7d5c6555 | [
"MIT"
] | null | null | null | from utils.manager import PathManager
from baselines.alignment import apiCluster
k = 10
n = 10
qk = 5
N = 20
#####################################################
# json
# npy
#####################################################
#####################################################
#
############################... | 34.505703 | 110 | 0.57697 | import numpy as np
from sklearn.cluster import KMeans
from tqdm import tqdm
import matplotlib.pyplot as plt
from preliminaries.embedding import aggregateApiSequences
from utils.file import loadJson, dumpIterable, dumpJson
from utils.manager import PathManager
from baselines.alignment import apiCluster
from utils.timer... | 957 | 0 | 0 | 0 | 0 | 5,792 | 0 | 151 | 379 |
afd492f0c735a05c9ab88d766d7bcece17835746 | 472 | py | Python | setup.py | ribalba/markdown.linktarget | 6e3f3d2bc4f83a6380e9686e15c50423df05f058 | [
"Apache-2.0"
] | 1 | 2016-05-31T04:46:49.000Z | 2016-05-31T04:46:49.000Z | setup.py | ribalba/markdown.linktarget | 6e3f3d2bc4f83a6380e9686e15c50423df05f058 | [
"Apache-2.0"
] | null | null | null | setup.py | ribalba/markdown.linktarget | 6e3f3d2bc4f83a6380e9686e15c50423df05f058 | [
"Apache-2.0"
] | null | null | null | from distutils.core import setup
setup(
name='MarkdownLinkTarget',
version='0.1.0',
packages=['MarkdownLinkTarget',],
license='Apache License 2.0',
long_description=open('README.txt').read(),
url='https://github.com/ribalba/markdown.linktarget',
description='Adds a taget="_blank" attribute ... | 29.5 | 76 | 0.667373 | from distutils.core import setup
setup(
name='MarkdownLinkTarget',
version='0.1.0',
packages=['MarkdownLinkTarget',],
license='Apache License 2.0',
long_description=open('README.txt').read(),
url='https://github.com/ribalba/markdown.linktarget',
description='Adds a taget="_blank" attribute ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
052c2f88cc34a275fae1ed9d016c2100ba77eec0 | 1,899 | py | Python | back_projection.py | Desaiakshata/Camera-Calibration-for-2D-to-3D-transformation | 0ec0d8574f345b9a83c2efb66b1faf895c71b7fe | [
"MIT"
] | null | null | null | back_projection.py | Desaiakshata/Camera-Calibration-for-2D-to-3D-transformation | 0ec0d8574f345b9a83c2efb66b1faf895c71b7fe | [
"MIT"
] | null | null | null | back_projection.py | Desaiakshata/Camera-Calibration-for-2D-to-3D-transformation | 0ec0d8574f345b9a83c2efb66b1faf895c71b7fe | [
"MIT"
] | null | null | null | import scipy.linalg as lin
import numpy as np
for i in range(0,2):
#camera intrinsic parameters
Fx=Fy=2469
Cx=1228.876620888020
Cy=1012.976060035710
K = [[ Fx, 0., Cx],
[ 0., Fy, Cy],
[ 0., 0., 1. ]]
K = np... | 30.629032 | 72 | 0.560295 | import matplotlib.pyplot as plt
import scipy.linalg as lin
import numpy as np
import cv2
def mouse_right_click():
#the [x, y] for each right-click event will be stored here
global right_clicks
right_clicks = list()
global count
count=0
#this function will be called whenever the mouse... | 0 | 0 | 0 | 0 | 0 | 971 | 0 | -1 | 71 |
f811dbd5ddde63e759783de042f5906da3c98bd9 | 917 | py | Python | utilities/saveOnlineFFSSN.py | Jbwasse2/snn-rl | 29b040655f432bd390bc9d835b86cbfdf1a622e4 | [
"MIT"
] | 68 | 2015-04-16T11:14:31.000Z | 2022-03-11T07:43:51.000Z | utilities/saveOnlineFFSSN.py | Jbwasse2/snn-rl | 29b040655f432bd390bc9d835b86cbfdf1a622e4 | [
"MIT"
] | 6 | 2015-11-24T04:53:57.000Z | 2019-10-21T02:00:15.000Z | utilities/saveOnlineFFSSN.py | Jbwasse2/snn-rl | 29b040655f432bd390bc9d835b86cbfdf1a622e4 | [
"MIT"
] | 25 | 2015-12-27T10:04:53.000Z | 2021-01-03T03:25:18.000Z | #references: http://stackoverflow.com/questions/3430372/how-to-get-full-path-of-current-files-directory-in-python
# http://www.tutorialspoint.com/python/python_reg_expressions.htm
import IPython.nbformat.current as nbf
from pygments import highlight
from pygments.lexers import get_lexer_by_name
from pygments.formatter... | 27.787879 | 113 | 0.747001 | #references: http://stackoverflow.com/questions/3430372/how-to-get-full-path-of-current-files-directory-in-python
# http://www.tutorialspoint.com/python/python_reg_expressions.htm
import IPython.nbformat.current as nbf
from pygments import highlight
from pygments.lexers import get_lexer_by_name
from pygments.formatter... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1ae4c1761befa34c2f40aae5177ca9f17a9239b8 | 2,394 | py | Python | glassnode_files_organizer.py | locsta/Glassnode-Studio-Scraper | 59e399dc01f8d68a61183ab741b4e451215a5e1d | [
"MIT"
] | null | null | null | glassnode_files_organizer.py | locsta/Glassnode-Studio-Scraper | 59e399dc01f8d68a61183ab741b4e451215a5e1d | [
"MIT"
] | null | null | null | glassnode_files_organizer.py | locsta/Glassnode-Studio-Scraper | 59e399dc01f8d68a61183ab741b4e451215a5e1d | [
"MIT"
] | null | null | null | import os
if __name__ == '__main__':
# execute only if run as the entry point into the program
glassnode_files_organizer() | 35.205882 | 113 | 0.555556 | from os import listdir
from os.path import isfile, join
import os
import json
import re
from pprint import pprint
import pandas as pd
import os
import errno
def glassnode_files_organizer():
def make_sure_path_exists(path):
try:
os.makedirs(path)
except OSError as exception:
... | 0 | 0 | 0 | 0 | 0 | 2,090 | 0 | -29 | 199 |
2dd98fd972747ae0e3d7f703aea6c7de0a30aa44 | 6,929 | py | Python | bbl2html.py | kbehouse/bbl2html_bb2docx | ae46ecefaacf3cb6374be127d6ef293831691f91 | [
"Apache-2.0"
] | null | null | null | bbl2html.py | kbehouse/bbl2html_bb2docx | ae46ecefaacf3cb6374be127d6ef293831691f91 | [
"Apache-2.0"
] | null | null | null | bbl2html.py | kbehouse/bbl2html_bb2docx | ae46ecefaacf3cb6374be127d6ef293831691f91 | [
"Apache-2.0"
] | null | null | null | # coding=UTF-8
#!/usr/bin/python
import codecs
bbl = codecs.open('ieee.bbl','r','utf-8')
M_NONE = 0
M_BIBITEM = 1
M_AUTHOR = 2
M_TITLE = 3
M_PUBLISH = 4
bibitem_block = False
read_author = False
mode = M_NONE
refer_ary = []
lines = bbl.readlines()
print(len(lines))
for idx, line in enumerate(lines):
... | 33.47343 | 105 | 0.525617 | # coding=UTF-8
#!/usr/bin/python
from latin import replace_utf8
import codecs
bbl = codecs.open('ieee.bbl','r','utf-8')
class Refer:
def __init__(self):
self.author=''
self.title =''
self.publish=''
self.time=''
self.vol = 0
self.iss = 0
self.pp_s = 0 ## pp... | 15 | 0 | 0 | 4,816 | 0 | 0 | 0 | 9 | 46 |
a86649dc4e26d8d3e85437d2d46a2140fba612ef | 1,096 | py | Python | MangAdventure/widgets.py | tomenjerry/mangaadv | 931d66093d2b3cc9f389176295b185aa126d26ae | [
"MIT"
] | null | null | null | MangAdventure/widgets.py | tomenjerry/mangaadv | 931d66093d2b3cc9f389176295b185aa126d26ae | [
"MIT"
] | null | null | null | MangAdventure/widgets.py | tomenjerry/mangaadv | 931d66093d2b3cc9f389176295b185aa126d26ae | [
"MIT"
] | null | null | null | """Custom form widgets."""
__all__ = ['TinyMCE']
| 26.095238 | 58 | 0.541058 | """Custom form widgets."""
from json import dumps
from typing import Any, Dict
from django.forms import Textarea
class TinyMCE(Textarea):
"""
A textarea :class:`~django.forms.Widget`
for `TinyMCE <https://www.tiny.cloud/>`_.
:param attrs: A dictionary of the widget's attributes.
"""
def __i... | 0 | 0 | 0 | 933 | 0 | 0 | 0 | 20 | 91 |
e52b19cf91a24cb395def969fdb68ca7f8569671 | 718 | py | Python | tests/objects/test_contour.py | adrientetar/ufoLib2 | bffb34dd0553e99992fc99dd86dbb595bdc59559 | [
"Apache-2.0"
] | 1 | 2018-05-07T12:44:59.000Z | 2018-05-07T12:44:59.000Z | tests/objects/test_contour.py | adrientetar/ufoLib2 | bffb34dd0553e99992fc99dd86dbb595bdc59559 | [
"Apache-2.0"
] | 2 | 2018-05-07T19:26:10.000Z | 2018-05-09T19:07:51.000Z | tests/objects/test_contour.py | adrientetar/ufoLib2 | bffb34dd0553e99992fc99dd86dbb595bdc59559 | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
| 25.642857 | 63 | 0.655989 | from __future__ import annotations
import pytest
from ufoLib2.objects import Glyph
from ufoLib2.objects.contour import Contour
@pytest.fixture
def contour() -> Contour:
g = Glyph("a")
pen = g.getPen()
pen.moveTo((0, 0))
pen.curveTo((10, 10), (10, 20), (0, 20))
pen.closePath()
return g.contou... | 0 | 173 | 0 | 0 | 0 | 344 | 0 | 26 | 137 |
967a2f3a1107040316170b6a6e2b8369f6449c6e | 1,353 | py | Python | pyleecan/Methods/Slot/SlotW27/_comp_point_coordinate.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | 95 | 2019-01-23T04:19:45.000Z | 2022-03-17T18:22:10.000Z | pyleecan/Methods/Slot/SlotW27/_comp_point_coordinate.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | 366 | 2019-02-20T07:15:08.000Z | 2022-03-31T13:37:23.000Z | pyleecan/Methods/Slot/SlotW27/_comp_point_coordinate.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | 74 | 2019-01-24T01:47:31.000Z | 2022-02-25T05:44:42.000Z | from numpy import arcsin, exp
def _comp_point_coordinate(self):
"""Compute the point coordinates needed to plot the Slot.
Parameters
----------
self : SlotW27
A SlotW27 object
Returns
-------
point_dict: dict
A dict of the slot point coordinates
"""
Rbo = self.get... | 27.06 | 61 | 0.538803 | from numpy import arcsin, exp
def _comp_point_coordinate(self):
"""Compute the point coordinates needed to plot the Slot.
Parameters
----------
self : SlotW27
A SlotW27 object
Returns
-------
point_dict: dict
A dict of the slot point coordinates
"""
Rbo = self.get... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |