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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6ff4ad7de535e4648266aff43b024e59e5283a7d | 34,488 | py | Python | neobolt/direct.py | technige/neobolt | f48eac3046cf0f6d6fe534fdb53ea42c964bcc9f | [
"Apache-2.0"
] | null | null | null | neobolt/direct.py | technige/neobolt | f48eac3046cf0f6d6fe534fdb53ea42c964bcc9f | [
"Apache-2.0"
] | null | null | null | neobolt/direct.py | technige/neobolt | f48eac3046cf0f6d6fe534fdb53ea42c964bcc9f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright (c) 2002-2018 "Neo4j,"
# Neo4j Sweden AB [http://neo4j.com]
#
# This file is part of Neo4j.
#
# 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 L... | 36.767591 | 139 | 0.604558 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright (c) 2002-2018 "Neo4j,"
# Neo4j Sweden AB [http://neo4j.com]
#
# This file is part of Neo4j.
#
# 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 L... | 0 | 314 | 0 | 23,485 | 0 | 1,494 | 0 | 280 | 295 |
fa0112458b2b0ee6bc4f800ea9fbf977b7339261 | 27,492 | py | Python | ingest/make_toy_data.py | broadinstitute/scp-ingest-service | 1a63a27061b53a5f7909c72d59808f9af71456a6 | [
"BSD-3-Clause"
] | 1 | 2020-06-08T16:30:47.000Z | 2020-06-08T16:30:47.000Z | ingest/make_toy_data.py | broadinstitute/scp-ingest-service | 1a63a27061b53a5f7909c72d59808f9af71456a6 | [
"BSD-3-Clause"
] | 146 | 2019-07-25T13:09:47.000Z | 2022-03-28T19:29:22.000Z | ingest/make_toy_data.py | broadinstitute/scp-ingest-service | 1a63a27061b53a5f7909c72d59808f9af71456a6 | [
"BSD-3-Clause"
] | null | null | null | """
Generate data to simulate a study, e.g. to test ingest or download features.
DESCRIPTION
This data is similar to real data in structure and basic statistics (e.g.
sparseness), but is biologically meaningless.
EXAMPLES
# Generate 3 dense matrix files, 25 MB each
python make_toy_data.py
# Generate 6 dense matrix f... | 35.703896 | 224 | 0.593154 | """
Generate data to simulate a study, e.g. to test ingest or download features.
DESCRIPTION
This data is similar to real data in structure and basic statistics (e.g.
sparseness), but is biologically meaningless.
EXAMPLES
# Generate 3 dense matrix files, 25 MB each
python make_toy_data.py
# Generate 6 dense matrix f... | 0 | 0 | 0 | 0 | 4,422 | 5,719 | 0 | 13 | 180 |
74af6aa8a37207d7bbd9363cb15a26b344ae6c3c | 1,609 | py | Python | runs/ts_run.py | SondreWold/pararel | 40c42b1cf3fc59851bc9307824597097de94bfe5 | [
"MIT"
] | 18 | 2021-02-26T14:46:23.000Z | 2022-02-23T09:32:53.000Z | runs/ts_run.py | SondreWold/pararel | 40c42b1cf3fc59851bc9307824597097de94bfe5 | [
"MIT"
] | 4 | 2021-06-21T13:34:52.000Z | 2022-01-24T09:32:40.000Z | runs/ts_run.py | SondreWold/pararel | 40c42b1cf3fc59851bc9307824597097de94bfe5 | [
"MIT"
] | 3 | 2021-06-25T18:51:29.000Z | 2022-01-22T08:20:44.000Z | """
Based on https://gist.github.com/felixkreuk/8d70c8c1507fcaac6197d84a8a787fa0
"""
import spur
env = {
'USE_SIMPLE_THREADED_LEVEL3': '1',
'OMP_NUM_THREADS': '1',
}
ts = '/PATH-TO-DIR/ts-1.0/ts'
def parallelize(nodes_list, all_runs_args, run_script, on_gpu=False, dry_run=False):
"""
Running on a ... | 28.732143 | 94 | 0.614667 | """
Based on https://gist.github.com/felixkreuk/8d70c8c1507fcaac6197d84a8a787fa0
"""
import spur
env = {
'USE_SIMPLE_THREADED_LEVEL3': '1',
'OMP_NUM_THREADS': '1',
}
ts = '/PATH-TO-DIR/ts-1.0/ts'
def parallelize(nodes_list, all_runs_args, run_script, on_gpu=False, dry_run=False):
"""
Running on a ... | 102 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4e5770d8b5b739ec7edf48a199cb9c2f5e6711d4 | 2,789 | py | Python | Model.py | darsh-008/Resignation-Predictor | cc6f05931d2d68fe6d7dc19e2a1457e2d0727cce | [
"MIT"
] | null | null | null | Model.py | darsh-008/Resignation-Predictor | cc6f05931d2d68fe6d7dc19e2a1457e2d0727cce | [
"MIT"
] | null | null | null | Model.py | darsh-008/Resignation-Predictor | cc6f05931d2d68fe6d7dc19e2a1457e2d0727cce | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
import pandas as pd
import numpy as np
from sklearn import preprocessing
from sklearn import metrics
from sklearn.metrics import r2_score
import pickle
# import matplotlib.pyplot as plt
# %matplotlib inline
# In[ ]:
df = pd.read_csv("HR_comma_sep.csv")
# In[ ]:
... | 18.11039 | 129 | 0.697024 | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
import pandas as pd
import numpy as np
import seaborn as sns
from sklearn import preprocessing
from sklearn import metrics
from sklearn.metrics import r2_score
import warnings
import pickle
# import matplotlib.pyplot as plt
# %matplotlib inline
# In[ ]:
df = pd.rea... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -6 | 44 |
96114ba418f9def5e8f46968b54e15dbde0098a3 | 2,853 | py | Python | Algorithms/Optimal Solutions/Best Trade/trade.py | Lockon2000/Practice | a51cb282c727a46a41ac2ce50ea1bd4be9bb4b88 | [
"MIT"
] | null | null | null | Algorithms/Optimal Solutions/Best Trade/trade.py | Lockon2000/Practice | a51cb282c727a46a41ac2ce50ea1bd4be9bb4b88 | [
"MIT"
] | null | null | null | Algorithms/Optimal Solutions/Best Trade/trade.py | Lockon2000/Practice | a51cb282c727a46a41ac2ce50ea1bd4be9bb4b88 | [
"MIT"
] | null | null | null | # Here are three different implementations for algorithms that solve the best trade problem.
# trade_dp is of time complexity O(n) and similar space complexity.
# trade_kadane is of time complexity O(n) and space complexity O(1).
# trade_kadane_correct is of time complexity O(n) and space complexity O(1).
# NOTE: trade... | 31.7 | 118 | 0.574132 | # Here are three different implementations for algorithms that solve the best trade problem.
# trade_dp is of time complexity O(n) and similar space complexity.
# trade_kadane is of time complexity O(n) and space complexity O(1).
# trade_kadane_correct is of time complexity O(n) and space complexity O(1).
# NOTE: trade... | 0 | 0 | 0 | 0 | 0 | 1,424 | 0 | 0 | 69 |
b6034023ab5ff92f7c82be0bdc78e9cd0e5fea9d | 2,447 | py | Python | fastener.py | CreativeGP/Fastener | a2ff452f20dfa27387dbe85e269776a85d9af05b | [
"MIT"
] | null | null | null | fastener.py | CreativeGP/Fastener | a2ff452f20dfa27387dbe85e269776a85d9af05b | [
"MIT"
] | null | null | null | fastener.py | CreativeGP/Fastener | a2ff452f20dfa27387dbe85e269776a85d9af05b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import time
import json
from watchdog.observers import Observer
import argparse
parser = argparse.ArgumentParser(description='This script is tasks automizer.')
parser.add_argument('basepath', action='store', type=str, help='Directory path where you want to automize.')
parser.add_a... | 27.494382 | 108 | 0.649775 | #!/usr/bin/env python
# coding: utf-8
import os
import sys
import time
import re
import json
import commands
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
import color
import argparse
parser = argparse.ArgumentParser(description='This script is tasks automizer.')
parser.a... | 0 | 0 | 0 | 334 | 0 | 595 | 0 | -21 | 203 |
333dad3ef6492745a1dce443c6724952f8e9697c | 15,245 | py | Python | pymdwizard/gui/ThesaurusSearch.py | mmfink/fort-pymdwizard | 96f46e8cc2594b82b475b4f3fcae96a05ebc03e4 | [
"CC-BY-4.0"
] | 53 | 2017-05-01T05:03:33.000Z | 2022-03-13T04:49:15.000Z | pymdwizard/gui/ThesaurusSearch.py | mmfink/fort-pymdwizard | 96f46e8cc2594b82b475b4f3fcae96a05ebc03e4 | [
"CC-BY-4.0"
] | 109 | 2017-05-17T15:15:40.000Z | 2022-03-24T21:12:45.000Z | pymdwizard/gui/ThesaurusSearch.py | mmfink/fort-pymdwizard | 96f46e8cc2594b82b475b4f3fcae96a05ebc03e4 | [
"CC-BY-4.0"
] | 17 | 2017-02-08T16:18:18.000Z | 2021-01-28T19:38:09.000Z | #!/usr/bin/env python
# -*- coding: utf8 -*-
"""
The MetadataWizard(pymdwizard) software was developed by the
U.S. Geological Survey Fort Collins Science Center.
See: https://github.com/usgs/fort-pymdwizard for current project source code
See: https://usgs.github.io/fort-pymdwizard/ for current user documentation
See: ... | 35.955189 | 139 | 0.539587 | #!/usr/bin/env python
# -*- coding: utf8 -*-
"""
The MetadataWizard(pymdwizard) software was developed by the
U.S. Geological Survey Fort Collins Science Center.
See: https://github.com/usgs/fort-pymdwizard for current project source code
See: https://usgs.github.io/fort-pymdwizard/ for current user documentation
See: ... | 0 | 0 | 0 | 12,415 | 0 | 0 | 0 | 107 | 206 |
a88402479f32214beec0f3c18464b0c0cfd70426 | 432 | py | Python | 2020/5/5.py | jeremy-quicklearner/advent-of-code | a87541fda41326b47498bc7e5134515a8793d896 | [
"MIT"
] | null | null | null | 2020/5/5.py | jeremy-quicklearner/advent-of-code | a87541fda41326b47498bc7e5134515a8793d896 | [
"MIT"
] | null | null | null | 2020/5/5.py | jeremy-quicklearner/advent-of-code | a87541fda41326b47498bc7e5134515a8793d896 | [
"MIT"
] | null | null | null | #!/usr/bin/python
with open('passes.txt') as fh:
lines = fh.readlines()
lines = [line.replace('B','1') for line in lines]
lines = [line.replace('F','0') for line in lines]
lines = [line.replace('R','1') for line in lines]
lines = [line.replace('L','0') for line in lines]
nums = [int(line,2) for line in lines]
pri... | 27 | 56 | 0.659722 | #!/usr/bin/python
with open('passes.txt') as fh:
lines = fh.readlines()
lines = [line.replace('B','1') for line in lines]
lines = [line.replace('F','0') for line in lines]
lines = [line.replace('R','1') for line in lines]
lines = [line.replace('L','0') for line in lines]
nums = [int(line,2) for line in lines]
pri... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
63336e40b477cc0635ea13a7fdf61259f13b5804 | 2,026 | py | Python | events.py | OpenTwinCities/newsletter_scripts | 03787b845c7e64f63a506a26dbbf10924b83a8f8 | [
"MIT"
] | null | null | null | events.py | OpenTwinCities/newsletter_scripts | 03787b845c7e64f63a506a26dbbf10924b83a8f8 | [
"MIT"
] | null | null | null | events.py | OpenTwinCities/newsletter_scripts | 03787b845c7e64f63a506a26dbbf10924b83a8f8 | [
"MIT"
] | null | null | null | import sys
REGISTERED_LABEL = 'Registered'
ATTENDEE_LABEL = 'Attendee'
if __name__ == '__main__':
args = sys.argv
if len(args) == 6:
args.append(None)
process(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5],
sys.argv[6])
| 35.54386 | 78 | 0.653011 | import csv
import sys
REGISTERED_LABEL = 'Registered'
ATTENDEE_LABEL = 'Attendee'
def ReadMembers(filename):
rows = {}
with open(filename) as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
rows[row['Email Address']] = row
return {'rows': rows, 'fieldnames': reade... | 0 | 0 | 0 | 0 | 0 | 1,647 | 0 | -11 | 114 |
f906da9eba64d94b3d07b9bf6983332ab15bc039 | 3,578 | py | Python | tests/thread_safety.py | rwspielman/rule-engine | 1d84d5599fe5ab34bc8d6fc00bbe00f847352428 | [
"BSD-3-Clause"
] | 149 | 2018-04-04T12:47:38.000Z | 2022-03-25T07:25:55.000Z | tests/thread_safety.py | rwspielman/rule-engine | 1d84d5599fe5ab34bc8d6fc00bbe00f847352428 | [
"BSD-3-Clause"
] | 26 | 2020-01-06T17:29:26.000Z | 2022-03-25T07:01:49.000Z | tests/thread_safety.py | rwspielman/rule-engine | 1d84d5599fe5ab34bc8d6fc00bbe00f847352428 | [
"BSD-3-Clause"
] | 24 | 2020-02-15T22:58:30.000Z | 2022-03-22T02:15:26.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# tests/thread_safety.py
#
# 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 above copyright
# notice, this lis... | 38.473118 | 108 | 0.742035 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# tests/thread_safety.py
#
# 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 above copyright
# notice, this lis... | 0 | 0 | 0 | 1,609 | 0 | 111 | 0 | -33 | 180 |
9af7e686a5c07c3b66087a6e53ae9aaf34da5a25 | 4,919 | py | Python | tests/bugs/core_3362_complex_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | tests/bugs/core_3362_complex_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | tests/bugs/core_3362_complex_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | #coding:utf-8
#
# id: bugs.core_3362_complex
# title: Cursors should ignore changes made by the same statement
# decription:
# This test verifies PSQL issues that were accumulated in miscenaleous tickets.
#
# tracker_id: CORE-3362
# min_versions: ['3.0.1']
# versio... | 35.135714 | 143 | 0.570644 | #coding:utf-8
#
# id: bugs.core_3362_complex
# title: Cursors should ignore changes made by the same statement
# decription:
# This test verifies PSQL issues that were accumulated in miscenaleous tickets.
#
# tracker_id: CORE-3362
# min_versions: ['3.0.1']
# versio... | 0 | 271 | 0 | 0 | 0 | 0 | 0 | 0 | 46 |
feb0df3ba2f57232b32f17e7514d6d3b7db0cc4b | 13,935 | py | Python | tests/unit/test_helpers.py | softvision-oana-arbuzov/webcompat.com | baa490e97296626f77d72e15bbf7e5ab87dbc6a6 | [
"MIT"
] | 2 | 2020-03-19T05:39:46.000Z | 2021-02-02T15:12:12.000Z | tests/unit/test_helpers.py | softvision-sergiulogigan/webcompat.com | baa490e97296626f77d72e15bbf7e5ab87dbc6a6 | [
"MIT"
] | null | null | null | tests/unit/test_helpers.py | softvision-sergiulogigan/webcompat.com | baa490e97296626f77d72e15bbf7e5ab87dbc6a6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
'''Tests for helper methods in webcompat/helpers.py.'''
import os.path
im... | 58.797468 | 451 | 0.650305 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
'''Tests for helper methods in webcompat/helpers.py.'''
import os.path
im... | 16 | 0 | 0 | 9,344 | 0 | 0 | 0 | 281 | 310 |
a3842c6138c7e752e05c72628b0129a00a3d511f | 1,617 | py | Python | tests/test_reduce_sum.py | gavinuhma/tf-encrypted | 4e18d78a151bbe91489a1773fb839b889ff5b460 | [
"Apache-2.0"
] | 3 | 2018-10-18T19:36:02.000Z | 2020-07-05T19:46:23.000Z | tests/test_reduce_sum.py | dropoutlabs/tf-encrypted | 48c9dc7419163425e736ad05bb19980d134fc851 | [
"Apache-2.0"
] | null | null | null | tests/test_reduce_sum.py | dropoutlabs/tf-encrypted | 48c9dc7419163425e736ad05bb19980d134fc851 | [
"Apache-2.0"
] | null | null | null | # pylint: disable=missing-docstring
import unittest
if __name__ == '__main__':
unittest.main()
| 24.134328 | 54 | 0.650588 | # pylint: disable=missing-docstring
import unittest
import numpy as np
import tensorflow as tf
import tf_encrypted as tfe
class TestReduceSum(unittest.TestCase):
def setUp(self):
tf.reset_default_graph()
def test_reduce_sum_1d(self):
t = [1, 2]
with tf.Session() as sess:
out = tf.reduce_sum(t... | 0 | 0 | 0 | 1,423 | 0 | 0 | 0 | 4 | 90 |
1b001b11e61c8c0e2cc5d11ae6a163baa50bcd9d | 1,391 | py | Python | dfetch/commands/check.py | Rohitth007/dfetch | 947ba95e79451c8c7dc82eeb4e5b4b117addf7bd | [
"MIT"
] | null | null | null | dfetch/commands/check.py | Rohitth007/dfetch | 947ba95e79451c8c7dc82eeb4e5b4b117addf7bd | [
"MIT"
] | null | null | null | dfetch/commands/check.py | Rohitth007/dfetch | 947ba95e79451c8c7dc82eeb4e5b4b117addf7bd | [
"MIT"
] | null | null | null | """To check if your projects are up-to-date, you can let dfetch check it.
For each project the local version (based on tag or revision) will be compared against
the available version. If there are new versions available this will be shown.
"""
import dfetch.commands.command
import dfetch.manifest.manifest
import dfet... | 30.911111 | 86 | 0.67793 | """To check if your projects are up-to-date, you can let dfetch check it.
For each project the local version (based on tag or revision) will be compared against
the available version. If there are new versions available this will be shown.
"""
import argparse
import os
import dfetch.commands.command
import dfetch.ma... | 0 | 180 | 0 | 713 | 0 | 0 | 0 | -21 | 90 |
3332090d87d7de9d36e1b8d43c2953d457f516d9 | 6,053 | py | Python | kuka_arm/scripts/IK_server.py | AbanobEffat/Pick-and-Place-Udacity | 6acc48207515992fdc5c3a7eb99c794e8a7f0392 | [
"MIT"
] | 6 | 2019-01-02T05:59:40.000Z | 2020-12-07T20:05:34.000Z | kuka_arm/scripts/IK_server.py | AbanobEffat/Pick-and-Place-Udacity | 6acc48207515992fdc5c3a7eb99c794e8a7f0392 | [
"MIT"
] | null | null | null | kuka_arm/scripts/IK_server.py | AbanobEffat/Pick-and-Place-Udacity | 6acc48207515992fdc5c3a7eb99c794e8a7f0392 | [
"MIT"
] | 3 | 2020-04-08T02:27:58.000Z | 2021-11-19T08:34:34.000Z | #!/usr/bin/env python
# Copyright (C) 2017 Udacity Inc.
#
# This file is part of Robotic Arm: Pick and Place project for Udacity
# Robotics nano-degree program
#
# All Rights Reserved.
# Author: Harsh Pandya
# import modules
from sympy import symbols, cos, sin
#Create symbol table
q1, q2, q3, q4, q5, q6, q7 = symb... | 37.134969 | 106 | 0.556418 | #!/usr/bin/env python
# Copyright (C) 2017 Udacity Inc.
#
# This file is part of Robotic Arm: Pick and Place project for Udacity
# Robotics nano-degree program
#
# All Rights Reserved.
# Author: Harsh Pandya
# import modules
import rospy
import tf
from kuka_arm.srv import *
from trajectory_msgs.msg import JointTrajec... | 0 | 0 | 0 | 0 | 0 | 3,418 | 0 | 60 | 266 |
b7ae930be66947508bbb18abc34619e320dd0f38 | 6,768 | py | Python | app/utils.py | reubano/amzn-search-api | 2b767e28a7e1ffb3b7189bc4f65363cf80c59bd5 | [
"MIT"
] | 4 | 2018-09-23T01:42:12.000Z | 2019-07-21T17:02:46.000Z | app/utils.py | reubano/amzn-search-api | 2b767e28a7e1ffb3b7189bc4f65363cf80c59bd5 | [
"MIT"
] | null | null | null | app/utils.py | reubano/amzn-search-api | 2b767e28a7e1ffb3b7189bc4f65363cf80c59bd5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
app.utils
~~~~~~~~~
Provides misc utility functions
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals)
from json import loads, dumps
try:
from json.decoder import JSONDecodeError
except ImportError:
JSONDecodeError = ValueErro... | 31.626168 | 79 | 0.663121 | # -*- coding: utf-8 -*-
"""
app.utils
~~~~~~~~~
Provides misc utility functions
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals)
from json import loads, dumps
try:
from json.decoder import JSONDecodeError
except ImportError:
JSONDecodeError = ValueErro... | 0 | 659 | 0 | 0 | 732 | 467 | 0 | 52 | 252 |
dbaa45813912df6e89c8717c633e379a4d69a622 | 415 | py | Python | books/software-architecture-with-python/Ch04-performance-data-structures/rotate.py | phiratio/lpthw | a32240d4355fb331805d515f96e1d009914e5c47 | [
"MIT"
] | 1 | 2021-04-21T09:38:38.000Z | 2021-04-21T09:38:38.000Z | books/software-architecture-with-python/Ch04-performance-data-structures/rotate.py | phiratio/lpthw | a32240d4355fb331805d515f96e1d009914e5c47 | [
"MIT"
] | 34 | 2019-12-16T16:53:24.000Z | 2022-01-13T02:29:30.000Z | books/software-architecture-with-python/Ch04-performance-data-structures/rotate.py | phiratio/lpthw | a32240d4355fb331805d515f96e1d009914e5c47 | [
"MIT"
] | null | null | null | # Code Listing #6
"""
Example with collections.deque for rotating sequences
"""
from collections import deque
def rotate_seq1(seq1, n):
""" Rotate a sequence left by n """
# E.g: rotate([1,2,3,4,5], 2) => [4,5,1,2,3]
k = len(seq1) - n
return seq1[k:] + seq1[:k]
def rotate_seq2(seq1, n):
"""... | 15.961538 | 53 | 0.592771 | # Code Listing #6
"""
Example with collections.deque for rotating sequences
"""
from collections import deque
def rotate_seq1(seq1, n):
""" Rotate a sequence left by n """
# E.g: rotate([1,2,3,4,5], 2) => [4,5,1,2,3]
k = len(seq1) - n
return seq1[k:] + seq1[:k]
def rotate_seq2(seq1, n):
"""... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ec8424d21606b7570d14c5e9a73b6e051faf555a | 1,686 | py | Python | my_solver/manual_game/my_solver.py | umr-bot/sliding-puzzle-solver-bot | 826532a426f343bcc66034b241a42b3bd864e07c | [
"MIT"
] | null | null | null | my_solver/manual_game/my_solver.py | umr-bot/sliding-puzzle-solver-bot | 826532a426f343bcc66034b241a42b3bd864e07c | [
"MIT"
] | null | null | null | my_solver/manual_game/my_solver.py | umr-bot/sliding-puzzle-solver-bot | 826532a426f343bcc66034b241a42b3bd864e07c | [
"MIT"
] | null | null | null | ### Basic NxN sliding puzzle solver
| 37.466667 | 88 | 0.522539 | ### Basic NxN sliding puzzle solver
import numpy as np
class puzzle():
def __init__(self,N=4):
self.N = N
self.size = N*N
blocks = np.array(np.arange(1,self.size+1))
self.blocks = blocks
np.random.shuffle(self.blocks)
self.blank_index = np.where(self.blocks ... | 0 | 0 | 0 | 1,605 | 0 | 0 | 0 | -3 | 46 |
970af100ff0910ee3a447b92a026b9dece18a568 | 356 | py | Python | lesson9_napalm/ex1b.py | anejolazaro70/python_july19 | d4fd2f0d00d22f2f103ef9fe9c289c8b0651b454 | [
"Apache-2.0"
] | null | null | null | lesson9_napalm/ex1b.py | anejolazaro70/python_july19 | d4fd2f0d00d22f2f103ef9fe9c289c8b0651b454 | [
"Apache-2.0"
] | null | null | null | lesson9_napalm/ex1b.py | anejolazaro70/python_july19 | d4fd2f0d00d22f2f103ef9fe9c289c8b0651b454 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
if __name__ == '__main__':
main()
| 20.941176 | 44 | 0.72191 | #!/usr/bin/env python
from my_devices import cisco3, arista1
from napalm import get_network_driver
def con_napalm(device):
device_type = device.pop('device_type')
driver = get_network_driver(device_type)
return(driver(**device))
def main():
print(con_napalm(cisco3))
print(con_napalm(arista1))
if... | 0 | 0 | 0 | 0 | 0 | 171 | 0 | 33 | 91 |
2aeda170440a4fbc2348818496f8782a5bf5231e | 412 | py | Python | country/migrations/0027_redflag_implemented.py | bikramtuladhar/covid-19-procurement-explorer-admin | 9bba473c8b83c8651e3178b6fba01af74d8b27dc | [
"BSD-3-Clause"
] | null | null | null | country/migrations/0027_redflag_implemented.py | bikramtuladhar/covid-19-procurement-explorer-admin | 9bba473c8b83c8651e3178b6fba01af74d8b27dc | [
"BSD-3-Clause"
] | null | null | null | country/migrations/0027_redflag_implemented.py | bikramtuladhar/covid-19-procurement-explorer-admin | 9bba473c8b83c8651e3178b6fba01af74d8b27dc | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.1.2 on 2021-03-23 11:31
| 21.684211 | 76 | 0.609223 | # Generated by Django 3.1.2 on 2021-03-23 11:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("country", "0026_overallsummary"),
]
operations = [
migrations.AddField(
model_name="redflag",
name="implemented",
... | 0 | 0 | 0 | 298 | 0 | 0 | 0 | 19 | 46 |
5267b6927a1d081e2b5a6e6e6003e353d516dfa2 | 240 | py | Python | Ekeopara_Praise/Phase 2/LIST/Day41 Tasks/Task9.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 6 | 2020-05-23T19:53:25.000Z | 2021-05-08T20:21:30.000Z | Ekeopara_Praise/Phase 2/LIST/Day41 Tasks/Task9.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 8 | 2020-05-14T18:53:12.000Z | 2020-07-03T00:06:20.000Z | Ekeopara_Praise/Phase 2/LIST/Day41 Tasks/Task9.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 39 | 2020-05-10T20:55:02.000Z | 2020-09-12T17:40:59.000Z | '''9. Write a Python program to get unique values from a list. '''
my_list = [10, 20, 30, 40, 20, 50, 60, 40]
print("Original List : ",my_list)
my_set = set(my_list)
my_new_list = list(my_set)
print("List of unique numbers : ",my_new_list) | 34.285714 | 66 | 0.6875 | '''9. Write a Python program to get unique values from a list. '''
my_list = [10, 20, 30, 40, 20, 50, 60, 40]
print("Original List : ",my_list)
my_set = set(my_list)
my_new_list = list(my_set)
print("List of unique numbers : ",my_new_list) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5c42f515125f4aab7867d2d32296a05aeedcb85f | 7,145 | py | Python | tests/test_config.py | fennekki/cdparacord | 483682bd476631202ae135b296425bc340f57173 | [
"BSD-2-Clause"
] | 1 | 2016-12-07T08:38:53.000Z | 2016-12-07T08:38:53.000Z | tests/test_config.py | fennekki/cdparacord | 483682bd476631202ae135b296425bc340f57173 | [
"BSD-2-Clause"
] | 49 | 2018-02-24T15:30:35.000Z | 2021-03-25T21:35:40.000Z | tests/test_config.py | fennekki/cdparacord | 483682bd476631202ae135b296425bc340f57173 | [
"BSD-2-Clause"
] | null | null | null | """Tests for the config module.
NOTE: If you intend to import Config and monkeypatch the config dir (you
should, to make it work) you need to ensure that you only import Config
inside your test function. Otherwise xdg.XDG_CONFIG_HOME will, in the
automated environment, fail to be evaluated and the tests will crash.
""... | 29.044715 | 74 | 0.707348 | """Tests for the config module.
NOTE: If you intend to import Config and monkeypatch the config dir (you
should, to make it work) you need to ensure that you only import Config
inside your test function. Otherwise xdg.XDG_CONFIG_HOME will, in the
automated environment, fail to be evaluated and the tests will crash.
""... | 0 | 2,101 | 0 | 0 | 0 | 891 | 0 | -17 | 274 |
d685ac632c6eb449acc7dd71fa6eb10e806d4187 | 183 | py | Python | M00_PhysComp/01. Programming Intro/examples/flow_control/loop_for.py | acrobotic/EduKit | ee40985c6a17454de386f7e7a0c1b8f0bc14e120 | [
"Unlicense",
"MIT"
] | 3 | 2020-04-16T20:56:18.000Z | 2021-05-09T11:29:55.000Z | M00_PhysComp/01. Programming Intro/examples/flow_control/loop_for.py | acrobotic/EduKit | ee40985c6a17454de386f7e7a0c1b8f0bc14e120 | [
"Unlicense",
"MIT"
] | null | null | null | M00_PhysComp/01. Programming Intro/examples/flow_control/loop_for.py | acrobotic/EduKit | ee40985c6a17454de386f7e7a0c1b8f0bc14e120 | [
"Unlicense",
"MIT"
] | 1 | 2020-04-16T20:56:26.000Z | 2020-04-16T20:56:26.000Z | #!/usr/bin/env python
import random
x = 1
seq = [0,1,2,3,4,5,6,7,8,9]
for i in seq:
x = random.randint(0,1)
x_str = str(x)
print("x_str" + " is " + x_str)
print("Done!")
| 18.3 | 35 | 0.557377 | #!/usr/bin/env python
import random
x = 1
seq = [0,1,2,3,4,5,6,7,8,9]
for i in seq:
x = random.randint(0,1)
x_str = str(x)
print("x_str" + " is " + x_str)
print("Done!")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3dd1082f24d99a8b08905d00f842959a7ee3f186 | 113 | py | Python | src/playground/tmp.py | greghor/vim-ds-shortcuts | f47005d1a1e1a83f4f02b8d313e7f0addec66e48 | [
"MIT"
] | null | null | null | src/playground/tmp.py | greghor/vim-ds-shortcuts | f47005d1a1e1a83f4f02b8d313e7f0addec66e48 | [
"MIT"
] | null | null | null | src/playground/tmp.py | greghor/vim-ds-shortcuts | f47005d1a1e1a83f4f02b8d313e7f0addec66e48 | [
"MIT"
] | null | null | null |
data_path = "data/raw/titanic.csv"
| 16.142857 | 36 | 0.778761 |
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
data_path = "data/raw/titanic.csv"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 67 |
3337cd6816d81c80f0560d01372068b8c7b66ab1 | 8,367 | py | Python | aws_glue_etl_docker/glueshim.py | KevinGlinski/aws_glue_etl_jupyter | a4aa3df361ee9f730d78aa42d860921adeb61a1a | [
"MIT"
] | 19 | 2019-04-11T18:07:21.000Z | 2022-03-20T21:25:54.000Z | aws_glue_etl_docker/glueshim.py | KevinGlinski/aws_glue_etl_jupyter | a4aa3df361ee9f730d78aa42d860921adeb61a1a | [
"MIT"
] | null | null | null | aws_glue_etl_docker/glueshim.py | KevinGlinski/aws_glue_etl_jupyter | a4aa3df361ee9f730d78aa42d860921adeb61a1a | [
"MIT"
] | 4 | 2019-07-24T06:06:30.000Z | 2022-02-17T10:11:01.000Z |
try:
except Exception as e:
print('local dev')
| 37.022124 | 199 | 0.634517 | import sys
import os.path
import shutil
import glob
import pyspark
from pyspark import SparkConf, SparkContext, SQLContext
from pprint import pprint
def _load_data(filePaths, dataset_name, spark_context, groupfiles, groupsize):
sqlContext = SQLContext(spark_context)
return sqlContext.read.json(filePaths)
def ... | 0 | 0 | 0 | 2,870 | 0 | 4,574 | 0 | 68 | 793 |
06c557b816cd46bf0068e770f034f4139908f83a | 15,402 | py | Python | backend/api/v1/pricing/views.py | rabisubedichettri/real_estate_portal | b748ac7d2b5cf02e6d35153c18306abd5a0d3c7d | [
"MIT"
] | null | null | null | backend/api/v1/pricing/views.py | rabisubedichettri/real_estate_portal | b748ac7d2b5cf02e6d35153c18306abd5a0d3c7d | [
"MIT"
] | null | null | null | backend/api/v1/pricing/views.py | rabisubedichettri/real_estate_portal | b748ac7d2b5cf02e6d35153c18306abd5a0d3c7d | [
"MIT"
] | null | null | null | # serializers imports
from django.db import transaction
# rest_frameworks imports
# model imports
from pricing.models import PaidPackageInfo
# custom response format
# package transcation
| 41.403226 | 148 | 0.524283 | from django.shortcuts import render
from django.db.models import Q
from api.v1.tools.paginator import customPagination
# serializers imports
from django.utils import timezone
from datetime import datetime
from django.db import DatabaseError, transaction
from django.db import IntegrityError, transaction
from django.con... | 0 | 3,083 | 0 | 10,764 | 0 | 375 | 0 | 491 | 491 |
eb6ff5613237865a21f8ddb74802cc6d65c9e91d | 396 | py | Python | arkav_is_api/preevent/migrations/0007_auto_20181214_0129.py | arkavidia5/arkav-is | 6c6e8d091ead5bfff664d86f7903c62209800031 | [
"MIT"
] | 3 | 2018-10-01T16:30:15.000Z | 2020-01-06T09:03:57.000Z | arkav_is_api/preevent/migrations/0007_auto_20181214_0129.py | arkavidia5/arkav-is | 6c6e8d091ead5bfff664d86f7903c62209800031 | [
"MIT"
] | 4 | 2018-11-03T10:56:52.000Z | 2020-04-26T06:54:16.000Z | arkav_is_api/preevent/migrations/0007_auto_20181214_0129.py | arkavidia5/arkav-is | 6c6e8d091ead5bfff664d86f7903c62209800031 | [
"MIT"
] | 2 | 2018-09-26T16:28:01.000Z | 2019-09-04T06:23:14.000Z | # Generated by Django 2.1.4 on 2018-12-13 18:29
| 20.842105 | 48 | 0.611111 | # Generated by Django 2.1.4 on 2018-12-13 18:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('preevent', '0006_auto_20181214_0123'),
]
operations = [
migrations.AlterField(
model_name='codingclassparticipant',
... | 0 | 0 | 0 | 282 | 0 | 0 | 0 | 19 | 46 |
c1233b860de774465baec1c15b5b9cc932cc448e | 3,749 | py | Python | features_with_collors.py | VictorBenoiston/Text-file-list-generator | ab8e9a0cac1d4f390e15311399a50c88997a8b4e | [
"MIT"
] | null | null | null | features_with_collors.py | VictorBenoiston/Text-file-list-generator | ab8e9a0cac1d4f390e15311399a50c88997a8b4e | [
"MIT"
] | null | null | null | features_with_collors.py | VictorBenoiston/Text-file-list-generator | ab8e9a0cac1d4f390e15311399a50c88997a8b4e | [
"MIT"
] | null | null | null | from time import sleep
collors = {
"red": '\033[31m',
"green": '\033[32m',
"yellow": '\033[33m',
"purple": '\033[35m',
"blue": '\033[34m',
"end": '\033[m'
}
def inputInt(txt):
"""
A function that will validate weather a number is integer, or not.
:param txt: The text to be shown ju... | 33.774775 | 121 | 0.566818 | from time import sleep
collors = {
"red": '\033[31m',
"green": '\033[32m',
"yellow": '\033[33m',
"purple": '\033[35m',
"blue": '\033[34m',
"end": '\033[m'
}
def inputInt(txt):
"""
A function that will validate weather a number is integer, or not.
:param txt: The text to be shown ju... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7d9ec2e1015b6d39147de01a5915d5d68859355f | 372 | py | Python | test/test_mock_app_uuid_model_watcher.py | WallaceLiu/distributed-realtime-capfaiss | 3346f540b6c9d17a6be446fefa8c9b79164929d9 | [
"Apache-2.0"
] | null | null | null | test/test_mock_app_uuid_model_watcher.py | WallaceLiu/distributed-realtime-capfaiss | 3346f540b6c9d17a6be446fefa8c9b79164929d9 | [
"Apache-2.0"
] | null | null | null | test/test_mock_app_uuid_model_watcher.py | WallaceLiu/distributed-realtime-capfaiss | 3346f540b6c9d17a6be446fefa8c9b79164929d9 | [
"Apache-2.0"
] | null | null | null |
import redis
r = redis.Redis(host='localhost', port=6379)
k = 'cupid-sim_sim_dmcqm_lhmx_sku_rec_faiss_item_vec_scene102002_v1_s_d_d100_e100-watcher'
v = {'id': 'e71bc544-7fa5-11ea-8249-8c85909d35fg', 'status': 0}
r.hmset(k, v)
a = r.hgetall(k)
print(a)
# 101001100=r.hmget(k,).hgetall(k)
| 21.882353 | 90 | 0.768817 | import unittest
import redis
import time
from concurrent.futures import ProcessPoolExecutor
r = redis.Redis(host='localhost', port=6379)
k = 'cupid-sim_sim_dmcqm_lhmx_sku_rec_faiss_item_vec_scene102002_v1_s_d_d100_e100-watcher'
v = {'id': 'e71bc544-7fa5-11ea-8249-8c85909d35fg', 'status': 0}
r.hmset(k, v)
a = r.hget... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 66 |
63ac98ec30ef39e1d63f2d085b9d6cf96930b147 | 1,372 | py | Python | tests/logger.py | cmutel/Ocelot | 20e9639570c43f84ae255750a6c402ebabe00981 | [
"BSD-3-Clause"
] | 21 | 2016-06-01T14:10:07.000Z | 2022-02-28T01:56:31.000Z | tests/logger.py | cmutel/Ocelot | 20e9639570c43f84ae255750a6c402ebabe00981 | [
"BSD-3-Clause"
] | 152 | 2016-05-16T21:33:22.000Z | 2019-06-24T12:57:14.000Z | tests/logger.py | cmutel/Ocelot | 20e9639570c43f84ae255750a6c402ebabe00981 | [
"BSD-3-Clause"
] | 12 | 2016-09-05T15:35:59.000Z | 2021-07-03T19:28:47.000Z | # -*- coding: utf-8 -*-
import logging
base_logger = logging.getLogger('ocelot')
detailed_logger = logging.getLogger('ocelot-detailed')
| 29.191489 | 66 | 0.62828 | # -*- coding: utf-8 -*-
from ocelot.logger import create_log, create_detailed_log
import json
import logging
import os
import pytest
import tempfile
base_logger = logging.getLogger('ocelot')
detailed_logger = logging.getLogger('ocelot-detailed')
def test_logging():
tempdir = tempfile.mkdtemp()
base_log = cre... | 0 | 0 | 0 | 0 | 0 | 1,101 | 0 | 0 | 133 |
adec33f82c42265b0a1821ba74b0d0d399f939b9 | 12,786 | py | Python | project/scripts/PPXtractor_ph1.py | weipuz/ftps-hw2 | 352c682913a9bc98e79ab597890b826e843fd88a | [
"MIT"
] | null | null | null | project/scripts/PPXtractor_ph1.py | weipuz/ftps-hw2 | 352c682913a9bc98e79ab597890b826e843fd88a | [
"MIT"
] | 1 | 2020-09-26T13:36:52.000Z | 2020-09-26T13:36:52.000Z | project/scripts/PPXtractor_ph1.py | weipuz/ftps-hw2 | 352c682913a9bc98e79ab597890b826e843fd88a | [
"MIT"
] | null | null | null | ## This program extracts a phrase-pairs from the word alignments of a parallel corpus ##
import optparse, sys, os, logging, time
from zgc import zgc
from itertools import izip
# Constants
weight_rules = False # When distributing the unit-count among the rules, should it be weighted by the # of rule occurren... | 41.784314 | 161 | 0.600735 | ## This program extracts a phrase-pairs from the word alignments of a parallel corpus ##
import optparse, sys, os, logging, time
from types import *
from zgc import zgc
from itertools import izip
# Constants
weight_rules = False # When distributing the unit-count among the rules, should it be weighted by th... | 0 | 0 | 0 | 0 | 0 | 1,237 | 0 | -2 | 68 |
07970cc9597fd80a82610b9125a7939563c0cc53 | 41,089 | py | Python | flask_peewee/tests/rest.py | s045pd/flask-peewee | 7dd38524da0b425fa43d83a44fe74d8982233415 | [
"MIT"
] | 448 | 2015-01-05T11:28:17.000Z | 2022-03-18T08:03:59.000Z | flask_peewee/tests/rest.py | s045pd/flask-peewee | 7dd38524da0b425fa43d83a44fe74d8982233415 | [
"MIT"
] | 31 | 2015-01-03T02:43:44.000Z | 2021-05-17T12:53:08.000Z | flask_peewee/tests/rest.py | s045pd/flask-peewee | 7dd38524da0b425fa43d83a44fe74d8982233415 | [
"MIT"
] | 161 | 2015-01-03T11:28:31.000Z | 2021-09-29T07:29:17.000Z | from __future__ import with_statement
try:
import simplejson as json
except ImportError:
| 35.178938 | 138 | 0.592932 | from __future__ import with_statement
try:
import simplejson as json
except ImportError:
import json
import base64
import datetime
import unittest
from flask import g
from flask_peewee.rest import Authentication
from flask_peewee.rest import RestAPI
from flask_peewee.rest import RestResource
from flask_peew... | 0 | 0 | 0 | 39,814 | 0 | 0 | 0 | 456 | 718 |
c265a4bde88029cb3bfe0357a9a05c3738c9459e | 24,077 | py | Python | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/cms/djangoapps/contentstore/views/tests/test_assets.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 3 | 2021-12-15T04:58:18.000Z | 2022-02-06T12:15:37.000Z | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/cms/djangoapps/contentstore/views/tests/test_assets.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | null | null | null | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/cms/djangoapps/contentstore/views/tests/test_assets.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 1 | 2019-01-02T14:38:50.000Z | 2019-01-02T14:38:50.000Z | """
Unit tests for the asset upload endpoint.
"""
from django.conf import settings
TEST_DATA_DIR = settings.COMMON_TEST_DATA_ROOT
MAX_FILE_SIZE = settings.MAX_ASSET_UPLOAD_FILE_SIZE_IN_MB * 1000 ** 2
FEATURES_WITH_CERTS_ENABLED = settings.FEATURES.copy()
FEATURES_WITH_CERTS_ENABLED['CERTIFICATES_HTML_VIEW'] = True
... | 42.240351 | 116 | 0.650538 | """
Unit tests for the asset upload endpoint.
"""
import json
from datetime import datetime
from io import BytesIO
from unittest import mock
from unittest.mock import patch
from ddt import data, ddt
from django.conf import settings
from django.test.utils import override_settings
from opaque_keys.edx.keys import Asse... | 0 | 5,385 | 0 | 17,275 | 0 | 0 | 0 | 440 | 649 |
d6fc590faf034c95308d3fd41bdc81b8b45497a5 | 2,006 | py | Python | tests/template_common_test.py | radiasoft/sirepo | db3d1737bab7a84d39d456c0e8913c88deff3c31 | [
"Apache-2.0"
] | 49 | 2015-07-29T14:11:29.000Z | 2021-12-10T15:24:26.000Z | tests/template_common_test.py | radiasoft/sirepo | db3d1737bab7a84d39d456c0e8913c88deff3c31 | [
"Apache-2.0"
] | 3,732 | 2015-08-03T22:07:26.000Z | 2022-03-31T22:48:33.000Z | tests/template_common_test.py | radiasoft/sirepo | db3d1737bab7a84d39d456c0e8913c88deff3c31 | [
"Apache-2.0"
] | 28 | 2015-11-20T16:23:46.000Z | 2021-09-20T07:22:48.000Z | # -*- coding: utf-8 -*-
u"""PyTest for :mod:`sirepo.template.srw.py`
:copyright: Copyright (c) 2018 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
| 31.84127 | 93 | 0.703888 | # -*- coding: utf-8 -*-
u"""PyTest for :mod:`sirepo.template.srw.py`
:copyright: Copyright (c) 2018 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
import pytest
import zipfile
from pykern import pkunit... | 0 | 0 | 0 | 0 | 0 | 1,593 | 0 | 11 | 135 |
405a15d38598a10d75c9e4f63fde3fe27ff3d93c | 2,850 | py | Python | viper/core/ui/cmd/tags.py | acd62081/viper | 35d5a0ed3879340aa8d4ba3fc7c8927174e850e4 | [
"BSD-3-Clause"
] | 1,131 | 2015-06-25T00:52:07.000Z | 2022-03-25T11:31:08.000Z | viper/core/ui/cmd/tags.py | acd62081/viper | 35d5a0ed3879340aa8d4ba3fc7c8927174e850e4 | [
"BSD-3-Clause"
] | 444 | 2015-06-26T12:01:03.000Z | 2022-02-09T14:23:26.000Z | viper/core/ui/cmd/tags.py | acd62081/viper | 35d5a0ed3879340aa8d4ba3fc7c8927174e850e4 | [
"BSD-3-Clause"
] | 354 | 2015-06-25T09:33:52.000Z | 2022-03-19T07:30:09.000Z | # -*- coding: utf-8 -*-
# This file is part of Viper - https://github.com/viper-framework/viper
# See the file 'LICENSE' for copying permission.
| 40.714286 | 116 | 0.624561 | # -*- coding: utf-8 -*-
# This file is part of Viper - https://github.com/viper-framework/viper
# See the file 'LICENSE' for copying permission.
from viper.common.abstracts import Command
from viper.core.database import Database
from viper.core.session import __sessions__
class Tags(Command):
"""
This comman... | 0 | 0 | 0 | 2,552 | 0 | 0 | 0 | 62 | 90 |
e6861e800807fac463b250f3d1abef88d5146a31 | 522 | py | Python | 55-Closure/Script.py | dikyindrah/Python-Pemrograman-Dasar | 0dbac8b28a47e67015abcc3656c309cea274f87b | [
"MIT"
] | null | null | null | 55-Closure/Script.py | dikyindrah/Python-Pemrograman-Dasar | 0dbac8b28a47e67015abcc3656c309cea274f87b | [
"MIT"
] | null | null | null | 55-Closure/Script.py | dikyindrah/Python-Pemrograman-Dasar | 0dbac8b28a47e67015abcc3656c309cea274f87b | [
"MIT"
] | null | null | null | # Clousure
print('==========Clousure==========')
# Fungsi bersarang dengan closure
hasil_hitung = hitung()
print(hasil_hitung())
print(hasil_hitung())
print(hasil_hitung())
print('')
# Fungsi bersarang biasa
hitung()
hitung()
hitung()
| 14.5 | 37 | 0.578544 | # Clousure
print('==========Clousure==========')
# Fungsi bersarang dengan closure
def hitung():
nilai = 0
def tambah():
nonlocal nilai
nilai = nilai + 1
return nilai
return tambah
hasil_hitung = hitung()
print(hasil_hitung())
print(hasil_hitung())
print(hasil_hitung())
pri... | 0 | 0 | 0 | 0 | 0 | 236 | 0 | 0 | 44 |
c399ca8c4a540c608a1299e2657a7a0c643f394b | 7,424 | py | Python | src/NeuralFingerPrint/molecules.py | deepsystemspharmacology/drug_combination | 7558b8e673221e2b2954fb63e6bc017be1b5b50b | [
"MIT"
] | 3 | 2021-02-13T14:40:13.000Z | 2021-12-15T22:14:44.000Z | src/NeuralFingerPrint/molecules.py | deepsystemspharmacology/drug_combination | 7558b8e673221e2b2954fb63e6bc017be1b5b50b | [
"MIT"
] | 1 | 2021-08-09T05:14:51.000Z | 2021-08-10T04:20:57.000Z | src/NeuralFingerPrint/molecules.py | qiaoliuhub/drug_combination | 5c3ed18c72882a4ec6f044afdd0e02b0ebce2d85 | [
"MIT"
] | 2 | 2021-07-10T23:41:44.000Z | 2021-07-15T09:23:18.000Z |
degrees = [0, 1, 2, 3, 4, 5]
if __name__ == '__main__':
smiles = ['CCC1=C/C(=C/2\C=CNN2)/C(=O)C=C1OCCCCCC(C)(C)C3=NNN=N3',
'CCCCCC(=O)OC1=C(SC2=CC=CC=C2N3C1=CC=C3)C4=CC=CC=C4']
molecules = Molecules(smiles)
print(len(molecules.get_neighbor_idx_by_degree('atom', 3)))
print(molecules.... | 37.12 | 111 | 0.616245 | import rdkit
import molecule_utils
from collections import Iterable
import pandas as pd
from src import setting
degrees = [0, 1, 2, 3, 4, 5]
def node_id(smiles, idx):
return "/".join([smiles, str(idx)])
class Node(object):
""" Class represent graph node.
Args:
ntype (string): Node type
... | 0 | 0 | 0 | 6,821 | 0 | 44 | 0 | 2 | 202 |
48abd5ae57896de28070b5dd317db22101cc2bdb | 13,376 | py | Python | src/gt4sd/training_pipelines/torchdrug/graphaf/core.py | christofid/gt4sd-core | ea4257e8ff24ee7f766d7010ea5955d823eb9ad7 | [
"MIT"
] | 57 | 2022-02-11T22:32:58.000Z | 2022-03-31T23:17:06.000Z | src/gt4sd/training_pipelines/torchdrug/graphaf/core.py | christofid/gt4sd-core | ea4257e8ff24ee7f766d7010ea5955d823eb9ad7 | [
"MIT"
] | 31 | 2022-02-11T22:43:22.000Z | 2022-03-31T12:04:00.000Z | src/gt4sd/training_pipelines/torchdrug/graphaf/core.py | christofid/gt4sd-core | ea4257e8ff24ee7f766d7010ea5955d823eb9ad7 | [
"MIT"
] | 8 | 2022-02-15T11:13:54.000Z | 2022-03-22T13:56:13.000Z | #
# MIT License
#
# Copyright (c) 2022 GT4SD team
#
# 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, merge,... | 39.457227 | 95 | 0.59061 | #
# MIT License
#
# Copyright (c) 2022 GT4SD team
#
# 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, merge,... | 0 | 3,190 | 0 | 8,072 | 0 | 0 | 0 | 166 | 355 |
fc06129018af377100a05a9933c983cf0ecc90df | 68 | py | Python | zlzzlzz2l/0208/8393.py | Kwak-JunYoung/154Algoritm-5weeks | fa18ae5f68a1ee722a30a05309214247f7fbfda4 | [
"MIT"
] | 3 | 2022-01-24T03:06:32.000Z | 2022-01-30T08:43:58.000Z | zlzzlzz2l/0208/8393.py | Kwak-JunYoung/154Algoritm-5weeks | fa18ae5f68a1ee722a30a05309214247f7fbfda4 | [
"MIT"
] | null | null | null | zlzzlzz2l/0208/8393.py | Kwak-JunYoung/154Algoritm-5weeks | fa18ae5f68a1ee722a30a05309214247f7fbfda4 | [
"MIT"
] | 2 | 2022-01-24T02:27:40.000Z | 2022-01-30T08:57:03.000Z | res = 0
for i in range(1, int(input())+1):
res += i
print(res) | 11.333333 | 34 | 0.544118 | res = 0
for i in range(1, int(input())+1):
res += i
print(res) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5071e6f531fc49d70332ee67acaff8601a8387e4 | 457 | py | Python | MozillaPage1.py | bishnucit/Python-Preludes | 898915eb02fe77631b9852cb8c79faf6fbd720c2 | [
"MIT"
] | null | null | null | MozillaPage1.py | bishnucit/Python-Preludes | 898915eb02fe77631b9852cb8c79faf6fbd720c2 | [
"MIT"
] | null | null | null | MozillaPage1.py | bishnucit/Python-Preludes | 898915eb02fe77631b9852cb8c79faf6fbd720c2 | [
"MIT"
] | null | null | null | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.get("https://marketplace-dev.allizom.org/")
driver.implicitly_wait(12)
driver.find_element_by_xpath("//*[@id='site-header']/mkt-header-child-toggle[1]").click()
driver.implicitly_wait(2)
driver.find_elem... | 32.642857 | 89 | 0.768053 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.get("https://marketplace-dev.allizom.org/")
driver.implicitly_wait(12)
driver.find_element_by_xpath("//*[@id='site-header']/mkt-header-child-toggle[1]").click()
driver.implicitly_wait(2)
driver.find_elem... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e878a653bed6af4c77d6e7170a7f48e98f6714ab | 1,797 | py | Python | crypto/CBC/script.py | killua4564/2019-AIS3-preexam | b13b5c9d3a2ec8beef7cca781154655bb51605e3 | [
"MIT"
] | 1 | 2019-06-15T11:45:41.000Z | 2019-06-15T11:45:41.000Z | crypto/CBC/script.py | killua4564/2019-AIS3-preexam | b13b5c9d3a2ec8beef7cca781154655bb51605e3 | [
"MIT"
] | null | null | null | crypto/CBC/script.py | killua4564/2019-AIS3-preexam | b13b5c9d3a2ec8beef7cca781154655bb51605e3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3.7
import os
BLOCK_SIZE = 256
P = [
(0, [1, 7]),
(1, [0, 8]),
(0, [5, 3]),
(1, [8, 6]),
(0, [3, 9]),
(1, [4, 0]),
(0, [9, 1]),
(1, [6, 2]),
(0, [7, 5]),
(1, [2, 4]),
]
if __name__ == "__main__":
pt1 = int(bytes.hex(os.urandom(BLOCK_SIZE // 8)), 16)
... | 22.185185 | 172 | 0.532554 | #!/usr/bin/env python3.7
import os
BLOCK_SIZE = 256
P = [
(0, [1, 7]),
(1, [0, 8]),
(0, [5, 3]),
(1, [8, 6]),
(0, [3, 9]),
(1, [4, 0]),
(0, [9, 1]),
(1, [6, 2]),
(0, [7, 5]),
(1, [2, 4]),
]
def n2B(b,length=BLOCK_SIZE):
return list(map(int, bin(b)[2:].rjust(BLOCK_SIZE, '0'... | 0 | 0 | 0 | 485 | 0 | 596 | 0 | 0 | 161 |
731f02051d4704d39819c9d637ac19e824c88971 | 1,458 | py | Python | mars/tensor/expressions/indexing/__init__.py | lmatz/mars | 45f9166b54eb91b21e66cef8b590a41aa8ac9569 | [
"Apache-2.0"
] | 1 | 2018-12-26T08:37:04.000Z | 2018-12-26T08:37:04.000Z | mars/tensor/expressions/indexing/__init__.py | lmatz/mars | 45f9166b54eb91b21e66cef8b590a41aa8ac9569 | [
"Apache-2.0"
] | null | null | null | mars/tensor/expressions/indexing/__init__.py | lmatz/mars | 45f9166b54eb91b21e66cef8b590a41aa8ac9569 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2018 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | 33.136364 | 78 | 0.74417 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2018 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | 0 | 0 | 0 | 0 | 0 | 468 | 0 | 121 | 200 |
de9a22e8bc66c80e5cec6686880dbeee8992b483 | 2,310 | py | Python | tokenmanager/api/token.py | liuqi0725/Vanas-Token-Manager | 04116089664ead51231f54a31404789bbd0fe99d | [
"Apache-2.0"
] | null | null | null | tokenmanager/api/token.py | liuqi0725/Vanas-Token-Manager | 04116089664ead51231f54a31404789bbd0fe99d | [
"Apache-2.0"
] | null | null | null | tokenmanager/api/token.py | liuqi0725/Vanas-Token-Manager | 04116089664ead51231f54a31404789bbd0fe99d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# @File : token.py
# @Created : 2020/10/23 5:59
# @Software : PyCharm
#
# @Author : Liu.Qi
# @Contact : liuqi_0725@aliyun.com
#
# @Desc : token api
# -------------------------------------------------... | 27.831325 | 81 | 0.534632 | # -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# @File : token.py
# @Created : 2020/10/23 5:59 下午
# @Software : PyCharm
#
# @Author : Liu.Qi
# @Contact : liuqi_0725@aliyun.com
#
# @Desc : token api
# -----------------------------------------------... | 288 | 1,531 | 0 | 0 | 0 | 0 | 0 | 128 | 136 |
1c4d8b65b4d7aeffb183c1e00ee9ec8465755010 | 5,630 | py | Python | src/the_tale/the_tale/linguistics/restrictions.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | null | null | null | src/the_tale/the_tale/linguistics/restrictions.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | null | null | null | src/the_tale/the_tale/linguistics/restrictions.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | null | null | null |
import smart_imports
smart_imports.all()
| 58.041237 | 137 | 0.656128 |
import smart_imports
smart_imports.all()
class GROUP(rels_django.DjangoEnum):
static_relation = rels.Column(unique=False, single_type=False, no_index=False)
sort = rels.Column(unique=False)
records = (('GENDER', 0, 'пол', game_relations.GENDER, True),
('RACE', 1, 'раса', game_relations.R... | 1,524 | 0 | 0 | 4,366 | 0 | 387 | 0 | 0 | 69 |
d74907fa31842c94195fd2f86948c4b7e76bc255 | 925 | py | Python | data/process_data.py | Robert-Alonso/DSND-Disaster-Response-Pipeline | 8fb71f0938f2779cf0c021dda3716d1dcba7cdb3 | [
"MIT"
] | null | null | null | data/process_data.py | Robert-Alonso/DSND-Disaster-Response-Pipeline | 8fb71f0938f2779cf0c021dda3716d1dcba7cdb3 | [
"MIT"
] | null | null | null | data/process_data.py | Robert-Alonso/DSND-Disaster-Response-Pipeline | 8fb71f0938f2779cf0c021dda3716d1dcba7cdb3 | [
"MIT"
] | null | null | null | import logging
if __name__ == '__main__':
import logging
logging.basicConfig(
filename='data/etl.log',
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
datefmt='%d-%b-%y %H:%M:%S',
level=logging.INFO
)
main() | 35.576923 | 80 | 0.629189 | import sys, logging
from etl import run_etl
def main():
if len(sys.argv) == 4:
messages_filepath, categories_filepath, database_filepath = sys.argv[1:]
run_etl(messages_filepath, categories_filepath, database_filepath)
else:
print('Please provide the filepaths of the messages and catego... | 0 | 0 | 0 | 0 | 0 | 599 | 0 | 7 | 45 |
e19a33382accf89df93c909621126b4e8f6fa83a | 175 | py | Python | legacy/verifyNTupleProduction.py | jjacob/DailyPythonScripts | cd6c515c6242d1f3b44e97c8ad05946721b6a36a | [
"Apache-2.0"
] | null | null | null | legacy/verifyNTupleProduction.py | jjacob/DailyPythonScripts | cd6c515c6242d1f3b44e97c8ad05946721b6a36a | [
"Apache-2.0"
] | null | null | null | legacy/verifyNTupleProduction.py | jjacob/DailyPythonScripts | cd6c515c6242d1f3b44e97c8ad05946721b6a36a | [
"Apache-2.0"
] | null | null | null | #test if the skim is as expected
#test the isolation distribution of (loose) leptons, show max isolation value!
#print list of found triggers
#print list of not found triggers | 43.75 | 78 | 0.794286 | #test if the skim is as expected
#test the isolation distribution of (loose) leptons, show max isolation value!
#print list of found triggers
#print list of not found triggers | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6f423fb08e481f5c68e6292dbbb11035e45639d1 | 9,939 | py | Python | electrum_dash/dash_ps_net.py | PanderMusubi/electrum-dash | 02cd655c57adba276bc17084bd4d1a105fb10bfe | [
"MIT"
] | 51 | 2018-01-09T01:44:49.000Z | 2022-02-22T13:28:43.000Z | electrum_dash/dash_ps_net.py | PanderMusubi/electrum-dash | 02cd655c57adba276bc17084bd4d1a105fb10bfe | [
"MIT"
] | 152 | 2017-07-11T16:24:56.000Z | 2022-03-21T13:29:39.000Z | electrum_dash/dash_ps_net.py | PanderMusubi/electrum-dash | 02cd655c57adba276bc17084bd4d1a105fb10bfe | [
"MIT"
] | 67 | 2018-01-11T23:54:50.000Z | 2022-03-29T21:59:23.000Z | # -*- coding: utf-8 -*-
PRIVATESEND_QUEUE_TIMEOUT = 30
PRIVATESEND_SESSION_MSG_TIMEOUT = 40
| 38.226923 | 79 | 0.596438 | # -*- coding: utf-8 -*-
import asyncio
import time
from bls_py import bls
from enum import IntEnum
from .bitcoin import address_to_script
from .dash_msg import (DSPoolStatusUpdate, DSMessageIDs, ds_msg_str,
ds_pool_state_str, DashDsaMsg, DashDsiMsg, DashDssMsg)
from .dash_tx import str_ip, CTxI... | 0 | 87 | 3,179 | 6,155 | 0 | 0 | 0 | 150 | 270 |
9667259f3f7eac99d4e9701336ac1d22d411c51b | 7,181 | py | Python | signbank/video/migrations/0006_copy_gloss_sn.py | codev/bslsignbank | 5c8f48c4aa14f48483b38f922f4bc4a4d4eda33e | [
"BSD-3-Clause"
] | 5 | 2016-01-19T04:06:40.000Z | 2020-05-01T17:10:46.000Z | signbank/video/migrations/0006_copy_gloss_sn.py | codev/bslsignbank | 5c8f48c4aa14f48483b38f922f4bc4a4d4eda33e | [
"BSD-3-Clause"
] | 2 | 2020-02-12T00:09:31.000Z | 2020-06-05T17:51:51.000Z | signbank/video/migrations/0006_copy_gloss_sn.py | codev/bslsignbank | 5c8f48c4aa14f48483b38f922f4bc4a4d4eda33e | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
| 65.880734 | 143 | 0.549227 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
# Note: Don't use "from appname.models import ModelName".
# Use orm.... | 0 | 0 | 0 | 7,030 | 0 | 0 | 0 | 16 | 111 |
1c64f05636527030e93e678562f4a845eb5c6339 | 1,298 | py | Python | devices.py | kongaskristjan/RoboticArm | 292362235c280892fff06414c32f6f58fcf7158c | [
"MIT"
] | null | null | null | devices.py | kongaskristjan/RoboticArm | 292362235c280892fff06414c32f6f58fcf7158c | [
"MIT"
] | null | null | null | devices.py | kongaskristjan/RoboticArm | 292362235c280892fff06414c32f6f58fcf7158c | [
"MIT"
] | null | null | null |
import pigpio
import math
minPulse = 500 # us
maxPulse = 2500 # us
minAngle = -math.pi / 2
maxAngle = math.pi / 2
pi = pigpio.pi()
| 27.617021 | 90 | 0.651002 |
import pigpio
import math
minPulse = 500 # us
maxPulse = 2500 # us
minAngle = -math.pi / 2
maxAngle = math.pi / 2
pi = pigpio.pi()
class Servo:
def __init__(self, gpio, offsetAngle=0):
self.gpio = gpio
self.offsetAngle = offsetAngle
pi.set_mode(gpio, pigpio.OUTPUT)
def setPosition(s... | 0 | 0 | 0 | 1,117 | 0 | 0 | 0 | 0 | 46 |
19a476201e881fd70ec02cca6b9c7e4d6cffe41e | 24,174 | py | Python | python/Unimeta/clinica/clinica.py | alifoliveira/rep-estudos | 73ffb7cfe77890f6cca8b5447db332f88454ef7e | [
"MIT"
] | null | null | null | python/Unimeta/clinica/clinica.py | alifoliveira/rep-estudos | 73ffb7cfe77890f6cca8b5447db332f88454ef7e | [
"MIT"
] | null | null | null | python/Unimeta/clinica/clinica.py | alifoliveira/rep-estudos | 73ffb7cfe77890f6cca8b5447db332f88454ef7e | [
"MIT"
] | null | null | null | # from validacoes import *
janela = Tk()
janela.title('Veterinario')
janela.geometry('350x350+200+100')
janela.resizable(width=False, height=False)
photo2 = PhotoImage(file='logo.png')
logo2 = Label(janela, image=photo2, bg='#292929')
logo2.pack(padx=0, pady=0)
loged = Label(janela, text='Seja Bem Vindo!', font=('... | 39.371336 | 248 | 0.581948 | from tkinter import *
import db
import sqlite3
import pycep_correios
# from validacoes import *
from tkinter import messagebox as mb
janela = Tk()
janela.title('Veterinario')
janela.geometry('350x350+200+100')
janela.resizable(width=False, height=False)
photo2 = PhotoImage(file='logo.png')
logo2 = Label(janela, im... | 30 | 0 | 0 | 21,395 | 0 | 1,813 | 0 | -4 | 480 |
c0e3ae70d3a0e39eda768a32959ea3f021cf71df | 1,955 | py | Python | R1_realistic.py | GUrbancic/ABOA_gust | 8b2eb19146bcb19d9913484333fa967f8148a39c | [
"MIT"
] | null | null | null | R1_realistic.py | GUrbancic/ABOA_gust | 8b2eb19146bcb19d9913484333fa967f8148a39c | [
"MIT"
] | null | null | null | R1_realistic.py | GUrbancic/ABOA_gust | 8b2eb19146bcb19d9913484333fa967f8148a39c | [
"MIT"
] | null | null | null | ##---------------------------------------------------------------------------
# R1_realistic.py
# G.Urbancic
#
# Takes raw .dat files:
# (1) removes NaN values and replace by interpolation
# (2) determines weather or not there is bad data during the day
# [x,y,z,T]< [35,35,35,25]
##-------------------... | 28.75 | 84 | 0.469565 | ##---------------------------------------------------------------------------
# R1_realistic.py
# G.Urbancic
#
# Takes raw .dat files:
# (1) removes NaN values and replace by interpolation
# (2) determines weather or not there is bad data during the day
# [x,y,z,T]< [35,35,35,25]
##-------------------... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e26ca251dacac7aced385e4b0b55a57c5b3db190 | 6,980 | py | Python | vision/train/visualize.py | BrianOfrim/boja | 6571fbbfb7f015e96e80e822d9dc96b4636b4119 | [
"MIT"
] | 7 | 2020-01-27T18:39:02.000Z | 2022-02-14T13:23:40.000Z | vision/train/visualize.py | a428tm/boja | 6571fbbfb7f015e96e80e822d9dc96b4636b4119 | [
"MIT"
] | 1 | 2021-06-02T00:55:25.000Z | 2021-06-02T00:55:25.000Z | vision/train/visualize.py | a428tm/boja | 6571fbbfb7f015e96e80e822d9dc96b4636b4119 | [
"MIT"
] | 6 | 2020-01-28T21:28:23.000Z | 2020-12-28T14:35:06.000Z |
import matplotlib
from .. import _models
from .._settings import (DEFAULT_LOCAL_DATA_DIR, DEFAULT_S3_DATA_DIR, NETWORKS)
matplotlib.use("TKAgg")
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
parser.add_argument(
"--local_data_dir",
type=str,
... | 27.698413 | 87 | 0.637249 | import time
import os
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import torch
import torchvision.transforms.functional as F
from .datasets import BojaDataSet
from .._file_utils import get_highest_numbered_file
from .._image_utils import draw_bboxes
from .. import _models
from .._s3_utils imp... | 0 | 0 | 0 | 0 | 0 | 5,245 | 0 | 294 | 290 |
5d54f0f64ef42dbc0d9170002ce775de1025d091 | 3,212 | py | Python | Jumpscale/clients/gitea/GiteaOrgMembers.py | threefoldtech/JumpscaleX | 5fb073a82aeb0e66fc7d9660c45a1e31bc094bfa | [
"Apache-2.0"
] | 2 | 2019-05-09T07:21:25.000Z | 2019-08-05T06:37:53.000Z | Jumpscale/clients/gitea/GiteaOrgMembers.py | threefoldtech/JumpscaleX | 5fb073a82aeb0e66fc7d9660c45a1e31bc094bfa | [
"Apache-2.0"
] | 664 | 2018-12-19T12:43:44.000Z | 2019-08-23T04:24:42.000Z | Jumpscale/clients/gitea/GiteaOrgMembers.py | threefoldtech/jumpscale10 | 5fb073a82aeb0e66fc7d9660c45a1e31bc094bfa | [
"Apache-2.0"
] | 7 | 2019-05-03T07:14:37.000Z | 2019-08-05T12:36:52.000Z | from Jumpscale import j
JSBASE = j.application.JSBaseClass
| 32.444444 | 119 | 0.588107 | from Jumpscale import j
JSBASE = j.application.JSBaseClass
class GiteaOrgMembers(j.application.JSBaseClass):
def __init__(self, client, organization):
JSBASE.__init__(self)
self.client = client
self.organization = organization
self.position = 0
def get(self, id, fetch=False)... | 0 | 355 | 0 | 2,772 | 0 | 0 | 0 | 0 | 23 |
8c36fcb26039f397e48da87ef4da6c06a9e65d3d | 737 | py | Python | notifications/backends/console.py | gaybro8777/django-notifs | f349fdf2dc87f2b579055c4e2abd95832ad9df5b | [
"MIT"
] | null | null | null | notifications/backends/console.py | gaybro8777/django-notifs | f349fdf2dc87f2b579055c4e2abd95832ad9df5b | [
"MIT"
] | null | null | null | notifications/backends/console.py | gaybro8777/django-notifs | f349fdf2dc87f2b579055c4e2abd95832ad9df5b | [
"MIT"
] | null | null | null | """Console backend"""
| 29.48 | 78 | 0.740841 | """Console backend"""
import logging
from unittest.mock import patch
from notifications.providers import BaseNotificationProvider
from .synchronous import SynchronousBackend
class ConsoleBackend(SynchronousBackend):
logger = logging.getLogger('django_notifs.backends.console')
def produce(self, provider, p... | 0 | 0 | 0 | 536 | 0 | 0 | 0 | 64 | 114 |
a41bdbaa004b298e5f42a2acde87ff7362b268f1 | 2,264 | py | Python | release_recency.py | woctezuma/steam-labs-recommender | 6f5ed3153643a412880f907e3ac5be9b3ba85ad1 | [
"MIT"
] | 3 | 2019-07-13T06:39:28.000Z | 2019-09-16T03:59:58.000Z | release_recency.py | woctezuma/steam-labs-recommender | 6f5ed3153643a412880f907e3ac5be9b3ba85ad1 | [
"MIT"
] | 3 | 2020-02-20T13:04:53.000Z | 2020-10-24T11:27:35.000Z | release_recency.py | woctezuma/steam-labs-recommender | 6f5ed3153643a412880f907e3ac5be9b3ba85ad1 | [
"MIT"
] | 1 | 2019-08-20T03:42:29.000Z | 2019-08-20T03:42:29.000Z |
if __name__ == '__main__':
main()
| 29.025641 | 119 | 0.640018 | import time
from datetime import datetime
from file_utils import load_app_info
def get_unix_time_stamp():
# Reference: https://stackoverflow.com/a/49362936
unix_time_stamp = time.time()
unix_time_stamp_as_int = int(unix_time_stamp)
return unix_time_stamp_as_int
def convert_str_to_unix_time_stamp... | 0 | 0 | 0 | 0 | 0 | 2,024 | 0 | 13 | 182 |
936313d112a9cdbb0c0b67af8e2b98762e80453b | 4,596 | py | Python | research/select_best_quandruple.py | isabella232/divans | 23459c22f8a63e0a70ef1b968402ae0b3682168f | [
"Apache-2.0"
] | 357 | 2017-06-14T20:59:06.000Z | 2022-02-16T22:50:39.000Z | research/select_best_quandruple.py | Esquive/divans | 23459c22f8a63e0a70ef1b968402ae0b3682168f | [
"Apache-2.0"
] | 9 | 2018-06-19T22:48:28.000Z | 2020-03-17T21:55:23.000Z | research/select_best_quandruple.py | Esquive/divans | 23459c22f8a63e0a70ef1b968402ae0b3682168f | [
"Apache-2.0"
] | 18 | 2018-06-19T22:31:25.000Z | 2021-04-19T22:28:48.000Z | import json
import sys
from collections import defaultdict
cut = True
best_other_alg = 'zlib'
if len(sys.argv) > 1 and 'b95' in sys.argv[1]:
best_other_alg = 'b95'
elif len(sys.argv) > 1 and 'b11' in sys.argv[1]:
best_other_alg = 'b11'
elif len(sys.argv) > 1:
assert 'zlib' in sys.argv[1]
sub_item = 6
combo_... | 41.405405 | 78 | 0.587903 | import json
import sys
from collections import defaultdict
cut = True
best_other_alg = 'zlib'
if len(sys.argv) > 1 and 'b95' in sys.argv[1]:
best_other_alg = 'b95'
elif len(sys.argv) > 1 and 'b11' in sys.argv[1]:
best_other_alg = 'b11'
elif len(sys.argv) > 1:
assert 'zlib' in sys.argv[1]
sub_item = 6
combo_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e89cf171fcd6d34777c1bbea6702999085322b8d | 613 | py | Python | IsingAnnealing/plot.py | karthik-r-rao/parallel-computing-it301 | 47930923e41229bdb8e0fa9aa06668e07bdee469 | [
"MIT"
] | null | null | null | IsingAnnealing/plot.py | karthik-r-rao/parallel-computing-it301 | 47930923e41229bdb8e0fa9aa06668e07bdee469 | [
"MIT"
] | null | null | null | IsingAnnealing/plot.py | karthik-r-rao/parallel-computing-it301 | 47930923e41229bdb8e0fa9aa06668e07bdee469 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
file1 = open("results.txt", "r")
file1 = file1.readlines()
vertices = []
s_times = []
p_times = []
for line in file1:
line = line.split()
if line[0][0] == 'S':
s_times.append(float(line[2]))
vertices.append(int(line[1]))
elif line[0][0] == 'P':
p_t... | 24.52 | 58 | 0.662316 | import matplotlib.pyplot as plt
file1 = open("results.txt", "r")
file1 = file1.readlines()
vertices = []
s_times = []
p_times = []
for line in file1:
line = line.split()
if line[0][0] == 'S':
s_times.append(float(line[2]))
vertices.append(int(line[1]))
elif line[0][0] == 'P':
p_t... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a89f8f5b61e60011ea5ebbe24b1259d44422bf0f | 1,503 | py | Python | think-python/code/rotate_pairs.py | baldoinov/think-python-2e-exercises | 5a5cd6e94f44e14dc567c35ebf3dd9160cf6b01b | [
"MIT"
] | null | null | null | think-python/code/rotate_pairs.py | baldoinov/think-python-2e-exercises | 5a5cd6e94f44e14dc567c35ebf3dd9160cf6b01b | [
"MIT"
] | null | null | null | think-python/code/rotate_pairs.py | baldoinov/think-python-2e-exercises | 5a5cd6e94f44e14dc567c35ebf3dd9160cf6b01b | [
"MIT"
] | null | null | null | """
Two words are rotate pairs if you can rotate one of them and get the other
(see rotate_word in Exercise 8.5).
Write a program that reads a wordlist and finds all the rotate pairs.
"""
from base_functions import make_worddict, in_bisect, my_rotate_word
def rotate_pairs(word_list: list) -> dict:
"""Takes a wo... | 23.123077 | 82 | 0.602129 | """
Two words are “rotate pairs” if you can rotate one of them and get the other
(see rotate_word in Exercise 8.5).
Write a program that reads a wordlist and finds all the rotate pairs.
"""
from base_functions import make_wordlist, make_worddict, in_bisect, my_rotate_word
def rotate_pairs(word_list: list) -> dict:
... | 6 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 0 |
19d936a919e9d1203331fb1766dd1b5a89520be1 | 6,991 | py | Python | falx/falx.py | fixator10/Red-Administrator | fb67feb64f06979b27106a561e785b267096e1eb | [
"MIT"
] | 1 | 2022-02-03T17:40:44.000Z | 2022-02-03T17:40:44.000Z | falx/falx.py | fixator10/Red-Administrator | fb67feb64f06979b27106a561e785b267096e1eb | [
"MIT"
] | null | null | null | falx/falx.py | fixator10/Red-Administrator | fb67feb64f06979b27106a561e785b267096e1eb | [
"MIT"
] | null | null | null |
DEFAULT_LEAVING_TEXT = (
"Someone on your server invited me ($bot_name) but your server is not whitelisted. "
"In order to add me in your server, you are required to contact my owner.\nFor that "
"reason, I will be leaving your server until you get whitelisted, then you'll be able to "
"invite me again... | 35.48731 | 121 | 0.610356 | from datetime import datetime
from string import Template
from typing import Optional, Union
import discord
from redbot.core import Config, commands
from redbot.core.bot import Red
from redbot.core.utils.chat_formatting import (
bold,
humanize_list,
humanize_number,
inline,
)
from .abc import Composit... | 0 | 0 | 3,127 | 2,689 | 0 | 84 | 0 | 184 | 290 |
09cc6c19f876edc4a27348727e8e2dcf60b22c4c | 670 | py | Python | rlcompletion/rlcompleter_demo.py | noelevans/playground | da529e967a15bcb217fff091ac0ec5c4dc1821ce | [
"MIT"
] | 1 | 2015-04-28T20:36:57.000Z | 2015-04-28T20:36:57.000Z | rlcompletion/rlcompleter_demo.py | noelevans/playground | da529e967a15bcb217fff091ac0ec5c4dc1821ce | [
"MIT"
] | 2 | 2021-02-03T21:05:54.000Z | 2021-03-23T09:25:43.000Z | rlcompletion/rlcompleter_demo.py | noelevans/playground | da529e967a15bcb217fff091ac0ec5c4dc1821ce | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
Klass().foo()
| 24.814815 | 52 | 0.616418 | import inspect
import rlcompleter
class Klass:
name = 'klass'
value = 2
def __getitem__(self, key):
return self.name[key]
def foo(self):
# Putative return statement for foo(self)...
# return self[self.value]
namespace = inspect.currentframe().f_locals
print(na... | 0 | 0 | 0 | 565 | 0 | 0 | 0 | -10 | 67 |
9e1fefc222815476da5d9a1579fb908d80c9fbc1 | 5,595 | py | Python | src/speechless/transcription.py | Exepp/SpeechLess | 6e7424e979f39132650db0d7426c1e9449dc43b8 | [
"MIT"
] | 1 | 2022-03-17T14:51:41.000Z | 2022-03-17T14:51:41.000Z | src/speechless/transcription.py | Exepp/SpeechLess | 6e7424e979f39132650db0d7426c1e9449dc43b8 | [
"MIT"
] | 14 | 2021-06-23T02:27:22.000Z | 2021-11-27T15:43:39.000Z | src/speechless/transcription.py | Exepp/SpeechLess | 6e7424e979f39132650db0d7426c1e9449dc43b8 | [
"MIT"
] | null | null | null | import deepspeech
import numpy
import os
from typing import List
from speechless.utils.storage import make_cache_dir_rel
from speechless.processing.tokenization import EditToken
SCORER_URL = 'https://github.com/mozilla/DeepSpeech/releases/download/v0.9.3/deepspeech-0.9.3-models.scorer'
MODEL_URL = 'https://github.co... | 29.447368 | 108 | 0.702055 | import deepspeech
import numpy
import os
import wget
from typing import List
from speechless.utils.storage import make_cache_dir_rel
from speechless.processing.tokenization import EditToken
SCORER_URL = 'https://github.com/mozilla/DeepSpeech/releases/download/v0.9.3/deepspeech-0.9.3-models.scorer'
MODEL_URL = 'https... | 0 | 0 | 0 | 0 | 0 | 147 | 0 | -10 | 45 |
465043eef7eac1c02bbff8ebef93bdee82b36f48 | 1,022 | py | Python | urbandict-search/http_query.py | jyothishkjames/examples | 2853e2cde70468d0425d1961234a6673c449e0db | [
"Apache-2.0"
] | 5 | 2021-07-22T14:20:05.000Z | 2022-03-15T02:30:46.000Z | urbandict-search/http_query.py | jyothishkjames/examples | 2853e2cde70468d0425d1961234a6673c449e0db | [
"Apache-2.0"
] | 4 | 2020-11-13T19:06:23.000Z | 2022-02-10T02:18:25.000Z | urbandict-search/http_query.py | jyothishkjames/examples | 2853e2cde70468d0425d1961234a6673c449e0db | [
"Apache-2.0"
] | 4 | 2021-07-25T14:00:36.000Z | 2021-11-26T20:36:29.000Z | __copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
if __name__ == "__main__":
main()
| 25.55 | 83 | 0.618395 | __copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
import click
from jina.clients import py_client
def read_query_data(text):
yield "{}".format(text).encode("utf8")
def print_topk(resp, word):
for d in resp.search.docs:
print(f"Ta-Dah🔮, here are ... | 4 | 355 | 0 | 0 | 48 | 354 | 0 | 4 | 115 |
26b1d0effd3f3b564b311b6c845143406fb7e932 | 3,149 | py | Python | python/SF_weather_to_cvs.py | leewalter/coding | 2afd9dbfc1ecb94def35b953f4195a310d6953c9 | [
"Apache-2.0"
] | null | null | null | python/SF_weather_to_cvs.py | leewalter/coding | 2afd9dbfc1ecb94def35b953f4195a310d6953c9 | [
"Apache-2.0"
] | null | null | null | python/SF_weather_to_cvs.py | leewalter/coding | 2afd9dbfc1ecb94def35b953f4195a310d6953c9 | [
"Apache-2.0"
] | 1 | 2020-08-29T17:12:52.000Z | 2020-08-29T17:12:52.000Z | '''
ref at https://github.com/aakankshaws/Python/blob/master/weather_data_bs4.py
https://medium.com/@aakankshaws/using-beautifulsoup-requests-to-scrape-weather-data-9c6e9d317800
Using BeautifulSoup, requests to scrape weather data, then save it into a timestamped cvs file
'''
import requests
from bs4 import BeautifulS... | 43.136986 | 96 | 0.511909 | '''
ref at https://github.com/aakankshaws/Python/blob/master/weather_data_bs4.py
https://medium.com/@aakankshaws/using-beautifulsoup-requests-to-scrape-weather-data-9c6e9d317800
Using BeautifulSoup, requests to scrape weather data, then save it into a timestamped cvs file
'''
import requests
from bs4 import BeautifulS... | 58 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
dbf1adccd12d7d5495f5a2d4b734f05acbe4bf77 | 5,925 | py | Python | run_utils/callbacks/serialize.py | shikhar-srivastava/hover_net | d4e8e129a4ad72f5d574a78c036449b496421529 | [
"MIT"
] | 222 | 2019-07-02T05:44:56.000Z | 2022-03-29T07:04:24.000Z | run_utils/callbacks/serialize.py | shikhar-srivastava/hover_net | d4e8e129a4ad72f5d574a78c036449b496421529 | [
"MIT"
] | 190 | 2019-06-28T16:17:21.000Z | 2022-03-29T14:32:48.000Z | run_utils/callbacks/serialize.py | shikhar-srivastava/hover_net | d4e8e129a4ad72f5d574a78c036449b496421529 | [
"MIT"
] | 124 | 2019-06-26T02:53:51.000Z | 2022-03-19T19:14:13.000Z | import cv2
import matplotlib
import numpy as np
# * syn where to set this
# must use 'Agg' to plot out onto image
matplotlib.use("Agg")
####
def fig2data(fig, dpi=180):
"""Convert a Matplotlib figure to a 4D numpy array with RGBA channels and return it.
Args:
fig: a matplotlib figure
Ret... | 31.515957 | 102 | 0.531983 | import cv2
import matplotlib
import numpy as np
from matplotlib import pyplot as plt
# * syn where to set this
# must use 'Agg' to plot out onto image
matplotlib.use("Agg")
####
def fig2data(fig, dpi=180):
"""Convert a Matplotlib figure to a 4D numpy array with RGBA channels and return it.
Args:
... | 0 | 4,446 | 0 | 11 | 0 | 365 | 0 | 15 | 350 |
ad031d28a858d393b0dc19ac71f1c1f07c0eb552 | 4,733 | py | Python | artifact/benchmark/generate-shortest-path-plot.py | p-offtermatt/FastForward | bf6bb6fefd03c640af25b2f5ea0a0dc053d47736 | [
"MIT"
] | null | null | null | artifact/benchmark/generate-shortest-path-plot.py | p-offtermatt/FastForward | bf6bb6fefd03c640af25b2f5ea0a0dc053d47736 | [
"MIT"
] | null | null | null | artifact/benchmark/generate-shortest-path-plot.py | p-offtermatt/FastForward | bf6bb6fefd03c640af25b2f5ea0a0dc053d47736 | [
"MIT"
] | null | null | null | import argparse
import plotting_utils as utils
TEXFILE_TEMPLATE = r"""
{###ENTRIES PLACEHOLDER###}
"""
ENTRY_TEMPLATE = r"""
\addplot[only marks, color={col{###TOOL NAME PLACEHOLDER###}}, mark={###TOOL MARK PLACEHOLDER###}] coordinates {{###POINTS PLACEHOLDER###}};
"""
TIME_LIMIT = 600000
if __nam... | 34.297101 | 189 | 0.631523 | import csv
import pandas
import sys
import json
from tabulate import tabulate
import argparse
import math
import plotting_utils as utils
def group_entries(entries, function):
group_to_entries = {}
for entry in entries:
group_name = function(entry)
group_to_entries[group_name] = group_to_entrie... | 0 | 0 | 0 | 0 | 0 | 3,145 | 0 | -42 | 224 |
0e9aeec9f878092fd04d7f1062c31534a18d1af5 | 2,633 | py | Python | tests/unit_tests/network/test_gene_network.py | hclimente/spada | c9584df9e25a597c70b67a6a0b7ce63283a11839 | [
"MIT"
] | 8 | 2018-01-12T12:52:42.000Z | 2022-03-18T17:44:30.000Z | tests/unit_tests/network/test_gene_network.py | hclimente/spada | c9584df9e25a597c70b67a6a0b7ce63283a11839 | [
"MIT"
] | 4 | 2018-08-02T21:28:39.000Z | 2021-12-16T02:20:27.000Z | tests/unit_tests/network/test_gene_network.py | hclimente/spada | c9584df9e25a597c70b67a6a0b7ce63283a11839 | [
"MIT"
] | null | null | null | from spada.methods import get_switches
import os
scriptPath = os.path.realpath(__file__)
dataPath = os.path.dirname(scriptPath) + "/../../data/"
g = get_switches.GetSwitches(dataPath + 'annotation.pklz')
g.run(dataPath + 'switches')
gn = g._genes
txs = g._txs
| 38.15942 | 141 | 0.64869 | from spada.methods import get_switches
from spada.network import gene_network
import os
import pickle
import pytest
scriptPath = os.path.realpath(__file__)
dataPath = os.path.dirname(scriptPath) + "/../../data/"
g = get_switches.GetSwitches(dataPath + 'annotation.pklz')
g.run(dataPath + 'switches')
gn = g._genes
tx... | 0 | 0 | 0 | 0 | 0 | 2,187 | 0 | 1 | 181 |
a17d2ed52d9cf8bf9467b6f72e69bb9583153ca0 | 9,723 | py | Python | tests/api/v3_1_1/test_node_services.py | CiscoISE/ciscoisesdk | 860b0fc7cc15d0c2a39c64608195a7ab3d5f4885 | [
"MIT"
] | 36 | 2021-05-18T16:24:19.000Z | 2022-03-05T13:44:41.000Z | tests/api/v3_1_1/test_node_services.py | CiscoISE/ciscoisesdk | 860b0fc7cc15d0c2a39c64608195a7ab3d5f4885 | [
"MIT"
] | 15 | 2021-06-08T19:03:37.000Z | 2022-02-25T14:47:33.000Z | tests/api/v3_1_1/test_node_services.py | CiscoISE/ciscoisesdk | 860b0fc7cc15d0c2a39c64608195a7ab3d5f4885 | [
"MIT"
] | 6 | 2021-06-10T09:32:01.000Z | 2022-01-12T08:34:39.000Z | # -*- coding: utf-8 -*-
"""IdentityServicesEngineAPI node_services API fixtures and tests.
Copyright (c) 2021 Cisco and/or its affiliates.
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 ... | 31.063898 | 115 | 0.700093 | # -*- coding: utf-8 -*-
"""IdentityServicesEngineAPI node_services API fixtures and tests.
Copyright (c) 2021 Cisco and/or its affiliates.
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 ... | 0 | 3,548 | 0 | 0 | 0 | 4,053 | 0 | 100 | 641 |
077e598841febfb6a8fb873d0f5e0df904dbb67a | 1,174 | py | Python | sitetree/tests/test_models.py | PetrDlouhy/django-sitetree | f9525b10771c4b461c260925b8c5fb59bc9f5449 | [
"BSD-3-Clause"
] | null | null | null | sitetree/tests/test_models.py | PetrDlouhy/django-sitetree | f9525b10771c4b461c260925b8c5fb59bc9f5449 | [
"BSD-3-Clause"
] | null | null | null | sitetree/tests/test_models.py | PetrDlouhy/django-sitetree | f9525b10771c4b461c260925b8c5fb59bc9f5449 | [
"BSD-3-Clause"
] | null | null | null | #! -*- encoding: utf-8 -*-
from __future__ import unicode_literals
| 21.345455 | 77 | 0.662692 | #! -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import pytest
@pytest.mark.django_db
def test_model_tree():
from sitetree.models import Tree
tree = Tree(alias='test')
tree.save()
assert str(tree) == tree.alias
assert tree.get_title() == tree.alias
with pytest.raises(Exce... | 0 | 1,042 | 0 | 0 | 0 | 0 | 0 | -8 | 69 |
e95c2c86c520cd5c84cbd115e3345a8914ce4ff5 | 591 | py | Python | src/generate.py | cadojo/Lord-Robot-Andy | f1688ff9e42a321ded29cd770fd839e26271960b | [
"MIT"
] | null | null | null | src/generate.py | cadojo/Lord-Robot-Andy | f1688ff9e42a321ded29cd770fd839e26271960b | [
"MIT"
] | null | null | null | src/generate.py | cadojo/Lord-Robot-Andy | f1688ff9e42a321ded29cd770fd839e26271960b | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# Let's use textgenrnn to train a natural language
# model with Lord Andy works!
# But first, imports
from textgenrnn import textgenrnn
# We need to instantiate a `textgenrnn` object
textgen = textgenrnn()
# Let's train the model with the script for Love Never Dies
textgen.reset()
textgen.train_f... | 29.55 | 79 | 0.683587 | #!/usr/bin/python3
# Let's use textgenrnn to train a natural language
# model with Lord Andy works!
# But first, imports
from textgenrnn import textgenrnn
# We need to instantiate a `textgenrnn` object
textgen = textgenrnn()
# Let's train the model with the script for Love Never Dies
textgen.reset()
textgen.train_f... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
146cc9018d5ef6450f57a3d2b42db0cedc611ef1 | 161 | py | Python | beegarden/common/urls.py | Shop-of-honey/Back-end | f6564f0142fe150b84d49a43f4a117f04cf8cea8 | [
"MIT"
] | null | null | null | beegarden/common/urls.py | Shop-of-honey/Back-end | f6564f0142fe150b84d49a43f4a117f04cf8cea8 | [
"MIT"
] | null | null | null | beegarden/common/urls.py | Shop-of-honey/Back-end | f6564f0142fe150b84d49a43f4a117f04cf8cea8 | [
"MIT"
] | null | null | null | from django.urls import path
from common import views
app_name = 'common'
urlpatterns = [
path('health-check/', views.health_check, name='health-check')
]
| 17.888889 | 66 | 0.726708 | from django.urls import path
from common import views
app_name = 'common'
urlpatterns = [
path('health-check/', views.health_check, name='health-check')
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3151dc89f258db4846591f38641e9f697c7a4e48 | 6,715 | bzl | Python | tools/test/test.bzl | grab/grab-bazel-common | f94294d949ad9e4665baf582cf95c7293919608e | [
"Apache-2.0"
] | 15 | 2021-06-25T11:03:20.000Z | 2022-03-09T07:20:04.000Z | tools/test/test.bzl | grab/grab-bazel-common | f94294d949ad9e4665baf582cf95c7293919608e | [
"Apache-2.0"
] | 12 | 2021-07-28T08:27:01.000Z | 2022-03-15T08:35:43.000Z | tools/test/test.bzl | grab/grab-bazel-common | f94294d949ad9e4665baf582cf95c7293919608e | [
"Apache-2.0"
] | 5 | 2021-07-28T12:43:33.000Z | 2021-12-14T17:37:39.000Z | load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_jvm_library")
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_jvm_test")
load(":runtime_resources.bzl", "runtime_resources")
def grab_android_local_test(
name,
srcs,
deps,
associates = [],
custom_package = "",
*... | 39.5 | 147 | 0.637528 | load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_jvm_library")
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_jvm_test")
load(":runtime_resources.bzl", "runtime_resources")
def grab_android_local_test(
name,
srcs,
deps,
associates = [],
custom_package = "",
*... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6f4bb16ba1751ae86819c0cb15d8a28b6d3f35e0 | 2,987 | py | Python | assignment3/src/dc.py | nilax97/col774 | 5a8cb575e864765a7d039bbadb624fac8c297e44 | [
"MIT"
] | 5 | 2021-05-31T07:03:36.000Z | 2022-01-31T11:51:05.000Z | assignment3/src/dc.py | nilax97/col774 | 5a8cb575e864765a7d039bbadb624fac8c297e44 | [
"MIT"
] | null | null | null | assignment3/src/dc.py | nilax97/col774 | 5a8cb575e864765a7d039bbadb624fac8c297e44 | [
"MIT"
] | null | null | null | import numpy as np
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score
import sys
import warnings
if not sys.warnoptions:
warnings.simplefilter("ignore")
sub_part = int(sys.argv[1]);
path_train = sys.argv[2];
path_test = sys.a... | 32.11828 | 93 | 0.686977 | import numpy as np
import pandas as pd
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score, confusion_matrix, classification_report, log_loss
import time
import sys
import warnings
if not sys.warnoptions:
warnings.simplefilter... | 0 | 0 | 0 | 0 | 0 | 557 | 0 | 39 | 95 |
6afec7b60d6bfe4b12e2947a4a1600cfb7ce0785 | 7,497 | py | Python | train.py | mikpat/DL-Project | 1b6e54aa4037f3ca511175d654c59d49d372e5df | [
"MIT"
] | null | null | null | train.py | mikpat/DL-Project | 1b6e54aa4037f3ca511175d654c59d49d372e5df | [
"MIT"
] | null | null | null | train.py | mikpat/DL-Project | 1b6e54aa4037f3ca511175d654c59d49d372e5df | [
"MIT"
] | 1 | 2020-01-17T14:22:10.000Z | 2020-01-17T14:22:10.000Z | import numpy as np
import pandas as pd
from keras.callbacks import EarlyStopping, ReduceLROnPlateau, ModelCheckpoint, TensorBoard
from sklearn.model_selection import train_test_split
import sys
import params
input_size = params.input_size
epochs = params.max_epochs
batch_size = params.batch_size
df_train = pd.read_c... | 43.587209 | 111 | 0.519274 | import cv2
import numpy as np
import pandas as pd
from keras.callbacks import EarlyStopping, ReduceLROnPlateau, ModelCheckpoint, TensorBoard
from sklearn.model_selection import train_test_split
import sys
import params
input_size = params.input_size
epochs = params.max_epochs
batch_size = params.batch_size
df_train ... | 0 | 0 | 0 | 0 | 2,367 | 2,747 | 0 | -11 | 137 |
831ee1a59e768390a01d7ed5e7b4b97fd71fbd70 | 9,880 | py | Python | image_processing.py | Chthol1y/GadioVideo | b0ef25ba6fab09fbf9b26d548b8a6573c5f9730a | [
"MIT"
] | 2 | 2020-09-30T12:18:50.000Z | 2021-01-05T17:29:38.000Z | image_processing.py | Chthol1y/GadioVideo | b0ef25ba6fab09fbf9b26d548b8a6573c5f9730a | [
"MIT"
] | null | null | null | image_processing.py | Chthol1y/GadioVideo | b0ef25ba6fab09fbf9b26d548b8a6573c5f9730a | [
"MIT"
] | null | null | null | from PIL import ImageFont
if __name__ == "__main__":
main()
font = ImageFont.truetype("msyh.ttc", 40, encoding="utf-8")
font.getsize_multiline
| 47.272727 | 131 | 0.728745 | import os
from PIL import Image, ImageDraw, ImageFont
import cv2
import numpy as np
from cv2 import VideoWriter, VideoWriter_fourcc
import crawler
from config import config
import text_processing
def create_frame(image_name, title, content, size, title_wrapper, content_wrapper, title_font, content_font):
margin ... | 0 | 0 | 0 | 0 | 0 | 9,358 | 0 | 16 | 341 |
a4a0026265b68333aa6d7614f97b32a9f0201759 | 1,654 | py | Python | 3rdparty/openmm/wrappers/python/tests/TestGromacsGroFile.py | merkys/MMB | 0531385b8367405e1188e31c3eef7aa4cc50170b | [
"MIT"
] | 5 | 2020-07-31T17:33:03.000Z | 2022-01-01T19:24:37.000Z | 3rdparty/openmm/wrappers/python/tests/TestGromacsGroFile.py | merkys/MMB | 0531385b8367405e1188e31c3eef7aa4cc50170b | [
"MIT"
] | 11 | 2020-06-16T05:05:42.000Z | 2022-03-30T09:59:14.000Z | 3rdparty/openmm/wrappers/python/tests/TestGromacsGroFile.py | merkys/MMB | 0531385b8367405e1188e31c3eef7aa4cc50170b | [
"MIT"
] | 9 | 2020-01-24T12:02:37.000Z | 2020-10-16T06:23:56.000Z | import unittest
if __name__ == '__main__':
unittest.main()
| 38.465116 | 85 | 0.580411 | import unittest
from simtk.openmm.app import *
from simtk.openmm import *
from simtk.unit import *
import simtk.openmm.app.element as elem
class TestGromacsGroFile(unittest.TestCase):
"""Test the Gromacs GRO file parser"""
def test_Triclinic(self):
"""Test parsing a file that describes a triclinic bo... | 0 | 0 | 0 | 1,444 | 0 | 0 | 0 | 35 | 111 |
0622a62e14a10a3cdc46f9c67bfb4ea682f15267 | 1,005 | py | Python | djangorest_routes/config/production.py | israelabraham/djangorest-auth-as-a-service | 1cec96860ee95775f30f6fff407a8a00f996a249 | [
"MIT"
] | 1 | 2022-03-31T21:57:23.000Z | 2022-03-31T21:57:23.000Z | djangorest_routes/config/production.py | israelabraham/djangorest-auth-as-a-service | 1cec96860ee95775f30f6fff407a8a00f996a249 | [
"MIT"
] | null | null | null | djangorest_routes/config/production.py | israelabraham/djangorest-auth-as-a-service | 1cec96860ee95775f30f6fff407a8a00f996a249 | [
"MIT"
] | null | null | null |
DEBUG = env("DEBUG")
ALLOWED_HOSTS += ["djangorest_auth.digitalstade.com", "djangorest_auth.herokuapp.com"]
# Database
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
DATABASES = {
"default": dj_database_url.parse(env("DATABASE_URL")),
}
# Application Definition
INSTALLED_APPS += []
# Stati... | 21.847826 | 86 | 0.777114 | from djangorest_routes.config.base import *
DEBUG = env("DEBUG")
ALLOWED_HOSTS += ["djangorest_auth.digitalstade.com", "djangorest_auth.herokuapp.com"]
# Database
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
DATABASES = {
"default": dj_database_url.parse(env("DATABASE_URL")),
}
# Applicati... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 | 22 |
a4929bebf594a2f25445f8ca41ad913d7881e21b | 1,250 | py | Python | cluster.py | yusonghust/RGAE | 0b8c6ff5039a91c74528dd5ad3081e673126e1d8 | [
"MIT"
] | null | null | null | cluster.py | yusonghust/RGAE | 0b8c6ff5039a91c74528dd5ad3081e673126e1d8 | [
"MIT"
] | null | null | null | cluster.py | yusonghust/RGAE | 0b8c6ff5039a91c74528dd5ad3081e673126e1d8 | [
"MIT"
] | null | null | null | import sys
import os
import warnings
if not sys.warnoptions:
warnings.simplefilter("ignore")
os.environ["PYTHONWARNINGS"] = "ignore" # Also affect subprocesses
| 37.878788 | 137 | 0.7144 | from sklearn.cluster import KMeans
import numpy as np
import logging
import sys
import os
import warnings
from sklearn import metrics
from sklearn.metrics.cluster import normalized_mutual_info_score
from sklearn.metrics.cluster import adjusted_mutual_info_score
if not sys.warnoptions:
warnings.simplefilter("ignore... | 0 | 0 | 0 | 0 | 0 | 832 | 0 | 93 | 155 |
7d4d2ba356c51dd02fc5e0305adad3576558cfc1 | 11,639 | py | Python | robust_pca.py | bagustris/advanced_training | 9b96ecc0bb6c913d12cd33b51cfe6ba80a5a58b0 | [
"BSD-2-Clause"
] | 132 | 2016-06-06T17:30:23.000Z | 2021-11-16T13:51:36.000Z | robust_pca.py | afcarl/advanced_training | 1ef9246e2f70b82295bb3c4dc9a283e32fd427fb | [
"BSD-2-Clause"
] | 1 | 2017-03-08T19:49:13.000Z | 2017-03-08T19:55:03.000Z | robust_pca.py | afcarl/advanced_training | 1ef9246e2f70b82295bb3c4dc9a283e32fd427fb | [
"BSD-2-Clause"
] | 47 | 2016-06-07T09:39:22.000Z | 2021-09-01T01:45:44.000Z | import numpy as np
from sklearn.utils.extmath import randomized_svd
from numpy.linalg import norm
import warnings
def _soft_thresh(X, threshold):
"Apply soft thresholding to an array"
sign = np.sign(X)
return np.multiply(sign, np.maximum(np.abs(X) - threshold, 0))
def _sv_thresh(X, threshold, num_sval... | 36.949206 | 85 | 0.618008 | import numpy as np
from sklearn.utils.validation import check_is_fitted
from sklearn.utils.extmath import randomized_svd
from sklearn.utils.validation import check_array
from sklearn.base import BaseEstimator, TransformerMixin
from numpy.linalg import norm
import warnings
def _soft_thresh(X, threshold):
"Apply so... | 0 | 0 | 0 | 5,755 | 0 | 22 | 0 | 93 | 112 |
02637b87a9e8312c0e51504c49b325b3f6811480 | 21,825 | py | Python | pysnmp-with-texts/CISCO-WLAN-VLAN-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/CISCO-WLAN-VLAN-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/CISCO-WLAN-VLAN-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 CISCO-WLAN-VLAN-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-WLAN-VLAN-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:00:14 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default... | 169.186047 | 1,849 | 0.787858 | #
# PySNMP MIB module CISCO-WLAN-VLAN-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-WLAN-VLAN-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:00:14 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default... | 0 | 0 | 0 | 500 | 0 | 0 | 0 | 0 | 22 |
fba64ee6b4cb69f509bc722eab061b0175eb7564 | 1,571 | py | Python | surveys/migrations/0007_auto_20201125_2112.py | larkes00/surveys | 2b63a5ee5f308b8d2fe3e8e9a8ed616e30b804f7 | [
"MIT"
] | null | null | null | surveys/migrations/0007_auto_20201125_2112.py | larkes00/surveys | 2b63a5ee5f308b8d2fe3e8e9a8ed616e30b804f7 | [
"MIT"
] | null | null | null | surveys/migrations/0007_auto_20201125_2112.py | larkes00/surveys | 2b63a5ee5f308b8d2fe3e8e9a8ed616e30b804f7 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2020-11-25 21:12
# pylint: disable=invalid-name
| 29.641509 | 83 | 0.538511 | # Generated by Django 3.1.1 on 2020-11-25 21:12
# pylint: disable=invalid-name
from django.db import migrations
from django.db import models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("surveys", "0006_auto_20201119_0807"),
]
operations = [
... | 0 | 0 | 0 | 1,372 | 0 | 0 | 0 | 29 | 90 |
23960ca4143a81e80d8528952a5c49444ac862ae | 4,910 | py | Python | Inverted_Pendulum/fuzzy/set/Triangle.py | ghazaleh-mahmoodi/-Preceptron-Implementation-without-framework | 22bd8bbdc7d5a55915b9227ee3d142ab7a498028 | [
"MIT"
] | 1 | 2021-11-29T03:07:26.000Z | 2021-11-29T03:07:26.000Z | Inverted_Pendulum/fuzzy/set/Triangle.py | ghazaleh-mahmoodi/-Preceptron-Implementation-without-framework | 22bd8bbdc7d5a55915b9227ee3d142ab7a498028 | [
"MIT"
] | null | null | null | Inverted_Pendulum/fuzzy/set/Triangle.py | ghazaleh-mahmoodi/-Preceptron-Implementation-without-framework | 22bd8bbdc7d5a55915b9227ee3d142ab7a498028 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Rene Liebscher
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option) any
# later version.... | 31.474359 | 79 | 0.571487 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Rene Liebscher
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option) any
# later version.... | 0 | 1,536 | 0 | 2,392 | 0 | 0 | 0 | 44 | 90 |
ba91ff434c699532d9542f7f590d9b282ef36db1 | 3,423 | py | Python | python/alg/tps_test.py | schwehr/gdal-autotest2 | e153b594162f6554280212d919e645b0f01bf7e6 | [
"Apache-2.0"
] | null | null | null | python/alg/tps_test.py | schwehr/gdal-autotest2 | e153b594162f6554280212d919e645b0f01bf7e6 | [
"Apache-2.0"
] | 4 | 2017-01-25T18:11:31.000Z | 2017-04-04T20:51:45.000Z | python/alg/tps_test.py | schwehr/gdal-autotest2 | e153b594162f6554280212d919e645b0f01bf7e6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 37.615385 | 79 | 0.703476 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 0 | 0 | 0 | 1,236 | 0 | 0 | 0 | 18 | 91 |
020c8bb2a014de9d4aa0f6a0977fd9ca59b0a287 | 7,379 | py | Python | corehq/apps/hqcase/management/commands/reindex_es_native.py | akashkj/commcare-hq | b00a62336ec26cea1477dfb8c048c548cc462831 | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/hqcase/management/commands/reindex_es_native.py | akashkj/commcare-hq | b00a62336ec26cea1477dfb8c048c548cc462831 | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/hqcase/management/commands/reindex_es_native.py | akashkj/commcare-hq | b00a62336ec26cea1477dfb8c048c548cc462831 | [
"BSD-3-Clause"
] | null | null | null |
USAGE = """Reindex data from one ES index into another ES index using Elasticsearch reindex API
https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#reindex-from-remote.
"""
| 38.233161 | 110 | 0.632064 | import inspect
import time
from datetime import timedelta
from django.core.management.base import BaseCommand, CommandError
from corehq.apps.es.registry import get_registry, registry_entry
from corehq.elastic import get_es_export
from pillowtop.es_utils import initialize_index, set_index_reindex_settings
USAGE = """... | 0 | 0 | 0 | 2,483 | 0 | 4,236 | 0 | 152 | 294 |
1505bbe880cea0c5060f6906e723c76f7bd6d9fa | 3,442 | py | Python | tools/serialrosbags.py | cedricxie/SDC-System-Integration | e21847606b7ce53b3e3ad09341ae72f8e877739a | [
"MIT"
] | null | null | null | tools/serialrosbags.py | cedricxie/SDC-System-Integration | e21847606b7ce53b3e3ad09341ae72f8e877739a | [
"MIT"
] | null | null | null | tools/serialrosbags.py | cedricxie/SDC-System-Integration | e21847606b7ce53b3e3ad09341ae72f8e877739a | [
"MIT"
] | 3 | 2018-02-26T14:26:18.000Z | 2020-02-17T00:02:16.000Z | #!/usr/bin/python
"""
serialrosbags.py: version 0.2.0
History:
2016/10/13: Initial version stream multiple rosbags in sync.
"""
| 34.079208 | 153 | 0.59326 | #!/usr/bin/python
"""
serialrosbags.py: version 0.2.0
History:
2016/10/13: Initial version stream multiple rosbags in sync.
"""
import sys
import rosbag
class Bags():
bags = []
nextmsgIdx = []
nextmsg = []
currentidx = -1
currentmsg = {}
currentbag = ""
currenttime = -1
mytopics = []
def __init__(... | 0 | 0 | 0 | 3,263 | 0 | 0 | 0 | -19 | 68 |
e517c8af2c64c1ceeca2825b691086ffdc9c1492 | 97 | py | Python | 7.randomNum.py | A-Little-Hat/Python-Basics | f7e5177ecedbda990c157e4cb9977b254e551a21 | [
"MIT"
] | null | null | null | 7.randomNum.py | A-Little-Hat/Python-Basics | f7e5177ecedbda990c157e4cb9977b254e551a21 | [
"MIT"
] | 1 | 2021-04-24T07:46:27.000Z | 2021-04-24T07:46:27.000Z | 7.randomNum.py | A-Little-Hat/Python-Basics | f7e5177ecedbda990c157e4cb9977b254e551a21 | [
"MIT"
] | 1 | 2021-05-20T19:03:14.000Z | 2021-05-20T19:03:14.000Z | import random
print(random.random() )
print(random.randint(10,99))
print(random.randrange(10,99)) | 24.25 | 30 | 0.773196 | import random
print(random.random() )
print(random.randint(10,99))
print(random.randrange(10,99)) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7ecddbda761daef0abbe317f1711f34ab13ea2ba | 259 | py | Python | examples/core/create_dataset.py | gugarosa/textfier | 31d245218978a5a4c31f22b0fb13597327fb7d23 | [
"Apache-2.0"
] | 2 | 2020-09-12T01:47:40.000Z | 2020-10-01T22:35:39.000Z | examples/core/create_dataset.py | gugarosa/textfier | 31d245218978a5a4c31f22b0fb13597327fb7d23 | [
"Apache-2.0"
] | null | null | null | examples/core/create_dataset.py | gugarosa/textfier | 31d245218978a5a4c31f22b0fb13597327fb7d23 | [
"Apache-2.0"
] | null | null | null | from textfier.core import Dataset
# Defines the input sequences
sentences = ['hey', 'lets go']
# Defines the input labels
labels = [0, 0]
# Creates the dataset
dataset = Dataset(sentences=sentences, labels=labels)
print(dataset.sentences, dataset.labels)
| 19.923077 | 53 | 0.752896 | from textfier.core import Dataset
# Defines the input sequences
sentences = ['hey', 'lets go']
# Defines the input labels
labels = [0, 0]
# Creates the dataset
dataset = Dataset(sentences=sentences, labels=labels)
print(dataset.sentences, dataset.labels)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
abc510a1cd616131a2f082c11fc091da34ef4d85 | 1,912 | py | Python | data/BBDD SQL.py | martihomssoler/uepa | 72948d5a90d5b9c73e364ef733ca95ead10358d3 | [
"MIT"
] | null | null | null | data/BBDD SQL.py | martihomssoler/uepa | 72948d5a90d5b9c73e364ef733ca95ead10358d3 | [
"MIT"
] | null | null | null | data/BBDD SQL.py | martihomssoler/uepa | 72948d5a90d5b9c73e364ef733ca95ead10358d3 | [
"MIT"
] | 1 | 2020-04-11T11:32:37.000Z | 2020-04-11T11:32:37.000Z | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
import sqlite3
print('Libraries imported.')
# In[ ]:
conn=sqlite3.connect('greendots.db')
cur=conn.cursor()
# In[ ]:
SQL1= """
CREATE TABLE DB_Veins (
Codi Veina TEXT,
Nom TEXT,
Barri TEXT
)"""
# In[ ]:
SQL2= """
CREATE TABLE DB_Barris (
D... | 15.672131 | 111 | 0.60931 | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
import pandas as pd
import sqlite3
import numpy as np
import csv
import sys
print('Libraries imported.')
# In[ ]:
conn=sqlite3.connect('greendots.db')
cur=conn.cursor()
# In[ ]:
SQL1= """
CREATE TABLE DB_Veins (
Codi Veina TEXT,
Nom TEXT,
Barri TEXT... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -27 | 90 |
aed602876f2447b6ff9572f790d870bf1ac61c0f | 3,980 | py | Python | tests/functional/test_links.py | jounile/nollanet | 7bea20934d3f5e09658a9d31c3b05c15416398a0 | [
"MIT"
] | 3 | 2019-10-13T08:37:13.000Z | 2020-02-16T12:24:11.000Z | tests/functional/test_links.py | jounile/nollanet | 7bea20934d3f5e09658a9d31c3b05c15416398a0 | [
"MIT"
] | 5 | 2019-11-13T15:56:52.000Z | 2021-04-30T20:58:19.000Z | tests/functional/test_links.py | jounile/nollanet | 7bea20934d3f5e09658a9d31c3b05c15416398a0 | [
"MIT"
] | 1 | 2020-04-08T21:09:52.000Z | 2020-04-08T21:09:52.000Z | from urllib.parse import urljoin
def test_valid_new_link_page(wait_for_api, login_user):
"""
GIVEN a user has logged in (login_user)
WHEN the '/links/new' page is navigated to (GET)
THEN check the response is valid and page title is correct
"""
request_session, api_url = wait_for_api
respon... | 42.340426 | 117 | 0.723116 | import pytest
from requests import get
from urllib.parse import urljoin
def test_valid_new_link_page(wait_for_api, login_user):
"""
GIVEN a user has logged in (login_user)
WHEN the '/links/new' page is navigated to (GET)
THEN check the response is valid and page title is correct
"""
request_ses... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -5 | 44 |
a0fe0a80f6164587f784806eb77e4664eb3d9204 | 724 | py | Python | test.py | ArthurRosso/mechgcoin | 70e48eeb663313c0ae5d04a1f2e374686eec219c | [
"MIT"
] | null | null | null | test.py | ArthurRosso/mechgcoin | 70e48eeb663313c0ae5d04a1f2e374686eec219c | [
"MIT"
] | null | null | null | test.py | ArthurRosso/mechgcoin | 70e48eeb663313c0ae5d04a1f2e374686eec219c | [
"MIT"
] | null | null | null | from blockchain import BlockChain
blockchain = BlockChain()
print("***Mining mechgCoin about to start***")
print(blockchain.chain)
last_block = blockchain.latest_block
last_proof_no = last_block.proof_no
proof_no = blockchain.proof_of_work(last_proof_no)
blockchain.new_data(
sender="0", #it implies... | 30.166667 | 82 | 0.744475 | from blockchain import BlockChain
from block import Block
blockchain = BlockChain()
print("***Mining mechgCoin about to start***")
print(blockchain.chain)
last_block = blockchain.latest_block
last_proof_no = last_block.proof_no
proof_no = blockchain.proof_of_work(last_proof_no)
blockchain.new_data(
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 23 |
43becd428fa88e3087c3662f0e4178bf0dbab624 | 42,521 | py | Python | tanjun/conversion.py | thesadru/Tanjun | 977eacbd2b0eeafd14a30450aceeb9e329703edd | [
"BSD-3-Clause"
] | null | null | null | tanjun/conversion.py | thesadru/Tanjun | 977eacbd2b0eeafd14a30450aceeb9e329703edd | [
"BSD-3-Clause"
] | null | null | null | tanjun/conversion.py | thesadru/Tanjun | 977eacbd2b0eeafd14a30450aceeb9e329703edd | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# cython: language_level=3
# BSD 3-Clause License
#
# Copyright (c) 2020-2022, Faster Speeding
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of sour... | 29.064252 | 121 | 0.651984 | # -*- coding: utf-8 -*-
# cython: language_level=3
# BSD 3-Clause License
#
# Copyright (c) 2020-2022, Faster Speeding
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of sour... | 0 | 6,949 | 9,368 | 6,870 | 0 | 3,841 | 0 | -5 | 506 |
858a3372435e985f3253ebb241ef908af57ded22 | 3,901 | py | Python | app.py | Robbe7730/SADStatus | 754a8e359446ddc7f09d8d91ddc2f3392473b121 | [
"MIT"
] | null | null | null | app.py | Robbe7730/SADStatus | 754a8e359446ddc7f09d8d91ddc2f3392473b121 | [
"MIT"
] | null | null | null | app.py | Robbe7730/SADStatus | 754a8e359446ddc7f09d8d91ddc2f3392473b121 | [
"MIT"
] | null | null | null | import urllib.request
from flask import Flask
app = Flask(__name__)
STATUS = {}
| 33.921739 | 83 | 0.579851 | import json
import urllib.request
import urllib.error
from enum import Enum
from flask import Flask, render_template
app = Flask(__name__)
STATUS = {}
@app.route("/")
def message():
# update
update_status()
return render_template(
"status.html",
ServiceStatus=ServiceStatus,
statu... | 0 | 334 | 0 | 360 | 0 | 2,938 | 0 | 5 | 181 |
b722bff91379bc43db1d55207737ac728cd9d79d | 776 | py | Python | tests/mlir/test-reuse.py | chhzh123/heterocl | 856e9b8ad877d11280a7e457e91ca89803c05570 | [
"Apache-2.0"
] | null | null | null | tests/mlir/test-reuse.py | chhzh123/heterocl | 856e9b8ad877d11280a7e457e91ca89803c05570 | [
"Apache-2.0"
] | null | null | null | tests/mlir/test-reuse.py | chhzh123/heterocl | 856e9b8ad877d11280a7e457e91ca89803c05570 | [
"Apache-2.0"
] | null | null | null |
test_conv2D_lb_wb() | 31.04 | 84 | 0.596649 | import heterocl as hcl
import numpy as np
def test_conv2D_lb_wb():
hcl.init()
A = hcl.placeholder((6, 6), "A")
rx = hcl.reduce_axis(0, 3, "rx")
ry = hcl.reduce_axis(0, 3, "ry")
B = hcl.compute((4, 4), lambda i, j: hcl.sum(A[i+rx, j+ry], axis=[rx, ry]), "B")
s = hcl.create_schedule([A, B])
L... | 0 | 0 | 0 | 0 | 0 | 691 | 0 | -2 | 67 |
36f439348c34ef982a03906c42e32d0700b10ef2 | 1,455 | py | Python | questions/min-cost-climbing-stairs/Solution.py | marcus-aurelianus/leetcode-solutions | 8b43e72fe1f51c84abc3e89b181ca51f09dc7ca6 | [
"MIT"
] | 141 | 2017-12-12T21:45:53.000Z | 2022-03-25T07:03:39.000Z | questions/min-cost-climbing-stairs/Solution.py | marcus-aurelianus/leetcode-solutions | 8b43e72fe1f51c84abc3e89b181ca51f09dc7ca6 | [
"MIT"
] | 32 | 2015-10-05T14:09:52.000Z | 2021-05-30T10:28:41.000Z | questions/min-cost-climbing-stairs/Solution.py | marcus-aurelianus/leetcode-solutions | 8b43e72fe1f51c84abc3e89b181ca51f09dc7ca6 | [
"MIT"
] | 56 | 2015-09-30T05:23:28.000Z | 2022-03-08T07:57:11.000Z | """
On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed).
Once you pay the cost, you can either climb one or two steps. You need to find minimum cost to reach the top of the floor, and you can either start from the step with index 0, or the step with index 1.
Example 1:
Input: cost = ... | 33.837209 | 201 | 0.584192 | """
On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed).
Once you pay the cost, you can either climb one or two steps. You need to find minimum cost to reach the top of the floor, and you can either start from the step with index 0, or the step with index 1.
Example 1:
Input: cost = ... | 0 | 0 | 0 | 744 | 0 | 0 | 0 | 0 | 22 |
b6ff2b8325433fb4deb1a17ba00ddaa0d9fcdac0 | 728 | py | Python | tests/alltests.py | maxlampe/panter | 7056753f203e57dab57a110329aacb2f899a154a | [
"MIT"
] | null | null | null | tests/alltests.py | maxlampe/panter | 7056753f203e57dab57a110329aacb2f899a154a | [
"MIT"
] | null | null | null | tests/alltests.py | maxlampe/panter | 7056753f203e57dab57a110329aacb2f899a154a | [
"MIT"
] | null | null | null | """Module for running all unit tests of panter."""
import numpy as np
from tests.background_subtraction import do_backgroundfittest
from tests.basicfit import do_histtestfit
from tests.filter import do_histtestfilter
from tests.hist_output import do_histtestout
from tests.histogram import do_histtestbasic
def run_a... | 23.483871 | 66 | 0.701923 | """Module for running all unit tests of panter."""
import numpy as np
from tests.background_subtraction import do_backgroundfittest
from tests.basicfit import do_histtestfit
from tests.filter import do_histtestfilter
from tests.hist_output import do_histtestout
from tests.histogram import do_histtestbasic
def run_a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a00d3cd8aef50d380dd9cb8a1fdb5e6960436732 | 764 | py | Python | .github/helper/semgrep_rules/ux.py | alijasim/frappe | 17803d5408d0a0257ab6968acb1a847a582b07ce | [
"MIT"
] | 3 | 2019-01-01T10:46:15.000Z | 2019-01-01T10:46:18.000Z | .github/helper/semgrep_rules/ux.py | JMBodz/frappe | eb218a06d1cbfc3a8f1cc00ba8dac2c927d2f71d | [
"MIT"
] | 17 | 2021-03-22T18:47:14.000Z | 2022-03-15T12:21:00.000Z | .github/helper/semgrep_rules/ux.py | JMBodz/frappe | eb218a06d1cbfc3a8f1cc00ba8dac2c927d2f71d | [
"MIT"
] | 2 | 2021-09-02T09:51:55.000Z | 2021-09-07T04:55:42.000Z | import frappe
from frappe import msgprint, throw, _
# ruleid: frappe-missing-translate-function-python
throw("Error Occured")
# ruleid: frappe-missing-translate-function-python
frappe.throw("Error Occured")
# ruleid: frappe-missing-translate-function-python
frappe.msgprint("Useful message")
# ruleid: frappe-missin... | 23.875 | 50 | 0.791885 | import frappe
from frappe import msgprint, throw, _
# ruleid: frappe-missing-translate-function-python
throw("Error Occured")
# ruleid: frappe-missing-translate-function-python
frappe.throw("Error Occured")
# ruleid: frappe-missing-translate-function-python
frappe.msgprint("Useful message")
# ruleid: frappe-missin... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f2b36061c2d5434c8d343985a59d0aee3394cc62 | 3,085 | py | Python | app/test.py | rliskovenko/DataRobot | f54dbb79379192eb61375281d9072252c92514c3 | [
"BSD-2-Clause"
] | null | null | null | app/test.py | rliskovenko/DataRobot | f54dbb79379192eb61375281d9072252c92514c3 | [
"BSD-2-Clause"
] | null | null | null | app/test.py | rliskovenko/DataRobot | f54dbb79379192eb61375281d9072252c92514c3 | [
"BSD-2-Clause"
] | null | null | null | import app
import unittest
App = app.app
testSet = {
True : [
'''[{"date": "2015-05-12T14:36:00.451765",
"md5checksum": "e8c83e232b64ce94fdd0e4539ad0d44f",
"name": "John Doe",
"uid": "1"},
{"date": "2015-05-13T14:38:00.451765",
"md5... | 34.277778 | 146 | 0.523825 | import random
import string
import app
import json
import unittest
from datetime import datetime
App = app.app
testSet = {
True : [
'''[{"date": "2015-05-12T14:36:00.451765",
"md5checksum": "e8c83e232b64ce94fdd0e4539ad0d44f",
"name": "John Doe",
"uid": "1"},
... | 0 | 0 | 0 | 1,560 | 0 | 0 | 0 | -18 | 111 |
8d535b6b9a8ef80cf72bd64cc33dd9d85c450afb | 979 | py | Python | dev/phonts/fittingequation/fit_thermal_conductivity.py | eragasa/pypospack | 21cdecaf3b05c87acc532d992be2c04d85bfbc22 | [
"MIT"
] | 4 | 2018-01-18T19:59:56.000Z | 2020-08-25T11:56:52.000Z | dev/phonts/fittingequation/fit_thermal_conductivity.py | eragasa/pypospack | 21cdecaf3b05c87acc532d992be2c04d85bfbc22 | [
"MIT"
] | 1 | 2018-04-22T23:02:13.000Z | 2018-04-22T23:02:13.000Z | dev/phonts/fittingequation/fit_thermal_conductivity.py | eragasa/pypospack | 21cdecaf3b05c87acc532d992be2c04d85bfbc22 | [
"MIT"
] | 1 | 2019-09-14T07:04:42.000Z | 2019-09-14T07:04:42.000Z | import pandas as pd
from scipy import optimize
filename = "ThermalConductivity_temperature.dat"
with open(filename,'r') as f:
lines = [k.strip() for k in f.readlines()]
rows =[]
for i, line in enumerate(lines):
line_args = [k.strip() for k in line.split()]
if i == 0:
column_names = line_args
... | 23.878049 | 69 | 0.658836 | import numpy as np
import pandas as pd
from scipy import optimize
from sklearn.linear_model import LinearRegression
filename = "ThermalConductivity_temperature.dat"
def thermal_conductivity_formula(x, k0, alpha, beta):
temperature = x[:,0]
pressure = x[:,1]
return k0 * (1+beta*pressure) / (1+alpha*temperat... | 0 | 0 | 0 | 0 | 0 | 137 | 0 | 25 | 67 |
b805fc024aa5e59688c2018fe26a78df35a3cd29 | 21,115 | py | Python | libraries/common/test_constants.py | akraino-edge-stack/ta-cloudtaf | af5eb3ff36b92ab1d9c156ffa0391eadc73eb6ba | [
"Apache-2.0"
] | null | null | null | libraries/common/test_constants.py | akraino-edge-stack/ta-cloudtaf | af5eb3ff36b92ab1d9c156ffa0391eadc73eb6ba | [
"Apache-2.0"
] | 1 | 2020-10-27T22:19:50.000Z | 2020-10-27T22:19:51.000Z | libraries/common/test_constants.py | akraino-edge-stack/ta-cloudtaf | af5eb3ff36b92ab1d9c156ffa0391eadc73eb6ba | [
"Apache-2.0"
] | null | null | null | import os
prompt = ':prompt:'
int_if_name_in_openstack = 'infra-int'
reg = os.getenv('REG')
reg_port = os.getenv('REG_PORT')
reg_path = os.getenv('REG_PATH')
test_image = "kubernetespause"
source_folder = os.getenv('SOURCE_FOLDER')
vnf_id = os.getenv('STACK_ID')
cbam_py = "{}/scripts/cbam.py".format(source_folder)
... | 77.628676 | 223 | 0.626474 | import os
prompt = ':prompt:'
int_if_name_in_openstack = 'infra-int'
reg = os.getenv('REG')
reg_port = os.getenv('REG_PORT')
reg_path = os.getenv('REG_PATH')
test_image = "kubernetespause"
source_folder = os.getenv('SOURCE_FOLDER')
vnf_id = os.getenv('STACK_ID')
cbam_py = "{}/scripts/cbam.py".format(source_folder)
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4ae61f322599bbf40341a128a9f3e9c0d7ca65ad | 2,081 | py | Python | contrib/runners/local_runner/local_runner/local_shell_command_runner.py | kkkanil/st2 | 07cd195d7a6e177a37dd019e5c9ab8329259d0fa | [
"Apache-2.0"
] | null | null | null | contrib/runners/local_runner/local_runner/local_shell_command_runner.py | kkkanil/st2 | 07cd195d7a6e177a37dd019e5c9ab8329259d0fa | [
"Apache-2.0"
] | 15 | 2021-02-11T22:58:54.000Z | 2021-08-06T18:03:47.000Z | contrib/runners/local_runner/local_runner/local_shell_command_runner.py | kkkanil/st2 | 07cd195d7a6e177a37dd019e5c9ab8329259d0fa | [
"Apache-2.0"
] | 1 | 2021-07-10T15:02:29.000Z | 2021-07-10T15:02:29.000Z | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 34.114754 | 87 | 0.665065 | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 0 | 0 | 0 | 775 | 0 | 239 | 0 | 131 | 182 |
f37db384ba1283c3a3f9d133d148e61fa90b4d00 | 344 | py | Python | 09_exam_preparation/01_sino_the_walker.py | ivaylokanov/Python | af219356d7034de3004a0012603654756d436c08 | [
"Apache-2.0"
] | null | null | null | 09_exam_preparation/01_sino_the_walker.py | ivaylokanov/Python | af219356d7034de3004a0012603654756d436c08 | [
"Apache-2.0"
] | null | null | null | 09_exam_preparation/01_sino_the_walker.py | ivaylokanov/Python | af219356d7034de3004a0012603654756d436c08 | [
"Apache-2.0"
] | null | null | null | import datetime
current_time = datetime.time()
time_in_sec = int(current_time[0])*3600 + int(current_time[1])*60 + int(current_time[2])
steps = int(input())
time_for_each_step = int(input())
total_time = time_in_sec + steps*time_for_each_step
a = str(datetime.timedelta(seconds=total_time))
az = a[len(a)-7:len(a)]
prin... | 34.4 | 88 | 0.741279 | import datetime
current_time = datetime.time()
time_in_sec = int(current_time[0])*3600 + int(current_time[1])*60 + int(current_time[2])
steps = int(input())
time_for_each_step = int(input())
total_time = time_in_sec + steps*time_for_each_step
a = str(datetime.timedelta(seconds=total_time))
az = a[len(a)-7:len(a)]
prin... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |