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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
430402a570807a7c410cc233e4c607900b4c2399 | 10,499 | py | Python | T181/test.py | krish232002/Hackathon_5.0 | 78006c04aa902297649487d351c1ae33bac88b00 | [
"MIT"
] | null | null | null | T181/test.py | krish232002/Hackathon_5.0 | 78006c04aa902297649487d351c1ae33bac88b00 | [
"MIT"
] | null | null | null | T181/test.py | krish232002/Hackathon_5.0 | 78006c04aa902297649487d351c1ae33bac88b00 | [
"MIT"
] | null | null | null | try:
import tkinter as tk # for Python 3
except:
# Initializing some global variables
# Initial time range for work time (standard 25 min)
workingTime = 10 # 25 * 60
# Short break time (5 min)
shortBreakTime = 5 # 5 * 60
# Long break time (15 min)
longBreakTime = 15 # 15 * 60
globalworkCount = 0
... | 44.676596 | 124 | 0.534527 | try:
import tkinter as tk # for Python 3
except:
import Tkinter as tk # for Python 2.7
import time
# Initializing some global variables
# Initial time range for work time (standard 25 min)
workingTime = 10 # 25 * 60
# Short break time (5 min)
shortBreakTime = 5 # 5 * 60
# Long break time (15 m... | 0 | 0 | 0 | 9,884 | 0 | 0 | 0 | -11 | 170 |
14d2486479743fd8379a4b54ab6f4033569b7793 | 1,138 | py | Python | tools/graph_bag/scripts/multiprocessing_helpers.py | jdekarske/astrobee | c882f9f39719487770bbe7c7322d2ca7f71a1272 | [
"Apache-2.0"
] | 1 | 2021-11-11T17:13:32.000Z | 2021-11-11T17:13:32.000Z | tools/graph_bag/scripts/multiprocessing_helpers.py | LesterCovax/astrobee | 608f6688c6f6088f1357fed9e68b45d68bc9ee2d | [
"Apache-2.0"
] | 4 | 2021-08-01T17:13:15.000Z | 2022-03-31T14:23:03.000Z | tools/graph_bag/scripts/multiprocessing_helpers.py | LesterCovax/astrobee | 608f6688c6f6088f1357fed9e68b45d68bc9ee2d | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
# All rights reserved.
#
# The Astrobee platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with the
# Li... | 34.484848 | 75 | 0.740773 | # Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
# All rights reserved.
#
# The Astrobee platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with the
# Li... | 0 | 195 | 0 | 0 | 0 | 77 | 0 | 0 | 22 |
d2c1b0c330dc27d3e9aa1253fefc2da3e7af32cb | 7,284 | py | Python | ikibardin/cresi-spacenet/cresi/02_eval.py | SpaceNetChallenge/SpaceNet_Optimized_Routing_Solutions | 3fbc215de6b05904a5b54b2c7cde7e61074ae38d | [
"Apache-2.0"
] | 27 | 2020-03-04T05:54:48.000Z | 2022-01-05T07:07:44.000Z | ikibardin/cresi-spacenet/cresi/02_eval.py | CosmiQ/SpaceNet_Optimized_Routing_Solutions | 3fbc215de6b05904a5b54b2c7cde7e61074ae38d | [
"Apache-2.0"
] | 1 | 2020-07-14T10:35:50.000Z | 2020-07-14T10:35:50.000Z | ikibardin/cresi-spacenet/cresi/02_eval.py | SpaceNetChallenge/SpaceNet_Optimized_Routing_Solutions | 3fbc215de6b05904a5b54b2c7cde7e61074ae38d | [
"Apache-2.0"
] | 7 | 2020-03-07T21:42:57.000Z | 2022-01-07T10:49:50.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Sat May 5 02:18:38 2018
@author: avanetten
Adapted from:
https://github.com/SpaceNetChallenge/RoadDetector/tree/master/albu-solution
"""
import time
import cv2
cv2.setNumThreads(0)
cv2.ocl.setUseOpenCL(False)
import os
#import shutil
import torch
impor... | 40.021978 | 112 | 0.613811 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Sat May 5 02:18:38 2018
@author: avanetten
Adapted from:
https://github.com/SpaceNetChallenge/RoadDetector/tree/master/albu-solution
"""
import time
import cv2
cv2.setNumThreads(0)
cv2.ocl.setUseOpenCL(False)
import os
import numpy as np
#import shutil... | 0 | 0 | 0 | 208 | 0 | 1,196 | 0 | 224 | 177 |
4adeaa7f9a655d60c1fc9882a76d70fd7208fcae | 15,516 | py | Python | trainmvs.py | zhangyu233/mvscode | 883b2ba1a2ed61198a331f83d5ec7813b7204ef3 | [
"MIT"
] | null | null | null | trainmvs.py | zhangyu233/mvscode | 883b2ba1a2ed61198a331f83d5ec7813b7204ef3 | [
"MIT"
] | null | null | null | trainmvs.py | zhangyu233/mvscode | 883b2ba1a2ed61198a331f83d5ec7813b7204ef3 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import faulthandler
import argparse
# from args import get_args
faulthandler.enable()
if __name__ == '__main__':
# if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--lr', type=int, default=2e-3)
parser.add_argument('--log_name', t... | 45.905325 | 143 | 0.637084 | import sys
import os
import torch
import torch.distributed as dist
import torch.nn as nn
import warnings
import torch.distributed
import numpy as np
import random
import faulthandler
import torch.multiprocessing as mp
import time
import scipy.misc
from models.networks import MvsFlow
from torch import optim
import argpa... | 0 | 0 | 0 | 0 | 0 | 11,286 | 0 | 139 | 398 |
4273c20c831a3850f90bd3d69c5069140d64b31d | 1,793 | py | Python | saleor/checkout/calculations.py | StnxCld/core | 6919155bf59f24497cf1feafc52713400f408e1b | [
"CC-BY-4.0"
] | 2 | 2022-01-15T12:31:49.000Z | 2022-02-05T19:28:52.000Z | saleor/checkout/calculations.py | StnxCld/core | 6919155bf59f24497cf1feafc52713400f408e1b | [
"CC-BY-4.0"
] | 13 | 2021-03-19T02:54:47.000Z | 2022-03-12T00:36:26.000Z | saleor/checkout/calculations.py | StnxCld/core | 6919155bf59f24497cf1feafc52713400f408e1b | [
"CC-BY-4.0"
] | 1 | 2021-04-09T10:26:49.000Z | 2021-04-09T10:26:49.000Z | from typing import TYPE_CHECKING, Iterable, Optional
from ..discount import DiscountInfo
from ..plugins.manager import get_plugins_manager
if TYPE_CHECKING:
from prices import TaxedMoney
from .models import Checkout, CheckoutLine
def checkout_shipping_price(
*,
checkout: "Checkout",
lines: Itera... | 26.761194 | 85 | 0.696598 | from typing import TYPE_CHECKING, Iterable, Optional
from ..discount import DiscountInfo
from ..plugins.manager import get_plugins_manager
if TYPE_CHECKING:
from prices import TaxedMoney
from .models import Checkout, CheckoutLine
def checkout_shipping_price(
*,
checkout: "Checkout",
lines: Itera... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5fe405427aa22434c16f4d29bb95e78fb670f42e | 187 | py | Python | __init__.py | brandentimm/pydagman | 5b1045652fc9fdb059dd3504a68636d1a8562cb2 | [
"MIT"
] | 5 | 2016-01-04T18:12:18.000Z | 2021-09-01T05:15:04.000Z | __init__.py | brandentimm/pydagman | 5b1045652fc9fdb059dd3504a68636d1a8562cb2 | [
"MIT"
] | null | null | null | __init__.py | brandentimm/pydagman | 5b1045652fc9fdb059dd3504a68636d1a8562cb2 | [
"MIT"
] | 3 | 2016-01-04T18:18:10.000Z | 2017-07-13T12:55:34.000Z | """
pydagman: A package for creating DAGman files
..moduleauthor:: Branden Timm <branden.timm@gmail.com>
Classes:
Dagfile: Represents a DAGman file
Job: Represents a DAGman Condor job
""" | 26.714286 | 54 | 0.770053 | """
pydagman: A package for creating DAGman files
..moduleauthor:: Branden Timm <branden.timm@gmail.com>
Classes:
Dagfile: Represents a DAGman file
Job: Represents a DAGman Condor job
""" | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
161b9a71e5cfca5b991e48e0da4bcd5f97d6fe48 | 3,197 | py | Python | core/libdeno/build/chromeos/create_test_runner_script.py | shadowkun/denotf | 76d8cb8a66ca533c08939fd53c98fb63247129f0 | [
"MIT"
] | null | null | null | core/libdeno/build/chromeos/create_test_runner_script.py | shadowkun/denotf | 76d8cb8a66ca533c08939fd53c98fb63247129f0 | [
"MIT"
] | null | null | null | core/libdeno/build/chromeos/create_test_runner_script.py | shadowkun/denotf | 76d8cb8a66ca533c08939fd53c98fb63247129f0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Creates a script that runs a CrOS VM test by delegating to
build/chromeos/test_runner.py.
"""
import sys
SCRIPT_TEMPLATE = """\
... | 26.641667 | 80 | 0.682828 | #!/usr/bin/env python
#
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Creates a script that runs a CrOS VM test by delegating to
build/chromeos/test_runner.py.
"""
import argparse
import os
import sy... | 0 | 0 | 0 | 0 | 0 | 2,132 | 0 | -18 | 68 |
1ef8f3125ab60319d8d191a58d8cce721097f71f | 2,169 | py | Python | hendrics/rebin.py | StingraySoftware/HENDRICS | 551a77fc42b16055da5bfd37701521655394b80b | [
"BSD-3-Clause"
] | 18 | 2017-08-15T17:20:31.000Z | 2021-12-24T13:33:10.000Z | hendrics/rebin.py | StingraySoftware/HENDRICS | 551a77fc42b16055da5bfd37701521655394b80b | [
"BSD-3-Clause"
] | 118 | 2017-08-11T13:48:32.000Z | 2022-03-31T12:30:03.000Z | hendrics/rebin.py | StingraySoftware/HENDRICS | 551a77fc42b16055da5bfd37701521655394b80b | [
"BSD-3-Clause"
] | 11 | 2017-08-11T13:43:12.000Z | 2021-09-18T07:34:10.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Functions to rebin light curves and frequency spectra."""
from astropy import log
from .io import get_file_type
from .io import save_lcurve, save_pds
from .io import HEN_FILE_EXTENSION, get_file_extension
def rebin_file(filename, rebin):
"""Rebin ... | 30.549296 | 77 | 0.651913 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Functions to rebin light curves and frequency spectra."""
import numpy as np
from astropy import log
from .io import get_file_type
from .io import save_lcurve, save_pds
from .io import HEN_FILE_EXTENSION, get_file_extension
def rebin_file(filename, r... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 23 |
d33a8ecab964f942f6337193b62268a7984935fa | 850 | py | Python | examples/basic/carcrash.py | jtpils/vtkplotter | fbed73d6ed3f049dca3421c64e2e82ac1eef69a8 | [
"MIT"
] | 7 | 2020-11-21T14:23:27.000Z | 2022-03-03T02:01:35.000Z | examples/basic/carcrash.py | jtpils/vtkplotter | fbed73d6ed3f049dca3421c64e2e82ac1eef69a8 | [
"MIT"
] | null | null | null | examples/basic/carcrash.py | jtpils/vtkplotter | fbed73d6ed3f049dca3421c64e2e82ac1eef69a8 | [
"MIT"
] | 2 | 2021-11-06T10:40:31.000Z | 2022-03-03T02:01:34.000Z | """
Make a textured floor, a lamp post, and load a mesh of a car
make copies of the car, rotate and move them in a loop.
"""
from __future__ import division, print_function
from vtkplotter import Plotter, Plane, Text, datadir
vp = Plotter(interactive=0, axes=0)
vp += Plane(pos=(4, 0, -0.45), sx=12).texture("metalfloo... | 31.481481 | 62 | 0.655294 | """
Make a textured floor, a lamp post, and load a mesh of a car
make copies of the car, rotate and move them in a loop.
"""
from __future__ import division, print_function
from vtkplotter import Plotter, Plane, Text, datadir
vp = Plotter(interactive=0, axes=0)
vp += Plane(pos=(4, 0, -0.45), sx=12).texture("metalfloo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e5a63df630f124f73e1814be430aedd4d1d212c7 | 841 | py | Python | validation/sage_gain_compare.py | ArgoCanada/BGC-QC | c058f3e1a1992fc961ce2c4d5862d426725c1e43 | [
"MIT"
] | 3 | 2020-11-30T14:49:43.000Z | 2022-02-08T17:23:36.000Z | validation/sage_gain_compare.py | ArgoCanada/bgcArgoDMQC | 513b05729e605eed2cd9dafe9aef6260f577a0b5 | [
"MIT"
] | 32 | 2020-11-11T16:00:04.000Z | 2022-02-23T18:59:48.000Z | validation/sage_gain_compare.py | ArgoCanada/bgcArgoDMQC | 513b05729e605eed2cd9dafe9aef6260f577a0b5 | [
"MIT"
] | 1 | 2020-08-30T02:40:33.000Z | 2020-08-30T02:40:33.000Z | #!/usr/bin/python
from pathlib import Path
import pandas as pd
import seaborn as sns
from bgcArgo import sprof, profiles
sns.set(context='paper', style='whitegrid', palette='colorblind')
sage_path = Path('/Users/gordonc/Documents/data/Argo/sage/')
sage_files = list(sage_path.glob('*gui*.h5'))
for fn in sage_files:
... | 28.033333 | 108 | 0.681332 | #!/usr/bin/python
from pathlib import Path
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from bgcArgo import sprof, profiles
sns.set(context='paper', style='whitegrid', palette='colorblind')
sage_path = Path('/Users/gordonc/Documents/data/Argo/sage/')
sage_files = lis... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 46 |
18b7db44a1943e2dda8dd2866a2e464ed4098900 | 3,363 | py | Python | Algorithms/Search/Medium/003_Intersections_in_a_Maze.py | o-silva-1/HackerRank | be5241c1439e7ed54fe4a1847984a9ac79c6e2a9 | [
"MIT"
] | null | null | null | Algorithms/Search/Medium/003_Intersections_in_a_Maze.py | o-silva-1/HackerRank | be5241c1439e7ed54fe4a1847984a9ac79c6e2a9 | [
"MIT"
] | null | null | null | Algorithms/Search/Medium/003_Intersections_in_a_Maze.py | o-silva-1/HackerRank | be5241c1439e7ed54fe4a1847984a9ac79c6e2a9 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/count-luck/problem
# Count the number of intersections in the correct path of a maze
countLuck(['.X.X......X', '.X*.X.XXX.X', '.XX.X.XM...', '......XXXX.'], 3)
| 37.366667 | 125 | 0.529289 | # https://www.hackerrank.com/challenges/count-luck/problem
# Count the number of intersections in the correct path of a maze
def countLuck(matrix, k):
# Get the start and the end coordinates
for y, row in enumerate(matrix):
if row.__contains__('M'):
start = (row.index('M'), y)
if r... | 0 | 0 | 0 | 0 | 0 | 3,138 | 0 | 0 | 22 |
918797d59403b359bd9b973927b61a95adf55ed2 | 2,216 | py | Python | examples/adspygoogle/dfp/v201204/deactivate_labels.py | krux/adspygoogle | 6505a71122f45fe3e675f27f2c29f67a1768069b | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | examples/adspygoogle/dfp/v201204/deactivate_labels.py | krux/adspygoogle | 6505a71122f45fe3e675f27f2c29f67a1768069b | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | examples/adspygoogle/dfp/v201204/deactivate_labels.py | krux/adspygoogle | 6505a71122f45fe3e675f27f2c29f67a1768069b | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2012 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 b... | 33.074627 | 80 | 0.698556 | #!/usr/bin/python
#
# Copyright 2012 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 b... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0311e5780176808905b69011071b7823d9be4b79 | 509 | py | Python | moviebase/movielist/migrations/0002_auto_20190303_0918.py | Gordi91/moviebase | 748969b6a8a2eda131eb17cf73fd6469e49d6c79 | [
"MIT"
] | null | null | null | moviebase/movielist/migrations/0002_auto_20190303_0918.py | Gordi91/moviebase | 748969b6a8a2eda131eb17cf73fd6469e49d6c79 | [
"MIT"
] | null | null | null | moviebase/movielist/migrations/0002_auto_20190303_0918.py | Gordi91/moviebase | 748969b6a8a2eda131eb17cf73fd6469e49d6c79 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.7 on 2019-03-03 09:18
| 25.45 | 148 | 0.650295 | # Generated by Django 2.1.7 on 2019-03-03 09:18
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('movielist', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='movie',
... | 0 | 0 | 0 | 362 | 0 | 0 | 0 | 30 | 68 |
52c7fdb2a95ac1bc630c1e52e5ce442a905c0c27 | 306 | py | Python | tests/test_methods/test_views.py | jackwardell/SlackTime | c40be4854a26084e1a368a975e220d613c14d8d8 | [
"Apache-2.0"
] | 2 | 2020-09-24T00:07:13.000Z | 2020-09-27T19:27:06.000Z | tests/test_methods/test_views.py | jackwardell/SlackTime | c40be4854a26084e1a368a975e220d613c14d8d8 | [
"Apache-2.0"
] | null | null | null | tests/test_methods/test_views.py | jackwardell/SlackTime | c40be4854a26084e1a368a975e220d613c14d8d8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
| 17 | 35 | 0.75817 | # -*- coding: utf-8 -*-
def test_views_open(slack_time):
assert slack_time.views.open
def test_views_publish(slack_time):
assert slack_time.views.publish
def test_views_push(slack_time):
assert slack_time.views.push
def test_views_update(slack_time):
assert slack_time.views.update
| 0 | 0 | 0 | 0 | 0 | 186 | 0 | 0 | 92 |
920702d54e9dab9595b95edcb02c841583a72e78 | 5,471 | py | Python | test/test_sentry.py | etcher-be/elib | d964e683dcea1b3e55e7860a99f7913f248e6dc0 | [
"MIT"
] | null | null | null | test/test_sentry.py | etcher-be/elib | d964e683dcea1b3e55e7860a99f7913f248e6dc0 | [
"MIT"
] | 32 | 2020-03-24T16:22:49.000Z | 2021-01-04T12:25:27.000Z | test/test_sentry.py | theendsofinvention/elib | d964e683dcea1b3e55e7860a99f7913f248e6dc0 | [
"MIT"
] | null | null | null | # coding=utf-8
import raven
| 31.624277 | 94 | 0.694023 | # coding=utf-8
import sys
import raven
import raven.breadcrumbs
from mockito import ANY, mock, verify, verifyStubbedInvocationsAreUsed, when
from elib.sentry import Sentry, SentryContext
class DummyContext(SentryContext):
"""
Dummy testing context
"""
string = 'string'
integer = 1
def test_in... | 0 | 0 | 0 | 93 | 0 | 4,852 | 0 | 71 | 412 |
d578a335ede20642ceed73d42d5701928b1e5ba2 | 1,371 | py | Python | vtkplotter_examples/basic/closewindow.py | ismarou/vtkplotter-examples | 1eefcc026be169ab7a77a5bce6dec8044c33b554 | [
"MIT"
] | 4 | 2020-07-30T02:38:29.000Z | 2021-09-12T14:30:18.000Z | vtkplotter_examples/basic/closewindow.py | ismarou/vtkplotter-examples | 1eefcc026be169ab7a77a5bce6dec8044c33b554 | [
"MIT"
] | null | null | null | vtkplotter_examples/basic/closewindow.py | ismarou/vtkplotter-examples | 1eefcc026be169ab7a77a5bce6dec8044c33b554 | [
"MIT"
] | null | null | null | """Closing the Rendering Window
Press q:
Control returns to terminal,
window will not close but become unresponsive"""
from vtkplotter import Paraboloid, Hyperboloid, Plotter, show
mesh = Paraboloid()
vp1 = show(mesh, Text2D(__doc__), title='First Plotter instance')
# Now press 'q' to exit the window interaction,
#... | 29.804348 | 88 | 0.681984 | """Closing the Rendering Window
Press q:
Control returns to terminal,
window will not close but become unresponsive"""
from vtkplotter import Text, Paraboloid, Hyperboloid, Plotter, show
mesh = Paraboloid()
vp1 = show(mesh, Text2D(__doc__), title='First Plotter instance')
# Now press 'q' to exit the window interact... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0 |
729174aec9741dcacc897522f1b1a23923fe0bd7 | 38,928 | py | Python | apps/xformmanager/storageutility.py | commtrack/commtrack-old-to-del | cc9c22754ac192a45483cef609bdcf09aa990340 | [
"BSD-3-Clause"
] | 1 | 2017-05-19T07:23:00.000Z | 2017-05-19T07:23:00.000Z | apps/xformmanager/storageutility.py | commtrack/commtrack-old-to-del | cc9c22754ac192a45483cef609bdcf09aa990340 | [
"BSD-3-Clause"
] | null | null | null | apps/xformmanager/storageutility.py | commtrack/commtrack-old-to-del | cc9c22754ac192a45483cef609bdcf09aa990340 | [
"BSD-3-Clause"
] | null | null | null | """ Given an xform definition, storageutility generates dynamic data tables.
Given an xml instance, storeagutility populates the data tables.
Basically, storageutility abstracts away all interaction with the database,
and it only knows about the data structures in xformdef.py
"""
from xformmanager.models import Elem... | 46.177936 | 225 | 0.60802 | """ Given an xform definition, storageutility generates dynamic data tables.
Given an xml instance, storeagutility populates the data tables.
Basically, storageutility abstracts away all interaction with the database,
and it only knows about the data structures in xformdef.py
"""
import re
import os
import sys
impor... | 0 | 4,725 | 0 | 32,574 | 0 | 0 | 0 | 148 | 480 |
1cd21d1f5fcde5c759532d312f7a6fc47b4b9e3d | 683 | py | Python | 1684_num_consistent_strings.py | claytonjwong/leetcode-py | 16bbf8ac0ba5c80fe3ef67ade0d61a12991270a7 | [
"MIT"
] | 1 | 2020-07-15T14:16:23.000Z | 2020-07-15T14:16:23.000Z | 1684_num_consistent_strings.py | claytonjwong/leetcode-py | 16bbf8ac0ba5c80fe3ef67ade0d61a12991270a7 | [
"MIT"
] | null | null | null | 1684_num_consistent_strings.py | claytonjwong/leetcode-py | 16bbf8ac0ba5c80fe3ef67ade0d61a12991270a7 | [
"MIT"
] | null | null | null | #
# 1684. Count the Number of Consistent Strings
#
# Q: https://leetcode.com/problems/count-the-number-of-consistent-strings/
# A: https://leetcode.com/problems/count-the-number-of-consistent-strings/discuss/969513/Kt-Js-Py3-Cpp-1-Liners
#
# 1-liner
# verbose
| 29.695652 | 111 | 0.647145 | #
# 1684. Count the Number of Consistent Strings
#
# Q: https://leetcode.com/problems/count-the-number-of-consistent-strings/
# A: https://leetcode.com/problems/count-the-number-of-consistent-strings/discuss/969513/Kt-Js-Py3-Cpp-1-Liners
#
from typing import List
# 1-liner
class Solution:
def countConsistentStrin... | 0 | 0 | 0 | 352 | 0 | 0 | 0 | 2 | 67 |
0d97eb0fcacd709533ab71a5192a0cc5c8592d98 | 2,749 | py | Python | app/webapp.py | smuggy/webapp | 4fa62af5788157be171bf457a8e1a9b617057c78 | [
"MIT"
] | null | null | null | app/webapp.py | smuggy/webapp | 4fa62af5788157be171bf457a8e1a9b617057c78 | [
"MIT"
] | 1 | 2021-06-02T00:37:38.000Z | 2021-06-02T00:37:38.000Z | app/webapp.py | smuggy/webapp | 4fa62af5788157be171bf457a8e1a9b617057c78 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
#
import os
from flask import Flask
appcontainer = Flask(__name__)
vals = gen()
app_version="0.1.1"
count = 0
redis_host = os.getenv('REDIS_HOST')
config_val = os.getenv('CONFIG_VAL')
if __name__ == '__main__':
start()
| 23.29661 | 99 | 0.628956 | #!/usr/bin/env python3
#
#
import os
import time
from redis import Redis
from flask import Flask
from flask import make_response
from flask import render_template
from flask import request
from flask import Response
from datetime import datetime
import requests
def gen():
start_val = 100
inc = 1
curr = 1... | 0 | 1,800 | 0 | 0 | 165 | 89 | 0 | 25 | 407 |
ad55ded943d4be3f70056d74688818fa7a00800e | 1,915 | py | Python | DrugBot/line/intent/Loki_color.py | Lanlanluuu/LokiHub | aae3efb566d2383e78eaa8dc1e8b3f1bb097f2a6 | [
"MIT"
] | 17 | 2020-11-25T07:40:18.000Z | 2022-03-07T03:29:18.000Z | DrugBot/line/intent/Loki_color.py | Lanlanluuu/LokiHub | aae3efb566d2383e78eaa8dc1e8b3f1bb097f2a6 | [
"MIT"
] | 8 | 2020-12-18T13:23:59.000Z | 2021-10-03T21:41:50.000Z | DrugBot/line/intent/Loki_color.py | Lanlanluuu/LokiHub | aae3efb566d2383e78eaa8dc1e8b3f1bb097f2a6 | [
"MIT"
] | 43 | 2020-12-02T09:03:57.000Z | 2021-12-23T03:30:25.000Z | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
"""
Loki module for color
Input:
inputSTR str,
utterance str,
args str[],
resultDICT dict
Output:
resultDICT dict
"""
DEBUG_color = True
userDefinedDICT = {"": ["", "", ""], "": ["", "", "", ""]... | 25.533333 | 92 | 0.509138 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
"""
Loki module for color
Input:
inputSTR str,
utterance str,
args str[],
resultDICT dict
Output:
resultDICT dict
"""
DEBUG_color = True
userDefinedDICT = {"粉": ["藥粉", "粉末", "粉狀"], "液體": ["液狀物",... | 429 | 0 | 0 | 0 | 0 | 1,384 | 0 | 0 | 45 |
5d3c9bd08335748f115c481827f7aa7bf986de20 | 2,702 | py | Python | test/units/LambdaApiUserBlocked_test.py | praktikos/praktikos-template-python | 324c7640ee05469fba87a7ec64d6ac61675b259e | [
"MIT"
] | null | null | null | test/units/LambdaApiUserBlocked_test.py | praktikos/praktikos-template-python | 324c7640ee05469fba87a7ec64d6ac61675b259e | [
"MIT"
] | null | null | null | test/units/LambdaApiUserBlocked_test.py | praktikos/praktikos-template-python | 324c7640ee05469fba87a7ec64d6ac61675b259e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# noinspection PyUnusedLocal
| 40.328358 | 102 | 0.643597 | # -*- coding: utf-8 -*-
import json
import boto3
import requests
from api.rdb.config import is_test, is_production
from api.rdb.utils.apigateway import get_api_url
from api.rdb.utils.service_framework import STATUS_OK, STATUS_NOT_FOUND
from ..conftest import get_secure_event
from ..utilities import invoke
# noinsp... | 0 | 0 | 0 | 0 | 0 | 2,339 | 0 | 107 | 201 |
e2ad50fc65e897c7bb58531e3c8ee48552582d5e | 1,525 | py | Python | benchmark/graphs.py | Francesco2304/pygfa | 9bf6fb5f0a959685300ab863a0e716a2268109f7 | [
"MIT"
] | 3 | 2020-06-25T22:47:02.000Z | 2022-02-27T15:16:02.000Z | benchmark/graphs.py | Francesco2304/pygfa | 9bf6fb5f0a959685300ab863a0e716a2268109f7 | [
"MIT"
] | 3 | 2017-08-08T12:24:23.000Z | 2022-02-27T15:17:25.000Z | benchmark/graphs.py | Francesco2304/pygfa | 9bf6fb5f0a959685300ab863a0e716a2268109f7 | [
"MIT"
] | 4 | 2019-02-04T20:54:53.000Z | 2020-05-14T19:52:24.000Z | """
Python script to create graphs of the benchmark
"""
from collections import OrderedDict
import matplotlib.pyplot as plt
BENCHMARK_NODE = OrderedDict()
with open('results/cmp_nodes.txt') as node_method_file:
ROWS = node_method_file.readlines()
i = 0
for ROW in ROWS:
i += 1
ROW = ROW.spl... | 26.754386 | 87 | 0.665574 | """
Python script to create graphs of the benchmark
"""
from collections import OrderedDict
import matplotlib.pyplot as plt
BENCHMARK_NODE = OrderedDict()
with open('results/cmp_nodes.txt') as node_method_file:
ROWS = node_method_file.readlines()
i = 0
for ROW in ROWS:
i += 1
ROW = ROW.spl... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
212584c32f734b89417ac516b4cdfa3f2fb6d987 | 456 | py | Python | src/ext/restapi/__init__.py | kackey0-1/project_ai | 8b309eb1e0cbc46e4a9b134adcd0b44e5657f709 | [
"MIT"
] | 1 | 2022-02-24T16:24:56.000Z | 2022-02-24T16:24:56.000Z | src/ext/restapi/__init__.py | kackey0-1/project_ai | 8b309eb1e0cbc46e4a9b134adcd0b44e5657f709 | [
"MIT"
] | 2 | 2021-12-27T15:12:09.000Z | 2022-02-06T14:14:36.000Z | src/ext/restapi/__init__.py | kackey0-1/project_ai | 8b309eb1e0cbc46e4a9b134adcd0b44e5657f709 | [
"MIT"
] | null | null | null | from flask import Blueprint
from flask_restful import Api
bp = Blueprint("restapi", __name__, url_prefix="/api/v1")
api = Api(bp)
| 28.5 | 67 | 0.769737 | from flask import Blueprint
from flask_restful import Api
from .resources import ImageAiResource
from .sentences import SentenceResource, SentenceItemResource
bp = Blueprint("restapi", __name__, url_prefix="/api/v1")
api = Api(bp)
def init_app(app):
api.add_resource(ImageAiResource, "/upload/")
api.add_reso... | 0 | 0 | 0 | 0 | 0 | 199 | 0 | 57 | 68 |
b06d16aa392bf4194d5e1fa117633f6ddd18d174 | 508 | py | Python | lain_cli/test.py | kaiix/lain-cli | a2e3359355560d3e8cac13a52805618d3b81886a | [
"MIT"
] | null | null | null | lain_cli/test.py | kaiix/lain-cli | a2e3359355560d3e8cac13a52805618d3b81886a | [
"MIT"
] | null | null | null | lain_cli/test.py | kaiix/lain-cli | a2e3359355560d3e8cac13a52805618d3b81886a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 22.086957 | 62 | 0.661417 | # -*- coding: utf-8 -*-
import sys
from argh.decorators import arg
from lain_cli.utils import lain_yaml
from lain_sdk.mydocker import copy_files_from_image
@arg('-r', '--results', nargs='*', type=str)
def test(results=[]):
"""
Build test image and run test scripts defined in lain.yaml
"""
passed, t... | 0 | 326 | 0 | 0 | 0 | 0 | 0 | 44 | 113 |
b40103c2847dde6c46b47ffdc81c65586e984815 | 6,812 | py | Python | lib/adversary.py | liuruoze/HierNet-SC2 | 7abfde0088e90416f11922d67c0f09659c7ecf81 | [
"Apache-2.0"
] | 2 | 2022-02-28T08:39:43.000Z | 2022-03-03T02:28:23.000Z | lib/adversary.py | liuruoze/HierNet-SC2 | 7abfde0088e90416f11922d67c0f09659c7ecf81 | [
"Apache-2.0"
] | 1 | 2021-08-10T13:38:19.000Z | 2021-08-10T13:38:19.000Z | lib/adversary.py | liuruoze/HierNet-SC2 | 7abfde0088e90416f11922d67c0f09659c7ecf81 | [
"Apache-2.0"
] | 1 | 2021-08-12T01:48:08.000Z | 2021-08-12T01:48:08.000Z | # https://github.com/andrewliao11/gail-tf
# import lib.tf_util as U
import tensorflow as tf
import lib.layer as layer
# ================================================================
# Flat vectors
# ================================================================
# =============================================... | 45.413333 | 129 | 0.611715 | # https://github.com/andrewliao11/gail-tf
# import lib.tf_util as U
import tensorflow as tf
import numpy as np
import lib.layer as layer
# ================================================================
# Flat vectors
# ================================================================
def var_shape(x):
out = x.g... | 0 | 0 | 0 | 5,327 | 0 | 644 | 0 | -3 | 160 |
113c36043092fb3ed7bb4566130cb4880a35f421 | 5,682 | py | Python | life_log/views.py | thelanman/justinlanahan.com | 6ff29eb223b042111d9a19a3ac9c80c80b85885e | [
"MIT"
] | null | null | null | life_log/views.py | thelanman/justinlanahan.com | 6ff29eb223b042111d9a19a3ac9c80c80b85885e | [
"MIT"
] | null | null | null | life_log/views.py | thelanman/justinlanahan.com | 6ff29eb223b042111d9a19a3ac9c80c80b85885e | [
"MIT"
] | null | null | null |
import logging
logger = logging.getLogger(__name__)
# NORMAL VIEWS
| 36.658065 | 114 | 0.625484 | import json
import math
import datetime
from django.shortcuts import render, redirect, render_to_response, get_object_or_404
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, JsonResponse, Http404
from django.template import RequestContext
from django.utils import timezone... | 0 | 328 | 0 | 4,356 | 0 | 188 | 0 | 260 | 474 |
c31eaea490a1bb33cdfb112a35f95721e070cdbc | 329 | py | Python | unbrake-api/configuration/migrations/0003_remove_config_testing.py | fga-eps-mds/2019.1-Simulador-de-Frenagem | a7452511fa7059121cd9035a7b21f3cd8fec1548 | [
"MIT"
] | 9 | 2019-03-23T02:56:08.000Z | 2019-08-29T21:32:00.000Z | unbrake-api/configuration/migrations/0003_remove_config_testing.py | fga-eps-mds/2019.1-Simulador-de-Frenagem | a7452511fa7059121cd9035a7b21f3cd8fec1548 | [
"MIT"
] | 260 | 2019-03-23T01:07:29.000Z | 2022-03-29T16:31:48.000Z | unbrake-api/configuration/migrations/0003_remove_config_testing.py | fga-eps-mds/2019.1-Simulador-de-Frenagem | a7452511fa7059121cd9035a7b21f3cd8fec1548 | [
"MIT"
] | 2 | 2019-05-07T03:39:58.000Z | 2019-09-09T07:02:11.000Z | # Generated by Django 2.2 on 2019-06-11 02:04
| 18.277778 | 49 | 0.595745 | # Generated by Django 2.2 on 2019-06-11 02:04
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('configuration', '0002_config_testing'),
]
operations = [
migrations.RemoveField(
model_name='config',
name='testing',
... | 0 | 0 | 0 | 225 | 0 | 0 | 0 | 11 | 46 |
aa87961178260a8cd9ca3af14c7a0617910a4028 | 3,016 | py | Python | examples/plotting/plot_rectangle.py | RhnSharma/sunpy | 03700193d287156ca1922eb27c4c2ad50040e53f | [
"BSD-2-Clause"
] | 628 | 2015-01-14T17:34:10.000Z | 2022-03-29T06:07:50.000Z | examples/plotting/plot_rectangle.py | RhnSharma/sunpy | 03700193d287156ca1922eb27c4c2ad50040e53f | [
"BSD-2-Clause"
] | 3,983 | 2015-01-03T11:16:21.000Z | 2022-03-31T16:55:38.000Z | examples/plotting/plot_rectangle.py | RhnSharma/sunpy | 03700193d287156ca1922eb27c4c2ad50040e53f | [
"BSD-2-Clause"
] | 582 | 2015-01-14T10:09:24.000Z | 2022-03-29T06:07:12.000Z | """
============================
Drawing a rectangle on a map
============================
This example will demonstrate how to draw a rectangle on a map using :meth:`~sunpy.map.GenericMap.draw_quadrangle`.
"""
import matplotlib.pyplot as plt
import astropy.units as u
from astropy.coordinates import SkyCoord
import ... | 29.568627 | 115 | 0.602785 | """
============================
Drawing a rectangle on a map
============================
This example will demonstrate how to draw a rectangle on a map using :meth:`~sunpy.map.GenericMap.draw_quadrangle`.
"""
import matplotlib.pyplot as plt
import astropy.units as u
from astropy.coordinates import SkyCoord
import ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
dc79ff20b7bcec73de52ab183a390972df980cb2 | 712 | py | Python | scripts/load_keys.py | mrFlick72/vauthenticator | c8cdcdd2335ab239ada5f9aa504e2ed537396953 | [
"Apache-2.0"
] | 6 | 2019-06-21T22:24:57.000Z | 2022-01-15T14:39:55.000Z | scripts/load_keys.py | mrFlick72/vauthenticator | c8cdcdd2335ab239ada5f9aa504e2ed537396953 | [
"Apache-2.0"
] | 18 | 2020-04-26T12:42:29.000Z | 2022-03-04T21:06:06.000Z | scripts/load_keys.py | mrFlick72/vauthenticator | c8cdcdd2335ab239ada5f9aa504e2ed537396953 | [
"Apache-2.0"
] | 1 | 2020-05-09T05:56:19.000Z | 2020-05-09T05:56:19.000Z | import boto3
import sys
if __name__ == '__main__':
master_key = sys.argv[1]
tableName = sys.argv[2]
kms_client = boto3.client("kms")
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table(tableName)
store_key(table, master_key) | 29.666667 | 103 | 0.682584 | import boto3
import base64
import uuid
import sys
def store_key(table, key):
key_pair = kms_client.generate_data_key_pair(KeyId=key, KeyPairSpec='RSA_2048')
table.put_item(Item={
"master_key_id": key_pair["KeyId"],
"key_id": str(uuid.uuid4()),
"private_key_ciphertext_blob": base64.b64en... | 0 | 0 | 0 | 0 | 0 | 403 | 0 | -18 | 67 |
983a56e6a7886f7b07b3a4367e82cd86581c1a8f | 921 | py | Python | core/src/zeit/content/cp/browser/tests/test_storystream.py | rickdg/vivi | 16134ac954bf8425646d4ad47bdd1f372e089355 | [
"BSD-3-Clause"
] | 5 | 2019-05-16T09:51:29.000Z | 2021-05-31T09:30:03.000Z | core/src/zeit/content/cp/browser/tests/test_storystream.py | rickdg/vivi | 16134ac954bf8425646d4ad47bdd1f372e089355 | [
"BSD-3-Clause"
] | 107 | 2019-05-24T12:19:02.000Z | 2022-03-23T15:05:56.000Z | core/src/zeit/content/cp/browser/tests/test_storystream.py | rickdg/vivi | 16134ac954bf8425646d4ad47bdd1f372e089355 | [
"BSD-3-Clause"
] | 3 | 2020-08-14T11:01:17.000Z | 2022-01-08T17:32:19.000Z | import zeit.cms.interfaces
import zeit.content.cp.interfaces
| 38.375 | 73 | 0.665581 | import zeit.cms.interfaces
import zeit.content.cp.interfaces
import zeit.content.cp.testing
class StoryStreamAddTest(zeit.content.cp.testing.BrowserTestCase):
def test_storystream_can_be_added(self):
b = self.browser
b.open('http://localhost/++skin++vivi/repository')
menu = b.getControl(n... | 0 | 0 | 0 | 805 | 0 | 0 | 0 | 9 | 45 |
3a17ac8d4b5e349a64b4f1588b4cd808e3b267c6 | 7,075 | py | Python | avalanche/logging/strategy_logger.py | lrzpellegrini/avalanche_pre_public | 522019a55ce08b92c1ec74b508a8ea6ae8751dfd | [
"MIT"
] | 12 | 2021-04-16T15:49:59.000Z | 2022-02-27T18:04:58.000Z | avalanche/logging/strategy_logger.py | lrzpellegrini/avalanche_pre_public | 522019a55ce08b92c1ec74b508a8ea6ae8751dfd | [
"MIT"
] | null | null | null | avalanche/logging/strategy_logger.py | lrzpellegrini/avalanche_pre_public | 522019a55ce08b92c1ec74b508a8ea6ae8751dfd | [
"MIT"
] | 2 | 2021-06-22T04:11:52.000Z | 2021-11-12T03:27:18.000Z |
__all__ = [
'StrategyLogger'
]
| 41.133721 | 79 | 0.640141 | from abc import ABC
from typing import List
from avalanche.evaluation.metric_results import MetricValue
from avalanche.training.plugins import PluggableStrategy
from avalanche.training.strategy_callbacks import StrategyCallbacks
class StrategyLogger(StrategyCallbacks[None], ABC):
"""
The base class for the ... | 0 | 0 | 0 | 6,783 | 0 | 0 | 0 | 119 | 135 |
96a2aca29089a5ff88ca7f6681bc35e7880db032 | 5,640 | py | Python | src/convert.py | ICTU/Kwaliteitsaanpak | 4dc5d1d080614999ff3ad00b56f9e17475878a24 | [
"Apache-2.0"
] | 4 | 2018-03-30T07:31:39.000Z | 2022-01-03T20:12:14.000Z | src/convert.py | ICTU/Kwaliteitsaanpak | 4dc5d1d080614999ff3ad00b56f9e17475878a24 | [
"Apache-2.0"
] | 186 | 2018-01-23T15:16:55.000Z | 2022-02-25T16:21:38.000Z | src/convert.py | ICTU/Kwaliteitsaanpak | 4dc5d1d080614999ff3ad00b56f9e17475878a24 | [
"Apache-2.0"
] | 1 | 2022-01-31T11:43:03.000Z | 2022-01-31T11:43:03.000Z | #!/bin/env python
"""Main program to convert Markdown files to different possible output formats."""
import datetime
import json
import logging
import os
import pathlib
import pprint
from typing import cast, List
from xml.etree.ElementTree import ElementTree
from cli import parse_cli_arguments
from converter import ... | 45.483871 | 118 | 0.731383 | #!/bin/env python
"""Main program to convert Markdown files to different possible output formats."""
import datetime
import json
import logging
import os
import pathlib
import pprint
from typing import cast, List
from xml.etree.ElementTree import ElementTree
from cli import parse_cli_arguments
from converter import ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9ab824550c424d3eac02cf5c52dc5331127978e5 | 1,417 | py | Python | examples/nfft/test_nfsoft.py | graefm/lorm | 864a25d5c8785fb446b3d5dd414560a1baa7bf3a | [
"MIT"
] | null | null | null | examples/nfft/test_nfsoft.py | graefm/lorm | 864a25d5c8785fb446b3d5dd414560a1baa7bf3a | [
"MIT"
] | null | null | null | examples/nfft/test_nfsoft.py | graefm/lorm | 864a25d5c8785fb446b3d5dd414560a1baa7bf3a | [
"MIT"
] | null | null | null | import nfft
import numpy as np
import pylab as pl
%matplotlib inline
Mp1, Mt, Mp2 = 20, 21, 20
N = 3
nfsoft_plan = nfft.nfsoft.plan(Mp1*Mt*Mp2, N)
p1 = 2*np.pi*np.linspace(-0.5,0.5,Mp1,endpoint=False)
t = 2*np.pi*np.linspace(0+0.00001,0.5-0.00001,Mt,endpoint=True)
p2 = 2*np.pi*np.linspace(-0.5,0.5,Mp2,endpoint=False... | 29.520833 | 68 | 0.687368 | import nfft
import numpy as np
import pylab as pl
%matplotlib inline
Mp1, Mt, Mp2 = 20, 21, 20
N = 3
nfsoft_plan = nfft.nfsoft.plan(Mp1*Mt*Mp2, N)
p1 = 2*np.pi*np.linspace(-0.5,0.5,Mp1,endpoint=False)
t = 2*np.pi*np.linspace(0+0.00001,0.5-0.00001,Mt,endpoint=True)
p2 = 2*np.pi*np.linspace(-0.5,0.5,Mp2,endpoint=False... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fde64e183445031ec8a22dc64b76860d63812d75 | 4,019 | py | Python | run_batch_embed.py | skanav/cst_transform | 361a23293cf0359af7a7d17cf465483ffe4e7545 | [
"Apache-2.0"
] | null | null | null | run_batch_embed.py | skanav/cst_transform | 361a23293cf0359af7a7d17cf465483ffe4e7545 | [
"Apache-2.0"
] | null | null | null | run_batch_embed.py | skanav/cst_transform | 361a23293cf0359af7a7d17cf465483ffe4e7545 | [
"Apache-2.0"
] | 1 | 2021-07-02T16:04:14.000Z | 2021-07-02T16:04:14.000Z | import argparse
import os
import json
import traceback
from tqdm import tqdm
from glob import glob
import run_predict as rt
# Handling file index for SVComp --------------------------------
# ----------------------------------------------------------------
if __name__ == '__main__':
parser = argparse.Arg... | 26.973154 | 112 | 0.596168 | import argparse
import os
import json
import yaml
import traceback
from tqdm import tqdm
from glob import glob
import run_predict as rt
from cst_transform.data.vocab_utils import MultiIndexer
def _substitute(org_files, sub_files):
index = {}
for f in org_files:
base, _ = os.path.splitext(f)
... | 0 | 0 | 0 | 0 | 516 | 1,228 | 0 | 24 | 183 |
6a749d4af9336636bd2de6c3964a2df66e9cec37 | 2,677 | py | Python | youpy/concurrency.py | youpy-org/youpy | 0b3b31043d0c517615c99eaf02d3464c50d59cb4 | [
"BSD-3-Clause"
] | null | null | null | youpy/concurrency.py | youpy-org/youpy | 0b3b31043d0c517615c99eaf02d3464c50d59cb4 | [
"BSD-3-Clause"
] | null | null | null | youpy/concurrency.py | youpy-org/youpy | 0b3b31043d0c517615c99eaf02d3464c50d59cb4 | [
"BSD-3-Clause"
] | null | null | null | # -*- encoding: utf-8 -*-
"""Group all concurrency objects and routines we use.
Intended to easy a potential future change in the concurrency model (i.e.
threads VS processes)
"""
# TODO(Nicolas Despres): Completely wrap the Queue and Task classes for proper
# abstraction.
import threading as _concurrency
import q... | 26.245098 | 90 | 0.646246 | # -*- encoding: utf-8 -*-
"""Group all concurrency objects and routines we use.
Intended to easy a potential future change in the concurrency model (i.e.
threads VS processes)
"""
# TODO(Nicolas Despres): Completely wrap the Queue and Task classes for proper
# abstraction.
import threading as _concurrency
import q... | 0 | 0 | 0 | 2,032 | 0 | 29 | 0 | 0 | 114 |
735210ed990e30496f7d7b0aaf4c2dc2620e7efa | 11,292 | py | Python | plot/hyperparam/plot_curve.py | architsakhadeo/Offline-Hyperparameter-Tuning-for-RL | 94b8f205b12f0cc59ae8e19b2e6099f34be929d6 | [
"MIT"
] | null | null | null | plot/hyperparam/plot_curve.py | architsakhadeo/Offline-Hyperparameter-Tuning-for-RL | 94b8f205b12f0cc59ae8e19b2e6099f34be929d6 | [
"MIT"
] | null | null | null | plot/hyperparam/plot_curve.py | architsakhadeo/Offline-Hyperparameter-Tuning-for-RL | 94b8f205b12f0cc59ae8e19b2e6099f34be929d6 | [
"MIT"
] | null | null | null |
# Loads the episode lengths from the csv files into a dictionary and return the dictionary
# def exponential_avg(rewardsList, alpha):
# AverageRewardsList = [rewardsList[0]]
# o_n_minus_1 = 0
# for i in range(1, len(rewardsList)):
# o_n = o_n_minus_1 + alpha*(1 - o_n_minus_1)
# beta_n = ... | 45.349398 | 123 | 0.656217 | import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# Loads the episode lengths from the csv files into a dictionary and return the dictionary
def load_data(algpath, name='episodes'):
Data = []
dirFiles = os.listdir(algpath)
# Files = np.array([i for i in dirFiles if 'episodes'... | 0 | 0 | 0 | 0 | 0 | 6,675 | 0 | -7 | 385 |
9e68e5206e6f9256a46ad0829b679c929bebacaa | 978 | py | Python | p_030_039/problem33.py | ericgreveson/projecteuler | 1844bf383fca871b82d88ef1eb3a9b1a0e363054 | [
"Apache-2.0"
] | null | null | null | p_030_039/problem33.py | ericgreveson/projecteuler | 1844bf383fca871b82d88ef1eb3a9b1a0e363054 | [
"Apache-2.0"
] | null | null | null | p_030_039/problem33.py | ericgreveson/projecteuler | 1844bf383fca871b82d88ef1eb3a9b1a0e363054 | [
"Apache-2.0"
] | null | null | null | from fractions import Fraction
from functools import reduce
def main():
"""
Entry point
"""
# We consider fractions with two digits in num and denom, less than one
curious = []
for numerator in range(10, 100):
for denominator in range(numerator + 1, 100):
nums = numerator //... | 31.548387 | 82 | 0.564417 | from fractions import Fraction
from functools import reduce
def main():
"""
Entry point
"""
# We consider fractions with two digits in num and denom, less than one
curious = []
for numerator in range(10, 100):
for denominator in range(numerator + 1, 100):
nums = numerator //... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0033f85c49c6f4fde63982bc3bfa700ca51837b9 | 16,817 | py | Python | src/heuristics.py | brmprnk/fasttree | a614fa2f3d26c6051dee67618ee5639e6115f85f | [
"RSA-MD"
] | null | null | null | src/heuristics.py | brmprnk/fasttree | a614fa2f3d26c6051dee67618ee5639e6115f85f | [
"RSA-MD"
] | null | null | null | src/heuristics.py | brmprnk/fasttree | a614fa2f3d26c6051dee67618ee5639e6115f85f | [
"RSA-MD"
] | null | null | null | """
File representing the FastNJ, Local Hill-Climbing and Top-hits heuristics.
All relevant classes or functions will be defined here, with possible references to utility functions i.e. distances.
References to page numbers in this code are referring to the paper or its supplementary material:
[1] Price at al. FastTre... | 42.467172 | 120 | 0.619076 | """
File representing the FastNJ, Local Hill-Climbing and Top-hits heuristics.
All relevant classes or functions will be defined here, with possible references to utility functions i.e. distances.
References to page numbers in this code are referring to the paper or its supplementary material:
[1] Price at al. FastTre... | 28 | 7,102 | 0 | 3,403 | 0 | 0 | 0 | -11 | 89 |
676056aadf6e0394e3592a53d5ebdcb7664f3bfe | 15,968 | py | Python | dnac_apis.py | zapodeanu/multidomain_provisioning | 19478f0d30ea2247eeb131df28fe4a96c864ce7c | [
"BSD-Source-Code"
] | 2 | 2019-10-16T22:09:05.000Z | 2019-11-20T15:44:21.000Z | dnac_apis.py | zapodeanu/multidomain_provisioning | 19478f0d30ea2247eeb131df28fe4a96c864ce7c | [
"BSD-Source-Code"
] | 1 | 2021-06-02T00:31:33.000Z | 2021-06-02T00:31:33.000Z | dnac_apis.py | zapodeanu/multidomain_provisioning | 19478f0d30ea2247eeb131df28fe4a96c864ce7c | [
"BSD-Source-Code"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2019 Cisco and/or its affiliates.
This software is licensed to you under the terms of the Cisco Sample
Code License, Version 1.1 (the "License"). You may obtain a copy of the
License at
https://developer.cisco.com/docs/licenses
All use... | 38.109785 | 130 | 0.680235 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2019 Cisco and/or its affiliates.
This software is licensed to you under the terms of the Cisco Sample
Code License, Version 1.1 (the "License"). You may obtain a copy of the
License at
https://developer.cisco.com/docs/licenses
All use... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 36 | 66 |
e20e3569604fb6297e99d0ff0d7e5ddc9754638b | 1,336 | py | Python | src/admin_panel/migrations/0020_auto_20210704_0655.py | Rey092/myhouse24_django | b2b31873006ec4917c2ed043350f2841745fadfb | [
"MIT"
] | null | null | null | src/admin_panel/migrations/0020_auto_20210704_0655.py | Rey092/myhouse24_django | b2b31873006ec4917c2ed043350f2841745fadfb | [
"MIT"
] | null | null | null | src/admin_panel/migrations/0020_auto_20210704_0655.py | Rey092/myhouse24_django | b2b31873006ec4917c2ed043350f2841745fadfb | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-07-04 06:55
| 28.425532 | 67 | 0.473802 | # Generated by Django 3.2.4 on 2021-07-04 06:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("admin_panel", "0019_auto_20210703_1119"),
]
operations = [
migrations.CreateModel(
name="Tariff... | 0 | 0 | 0 | 1,189 | 0 | 0 | 0 | 30 | 68 |
8e3cfb0cb5f3007da0bcf2e6291c98c17ca0bbe4 | 1,560 | py | Python | test_convert.py | atlas-calo-ml/GraphNets4Pions_LLNL | fb25259124711526cc4110461f09db1d03a669f9 | [
"Apache-2.0"
] | 1 | 2021-11-02T00:40:19.000Z | 2021-11-02T00:40:19.000Z | test_convert.py | atlas-calo-ml/GraphNets4Pions_LLNL | fb25259124711526cc4110461f09db1d03a669f9 | [
"Apache-2.0"
] | null | null | null | test_convert.py | atlas-calo-ml/GraphNets4Pions_LLNL | fb25259124711526cc4110461f09db1d03a669f9 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
| 26.440678 | 63 | 0.661538 | import numpy as np
import os
import sys
import glob
import uproot as ur
import matplotlib.pyplot as plt
import time
import seaborn as sns
import tensorflow as tf
from graph_nets import utils_np
from graph_nets import utils_tf
from graph_nets.graphs import GraphsTuple
import sonnet as snt
import argparse
import yaml
imp... | 0 | 0 | 0 | 0 | 0 | 1,181 | 0 | -20 | 375 |
212fbb35f96ab14421400eaa39c09839088dd347 | 156 | py | Python | bubbob/cheat.py | fpiesche/bub-n-bros | 29f6b77a125aa4ac071f470607c268fcd210a6fb | [
"MIT"
] | 1 | 2021-01-16T22:00:06.000Z | 2021-01-16T22:00:06.000Z | bubbob/cheat.py | fpiesche/bub-n-bros | 29f6b77a125aa4ac071f470607c268fcd210a6fb | [
"MIT"
] | 2 | 2022-03-18T09:46:12.000Z | 2022-03-25T09:36:42.000Z | bubbob/cheat.py | fpiesche/bub-n-bros | 29f6b77a125aa4ac071f470607c268fcd210a6fb | [
"MIT"
] | null | null | null | #! /usr/bin/env python
import sys, os
url = 'http://127.0.0.1:8000/?cheat=%s' % sys.argv[1]
g = os.popen('lynx -source %r' % url, 'r')
g.read()
g.close()
| 17.333333 | 53 | 0.583333 | #! /usr/bin/env python
import sys, os
url = 'http://127.0.0.1:8000/?cheat=%s' % sys.argv[1]
g = os.popen('lynx -source %r' % url, 'r')
g.read()
g.close()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5d1c3e604b2c5fef4de0964d910367fd22483ce0 | 1,686 | py | Python | Lib/blackrenderer/backends/__init__.py | ctrlcctrlv/black-renderer | 39f1d1f91e1ea3d68ee09f0ab1d5bebb94b760da | [
"Apache-2.0"
] | 21 | 2021-04-29T09:04:59.000Z | 2022-02-09T22:18:21.000Z | Lib/blackrenderer/backends/__init__.py | ctrlcctrlv/black-renderer | 39f1d1f91e1ea3d68ee09f0ab1d5bebb94b760da | [
"Apache-2.0"
] | 47 | 2021-04-28T12:32:10.000Z | 2022-03-29T18:06:12.000Z | Lib/blackrenderer/backends/__init__.py | ctrlcctrlv/black-renderer | 39f1d1f91e1ea3d68ee09f0ab1d5bebb94b760da | [
"Apache-2.0"
] | 1 | 2022-02-09T12:32:13.000Z | 2022-02-09T12:32:13.000Z |
_surfaces = {
None: {
"cairo": "blackrenderer.backends.cairo.CairoPixelSurface",
"coregraphics": "blackrenderer.backends.coregraphics.CoreGraphicsPixelSurface",
"skia": "blackrenderer.backends.skia.SkiaPixelSurface",
"svg": "blackrenderer.backends.svg.SVGSurface",
},
".png"... | 33.72 | 87 | 0.679122 | from collections import defaultdict
import importlib
_surfaces = {
None: {
"cairo": "blackrenderer.backends.cairo.CairoPixelSurface",
"coregraphics": "blackrenderer.backends.coregraphics.CoreGraphicsPixelSurface",
"skia": "blackrenderer.backends.skia.SkiaPixelSurface",
"svg": "blac... | 0 | 0 | 0 | 0 | 0 | 595 | 0 | 9 | 90 |
748e26da767fac285c2fa982aa0426f2d98fcbd4 | 6,203 | py | Python | Python/sum-of-subarray-minimums.py | RideGreg/LeetCode | b70818b1e6947bf29519a24f78816e022ebab59e | [
"MIT"
] | 1 | 2022-01-30T06:55:28.000Z | 2022-01-30T06:55:28.000Z | Python/sum-of-subarray-minimums.py | RideGreg/LeetCode | b70818b1e6947bf29519a24f78816e022ebab59e | [
"MIT"
] | null | null | null | Python/sum-of-subarray-minimums.py | RideGreg/LeetCode | b70818b1e6947bf29519a24f78816e022ebab59e | [
"MIT"
] | 1 | 2021-12-31T03:56:39.000Z | 2021-12-31T03:56:39.000Z | # -*- encoding=utf-8 -*-
# Time: O(n)
# Space: O(n)
# 907
# Given an array of integers A, find the sum of min(B),
# where B ranges over every (contiguous) subarray of A.
#
# Since the answer may be large, return the answer modulo 10^9 + 7.
#
# Example 1:
#
# Input: [3,1,2,4]
# Output: 17
# Explanation: Subarrays are ... | 38.290123 | 141 | 0.553442 | # -*- encoding=utf-8 -*-
# Time: O(n)
# Space: O(n)
# 907
# Given an array of integers A, find the sum of min(B),
# where B ranges over every (contiguous) subarray of A.
#
# Since the answer may be large, return the answer modulo 10^9 + 7.
#
# Example 1:
#
# Input: [3,1,2,4]
# Output: 17
# Explanation: Subarrays are ... | 12 | 0 | 0 | 3,830 | 0 | 0 | 0 | -5 | 45 |
77c8378df48b90162c81aa38f2a172d99bb1ac28 | 1,315 | py | Python | case 2/case2v2.py | itchono/Electric-Atoms | 6f72cc5c400f9a73b641cb21f317cdb4e98e7838 | [
"MIT"
] | null | null | null | case 2/case2v2.py | itchono/Electric-Atoms | 6f72cc5c400f9a73b641cb21f317cdb4e98e7838 | [
"MIT"
] | null | null | null | case 2/case2v2.py | itchono/Electric-Atoms | 6f72cc5c400f9a73b641cb21f317cdb4e98e7838 | [
"MIT"
] | null | null | null | import numpy as np
def hamiltonian(ang_freq, B_0, end_time, num_steps):
'''
Generates hamiltonian at all time steps
'''
H_0 = np.zeros((num_steps, 2, 2))
H_0[:, 1, 1].fill(2*np.pi*177*10**6)
H_int = np.zeros((num_steps, 2, 2))
H_int[:, 0, 1] = B_0*2*np.pi*10**6*np.cos(2*np.pi*ang_freq*np.... | 25.784314 | 99 | 0.596198 | import numpy as np
def hamiltonian(ang_freq, B_0, end_time, num_steps):
'''
Generates hamiltonian at all time steps
'''
H_0 = np.zeros((num_steps, 2, 2))
H_0[:, 1, 1].fill(2*np.pi*177*10**6)
H_int = np.zeros((num_steps, 2, 2))
H_int[:, 0, 1] = B_0*2*np.pi*10**6*np.cos(2*np.pi*ang_freq*np.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bd02c1b97a61296c22b7370f6fc5c56cb1c44d19 | 1,557 | py | Python | neal_clock.py | FlightDev/YSPA | 5226712ebf305e7a3c686c43c996517a617f748b | [
"MIT"
] | null | null | null | neal_clock.py | FlightDev/YSPA | 5226712ebf305e7a3c686c43c996517a617f748b | [
"MIT"
] | null | null | null | neal_clock.py | FlightDev/YSPA | 5226712ebf305e7a3c686c43c996517a617f748b | [
"MIT"
] | null | null | null | from datetime import datetime
#ring
#arrow
#sphere
original_hour = vector(0, 5, 0)
original_minute = vector(0, 8, 0)
original_second = vector(0, 10, 0)
clock_face = ring(pos = (0, 0, 0), axis = (0, 0, 1), thickness = 0.5, radius = 10, color = color.white)
top_label = label(pos = (0, 10, 0), text = "12", color = color.... | 33.12766 | 103 | 0.605652 | from visual import *
from datetime import datetime
#ring
#arrow
#sphere
original_hour = vector(0, 5, 0)
original_minute = vector(0, 8, 0)
original_second = vector(0, 10, 0)
clock_face = ring(pos = (0, 0, 0), axis = (0, 0, 1), thickness = 0.5, radius = 10, color = color.white)
top_label = label(pos = (0, 10, 0), text =... | 0 | 0 | 0 | 0 | 0 | 480 | 0 | -1 | 45 |
3e1fbaec338fd20e42ba44a24b5bee7695bce871 | 3,070 | py | Python | aliquotmaf/annotators/gnomad_vcf.py | NCI-GDC/aliquot-maf-tools | 6aec9490ab7194ec605bf02c4c8e7c1cfca53973 | [
"Apache-2.0"
] | 1 | 2020-09-18T17:52:37.000Z | 2020-09-18T17:52:37.000Z | aliquotmaf/annotators/gnomad_vcf.py | NCI-GDC/aliquot-maf-tools | 6aec9490ab7194ec605bf02c4c8e7c1cfca53973 | [
"Apache-2.0"
] | null | null | null | aliquotmaf/annotators/gnomad_vcf.py | NCI-GDC/aliquot-maf-tools | 6aec9490ab7194ec605bf02c4c8e7c1cfca53973 | [
"Apache-2.0"
] | 1 | 2020-08-14T08:49:39.000Z | 2020-08-14T08:49:39.000Z | """
Implements the gnomAD annotation using the gnomAD VCF.
"""
from __future__ import absolute_import
from collections import OrderedDict
GNOMAD_SRC_TO_MAF = OrderedDict(
AF_non_cancer_eas="gnomAD_non_cancer_EAS_AF",
AF_non_cancer_afr="gnomAD_non_cancer_AFR_AF",
AF_non_cancer_ami="gnomAD_non_cancer_AMI_A... | 32.315789 | 88 | 0.623779 | """
Implements the gnomAD annotation using the gnomAD VCF.
"""
from __future__ import absolute_import
from collections import OrderedDict
import pysam
from aliquotmaf.converters.builder import get_builder
from .annotator import Annotator
GNOMAD_SRC_TO_MAF = OrderedDict(
AF_non_cancer_eas="gnomAD_non_cancer_EA... | 0 | 232 | 0 | 1,774 | 0 | 0 | 0 | 34 | 92 |
a1584998f4a814ad7dbadce3d789a6dae81a348b | 1,339 | py | Python | exercicios/exe098/exe098.py | tiagolsouza/exercicios-Curso-em-video-PYTHON | e4e6975fac7e4883aeab58b970c6ca72895564e4 | [
"MIT"
] | null | null | null | exercicios/exe098/exe098.py | tiagolsouza/exercicios-Curso-em-video-PYTHON | e4e6975fac7e4883aeab58b970c6ca72895564e4 | [
"MIT"
] | null | null | null | exercicios/exe098/exe098.py | tiagolsouza/exercicios-Curso-em-video-PYTHON | e4e6975fac7e4883aeab58b970c6ca72895564e4 | [
"MIT"
] | null | null | null | a = 50
print('\033[32m_\033[m' * a)
print(f'\033[1;32m{"SISTEMA DE CONTAGEM ADAPTAVEL":=^{a}}\033[m')
print('\033[32m-\033[m' * a)
'''print('-='*16)
print('\033[1;34mContagem de 1 ate 10 de 1 em 1:\033[m')
for c in range(1, 11):
print(f'\033[35m{c}', end=' ')
#sleep(0.5)
print('\033[34m\nFIM!\033[m')
print(... | 24.345455 | 76 | 0.521285 | a = 50
print('\033[32m_\033[m' * a)
print(f'\033[1;32m{"SISTEMA DE CONTAGEM ADAPTAVEL":=^{a}}\033[m')
print('\033[32m-\033[m' * a)
from time import sleep
def cont(a, b, c):
if c == 0:
passo = 1
else:
passo = abs(c)
print('\033[34m-=\033[m' * 20)
print(f'\033[1;34mContagem de {a} ate {... | 2 | 0 | 0 | 0 | 0 | 551 | 0 | 1 | 46 |
9737e03f7a2ab59c949b8d081ae673ebcc858977 | 2,646 | py | Python | proyectofinal/main.py | RobelisRuiz/Programacion-4 | 8c979ad862430801dd2608298a0369ec8457bde9 | [
"Apache-2.0"
] | null | null | null | proyectofinal/main.py | RobelisRuiz/Programacion-4 | 8c979ad862430801dd2608298a0369ec8457bde9 | [
"Apache-2.0"
] | null | null | null | proyectofinal/main.py | RobelisRuiz/Programacion-4 | 8c979ad862430801dd2608298a0369ec8457bde9 | [
"Apache-2.0"
] | null | null | null | from flask import Flask
from flask_restful import Api
app = Flask(__name__)
api = Api(app)
api.add_resource(Citas, '/citas')
# usar method tipo DELETE
if __name__ == '__main__':
app.run()
| 31.5 | 227 | 0.60771 | from flask import Flask, render_template, request
from flask_restful import Resource, Api, reqparse
import pandas as pd
import ast
import requests
app = Flask(__name__)
api = Api(app)
class Citas(Resource):
def get(self):
data = pd.read_csv('citasdb.csv')
data = data.to_dict()
return {'c... | 2 | 1,104 | 0 | 1,177 | 0 | 0 | 0 | 27 | 135 |
5fc28a8abfd025be23ab1851f4f01b6e0b04e40f | 459 | py | Python | SPOJ/FIBOSUM.py | cquark7/competitive_programming | c90754d91628b273703c74e373356394732f0cd3 | [
"MIT"
] | 1 | 2019-06-16T08:21:56.000Z | 2019-06-16T08:21:56.000Z | SPOJ/FIBOSUM.py | cquark7/competitive_programming | c90754d91628b273703c74e373356394732f0cd3 | [
"MIT"
] | null | null | null | SPOJ/FIBOSUM.py | cquark7/competitive_programming | c90754d91628b273703c74e373356394732f0cd3 | [
"MIT"
] | null | null | null | from sys import stdout, stdin
m = 1000000007
dic = {0: (0, 1)}
t = int(stdin.readline())
for tc in range(t):
L, R = map(int, stdin.readline().split())
stdout.write("%d\n" % ((fib(R + 2)[0] - fib(L + 1)[0]) % m))
| 19.125 | 64 | 0.437908 | from sys import stdout, stdin
m = 1000000007
dic = {0: (0, 1)}
def fib(n):
if n in dic:
return dic[n]
a, b = fib(n >> 1)
c = (a * (2 * b - a)) % m
d = (a * a + b * b) % m
if n & 1:
dic[n] = (d, c + d)
return d, c + d
dic[n] = (c, d)
return c, d
t = int(stdin.read... | 0 | 0 | 0 | 0 | 0 | 212 | 0 | 0 | 23 |
89b8b9f88bc652ff40a37ffc207bfed349edc46f | 1,993 | py | Python | Prog2/modulo_letra.py | firedomito/Atividades-Python | 9d90dbc82368dd2088b1283c63f6afbab3466382 | [
"MIT"
] | null | null | null | Prog2/modulo_letra.py | firedomito/Atividades-Python | 9d90dbc82368dd2088b1283c63f6afbab3466382 | [
"MIT"
] | null | null | null | Prog2/modulo_letra.py | firedomito/Atividades-Python | 9d90dbc82368dd2088b1283c63f6afbab3466382 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# modulo_letra.py
#
# Copyright 2021
# Autor: Guilherme Silveira Mendes
#
############################
# Cdigo fonte em Python 3
############################
#Todas funes abaixo fazem e retornam os padres pedidos
| 22.393258 | 91 | 0.574511 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# modulo_letra.py
#
# Copyright 2021
# Autor: Guilherme Silveira Mendes
#
############################
# Código fonte em Python 3
############################
#Todas funções abaixo fazem e retornam os padrões pedidos
def opc_a(caracter):
#declaracao de variavel
... | 8 | 0 | 0 | 0 | 0 | 1,574 | 0 | 0 | 141 |
9c51711f73278768328415d62a566eef3080c3ee | 7,464 | py | Python | xpp/Spatial_Overlap_Scan_Annotated_Tested.py | ZryletTC/xpp | e3dee02bf0fa05289dd1ad27776cabe593ffd46c | [
"BSD-3-Clause-LBNL"
] | null | null | null | xpp/Spatial_Overlap_Scan_Annotated_Tested.py | ZryletTC/xpp | e3dee02bf0fa05289dd1ad27776cabe593ffd46c | [
"BSD-3-Clause-LBNL"
] | 1 | 2020-04-07T20:31:58.000Z | 2020-04-07T20:31:58.000Z | xpp/Spatial_Overlap_Scan_Annotated_Tested.py | ZryletTC/xpp | e3dee02bf0fa05289dd1ad27776cabe593ffd46c | [
"BSD-3-Clause-LBNL"
] | 2 | 2018-10-30T23:16:03.000Z | 2020-04-07T20:04:51.000Z | """
General Setup and Imports
"""
get_ipython().run_line_magic('matplotlib', 'tk')
import matplotlib.pyplot as plt
from bluesky import RunEngine
from bluesky.callbacks.best_effort import BestEffortCallback
from bluesky.utils import install_nb_kicker
from functools import partial
from ophyd.sim import SynAxis, SynSignal... | 40.565217 | 299 | 0.673633 | """
General Setup and Imports
"""
get_ipython().run_line_magic('matplotlib', 'tk')
import matplotlib.pyplot as plt
from bluesky import RunEngine
from bluesky.callbacks.best_effort import BestEffortCallback
from bluesky.plans import *
from bluesky.preprocessors import run_wrapper
from bluesky.utils import install_nb_kic... | 0 | 0 | 0 | 0 | 4,170 | 0 | 0 | 153 | 223 |
d70845570bd36e699b61ef538f2f7fc77163a245 | 1,804 | pyw | Python | ARDUINO.pyw | ProfessorCristiano/Python-com-Arduino | 6141d02a14eb9fd3aafb35c3db78c7474913a739 | [
"Apache-2.0"
] | null | null | null | ARDUINO.pyw | ProfessorCristiano/Python-com-Arduino | 6141d02a14eb9fd3aafb35c3db78c7474913a739 | [
"Apache-2.0"
] | null | null | null | ARDUINO.pyw | ProfessorCristiano/Python-com-Arduino | 6141d02a14eb9fd3aafb35c3db78c7474913a739 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Feb 28 20:36:35 2019
@author: cristiano_001325
"""
'''Interessa isso aqui para o arduino'''
import serial
from tkinter import messagebox
window = Tk()
window.title("Programa para Ligar e Desligar")
wi... | 29.096774 | 114 | 0.544346 | # -*- coding: utf-8 -*-
"""
Created on Thu Feb 28 20:36:35 2019
@author: cristiano_001325
"""
'''Interessa isso aqui para o arduino'''
import serial
from tkinter import *
from tkinter import messagebox
window = Tk()
window.title("Programa pa... | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 25 |
881d7f6433ebdd9c3dccdc3f0e493549b1f43eb1 | 4,058 | py | Python | goticket/tickets/migrations/0001_initial.py | pmburu/GoTicketV2 | 97ca68a9ca5e1c5793c03c6983c5b343f59dc4d2 | [
"MIT"
] | null | null | null | goticket/tickets/migrations/0001_initial.py | pmburu/GoTicketV2 | 97ca68a9ca5e1c5793c03c6983c5b343f59dc4d2 | [
"MIT"
] | 7 | 2022-02-14T23:32:37.000Z | 2022-03-31T23:29:05.000Z | goticket/tickets/migrations/0001_initial.py | pmburu/GoTicketV2 | 97ca68a9ca5e1c5793c03c6983c5b343f59dc4d2 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.11 on 2022-02-01 20:57
import django.contrib.postgres.fields
| 47.186047 | 160 | 0.598817 | # Generated by Django 3.2.11 on 2022-02-01 20:57
from django.conf import settings
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
('events', '0001_initi... | 0 | 0 | 0 | 3,827 | 0 | 0 | 0 | 31 | 112 |
4e6fdd1ac2b66a61b01b6bcfde3d15838dbc5f34 | 4,486 | py | Python | tablarray/np2ta/bin_op.py | chriscannon9001/tablarray | f07530f84a8c86abe996cdb999233ed9bb8edf7e | [
"BSD-3-Clause"
] | null | null | null | tablarray/np2ta/bin_op.py | chriscannon9001/tablarray | f07530f84a8c86abe996cdb999233ed9bb8edf7e | [
"BSD-3-Clause"
] | null | null | null | tablarray/np2ta/bin_op.py | chriscannon9001/tablarray | f07530f84a8c86abe996cdb999233ed9bb8edf7e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
My idea is to have a comparable lib to numpy.add, .sum, etc.
But it will work regardless of whether the x1, x2, ... are numpy or TablArray.
Created on Sun May 17 18:17:59 2020
@author: chris
"""
import numpy as np
from .. import misc
def _cast_other_type(other, Ta... | 39.008696 | 79 | 0.707089 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
My idea is to have a comparable lib to numpy.add, .sum, etc.
But it will work regardless of whether the x1, x2, ... are numpy or TablArray.
Created on Sun May 17 18:17:59 2020
@author: chris
"""
import functools
import numpy as np
from .. import misc
def _cast_ot... | 0 | 1,287 | 0 | 0 | 0 | 0 | 0 | -5 | 49 |
17dcbe1cc0608653907846726ef988f363f27f7d | 14,889 | py | Python | trace_nums.py | buckbaskin/data-1 | a9d9dd62778c1c0568cea572cb97cbf16e76a1b2 | [
"MIT"
] | null | null | null | trace_nums.py | buckbaskin/data-1 | a9d9dd62778c1c0568cea572cb97cbf16e76a1b2 | [
"MIT"
] | 17 | 2015-10-28T17:34:24.000Z | 2016-07-06T06:26:55.000Z | trace_nums.py | buckbaskin/data-1 | a9d9dd62778c1c0568cea572cb97cbf16e76a1b2 | [
"MIT"
] | null | null | null |
# use the math_data decorator to take any function and convert its output to
# traced data
# def math_data # decorator
# convert any data to trace data with the data function
| 34.706294 | 121 | 0.623615 | import hashlib
import time
import weakref
# use the math_data decorator to take any function and convert its output to
# traced data
# def math_data # decorator
# convert any data to trace data with the data function
def Data(info, user_id=None):
print 'Data called with info type: '+str(type(info))
if isinst... | 0 | 0 | 0 | 13,628 | 0 | 926 | 0 | -24 | 180 |
384759e0ecaf428a3fc69d900bf758b54899c2c9 | 1,081 | py | Python | rust_check_coverage.py | opencinemac/azure-pipelines-scripts | e90b7839eb52bc0ae7c29182fc8c7c9c292817c9 | [
"MIT"
] | 1 | 2021-05-03T06:23:30.000Z | 2021-05-03T06:23:30.000Z | rust_check_coverage.py | opencinemac/azure-pipelines-scripts | e90b7839eb52bc0ae7c29182fc8c7c9c292817c9 | [
"MIT"
] | null | null | null | rust_check_coverage.py | opencinemac/azure-pipelines-scripts | e90b7839eb52bc0ae7c29182fc8c7c9c292817c9 | [
"MIT"
] | null | null | null | import pathlib
import sys
from configparser import ConfigParser
from xml.etree import ElementTree as et
CONFIG_PATH: pathlib.Path = pathlib.Path(__file__).parent.parent.parent / "setup.cfg"
COVERAGE_XML = pathlib.Path("./zdevelop/tests/_reports/cobertura.xml")
def load_cfg() -> ConfigParser:
"""
loads libra... | 28.447368 | 85 | 0.683626 | import pathlib
import sys
from configparser import ConfigParser
from xml.etree import ElementTree as et
CONFIG_PATH: pathlib.Path = pathlib.Path(__file__).parent.parent.parent / "setup.cfg"
COVERAGE_XML = pathlib.Path("./zdevelop/tests/_reports/cobertura.xml")
def load_cfg() -> ConfigParser:
"""
loads libra... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
57ff595b47e2d9b1807064946c6c967710842861 | 116 | py | Python | subdir1/intermediate_2_from_subdir1.py | cramraj8/RamPyPackage | 6f4e046e63860a5894bdbe3b4a3059a4f835a8da | [
"Apache-2.0"
] | null | null | null | subdir1/intermediate_2_from_subdir1.py | cramraj8/RamPyPackage | 6f4e046e63860a5894bdbe3b4a3059a4f835a8da | [
"Apache-2.0"
] | null | null | null | subdir1/intermediate_2_from_subdir1.py | cramraj8/RamPyPackage | 6f4e046e63860a5894bdbe3b4a3059a4f835a8da | [
"Apache-2.0"
] | null | null | null | print(2)
| 14.5 | 57 | 0.784483 |
import sys
print(2)
class intermediate_2_from_subdir1:
print('Hi, this is intermediate_2_from_subdir1 FILE')
| 0 | 0 | 0 | 72 | 0 | 0 | 0 | -11 | 46 |
89760f6c224e8222efaefb6034eae0c1e699efae | 4,208 | py | Python | go_containers/go_application_containers/irrigation/eto/ref/eto_code/eto_monitoring_py3.py | NanoDataCenter/NanoDataCenter-embedded_kubernets-docker_images | 025b5b0b15a0e11bb4cef7ea3b28d48613e574c1 | [
"MIT"
] | null | null | null | go_containers/go_application_containers/irrigation/eto/ref/eto_code/eto_monitoring_py3.py | NanoDataCenter/NanoDataCenter-embedded_kubernets-docker_images | 025b5b0b15a0e11bb4cef7ea3b28d48613e574c1 | [
"MIT"
] | 18 | 2021-07-26T03:18:11.000Z | 2022-02-28T21:17:29.000Z | go_containers/go_application_containers/irrigation/eto/ref/eto_code/eto_monitoring_py3.py | NanoDataCenter/NanoDataCenter-embedded_kubernets-docker_images | 025b5b0b15a0e11bb4cef7ea3b28d48613e574c1 | [
"MIT"
] | 1 | 2020-07-23T21:56:18.000Z | 2020-07-23T21:56:18.000Z | #
#
# File: eto.py
#
#
import datetime
ONE_DAY = 24 * 3600
if __name__ == "__main__":
import datetime
import json
#import load_files_py3
from common_tools.redis_support_py3.graph_query_support_py3 import Query_Support
from common_tools.py_cf_new_py3.chain_flow_py3 import CF_Ba... | 23.909091 | 100 | 0.636644 | #
#
# File: eto.py
#
#
import datetime
from common_tools.redis_support_py3.construct_data_handlers_py3 import Generate_Handlers
from common_tools.system_error_log_py3 import System_Error_Logging
from common_tools.Pattern_tools_py3.builders.common_directors_py3 import construct_all_handlers
from common_tools.file_ser... | 0 | 0 | 0 | 2,053 | 0 | 696 | 0 | 185 | 372 |
8376477c27168358ef70e9b6873ef1e56cc1ea51 | 10,950 | py | Python | android/python/uplinks.py | jlivingstonsg/Cellbots-2019 | 2e4635beab0cabef7a75e9d863d588b51db0e74d | [
"Apache-2.0"
] | 2 | 2018-10-11T16:11:11.000Z | 2018-10-11T16:15:53.000Z | android/python/uplinks.py | jlivingstonsg/Cellbots-2019 | 2e4635beab0cabef7a75e9d863d588b51db0e74d | [
"Apache-2.0"
] | 38 | 2015-03-03T22:32:20.000Z | 2015-03-03T22:32:47.000Z | android/python/uplinks.py | jlivingstonsg/Cellbots-2019 | 2e4635beab0cabef7a75e9d863d588b51db0e74d | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You may
# obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | 31.107955 | 77 | 0.664566 | # Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You may
# obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | 0 | 0 | 0 | 7,807 | 0 | 0 | 0 | 0 | 161 |
ae85e86dc935d92ac7d639c59daa54428e9e3086 | 1,779 | py | Python | examples/developer/test_get_input.py | Duckie-town-isu/tulip-control | 07de9f85591a36e9556c612a371e9c28693156d2 | [
"BSD-3-Clause"
] | 91 | 2015-01-28T10:18:48.000Z | 2022-02-09T16:37:32.000Z | examples/developer/test_get_input.py | Duckie-town-isu/tulip-control | 07de9f85591a36e9556c612a371e9c28693156d2 | [
"BSD-3-Clause"
] | 166 | 2015-01-21T17:30:58.000Z | 2022-01-31T19:42:24.000Z | examples/developer/test_get_input.py | Duckie-town-isu/tulip-control | 07de9f85591a36e9556c612a371e9c28693156d2 | [
"BSD-3-Clause"
] | 34 | 2015-08-25T01:04:23.000Z | 2021-11-05T19:35:59.000Z | """Usage example for the function `abstract.get_input`.
To be run after `continuous.py`, in same session.
For example, within an `ipython` interactive session in
this directory:
run ../continuous.py
run -i test_get_input.py
"""
from __future__ import print_function
from tulip.abstract import get_input, find_discrete... | 24.708333 | 57 | 0.660483 | """Usage example for the function `abstract.get_input`.
To be run after `continuous.py`, in same session.
For example, within an `ipython` interactive session in
this directory:
run ../continuous.py
run -i test_get_input.py
"""
from __future__ import print_function
from tulip.abstract import get_input, find_discrete... | 0 | 0 | 0 | 0 | 0 | 629 | 0 | 0 | 23 |
e4787bcced6a6d43aadc72b20003c00b3fbe65f8 | 1,532 | py | Python | KipyServer.py | Xana8U/Kipy | f4f55fb4bc4c1df7ad2fda14e779ce3d860ce17f | [
"MIT"
] | null | null | null | KipyServer.py | Xana8U/Kipy | f4f55fb4bc4c1df7ad2fda14e779ce3d860ce17f | [
"MIT"
] | null | null | null | KipyServer.py | Xana8U/Kipy | f4f55fb4bc4c1df7ad2fda14e779ce3d860ce17f | [
"MIT"
] | null | null | null | import socketserver
import sqlite3
conn = sqlite3.connect("Messages.db")
c = conn.cursor()
'''Handles connections and returns a data to clients.'''
if __name__ == "__main__":
host, port = "192.168.100.10", 5479
with socketserver.TCPServer((host, port), TCPhandler) as server:
server.serve_forever()
... | 40.315789 | 113 | 0.546345 | import socketserver
import sqlite3
import time
conn = sqlite3.connect("Messages.db")
c = conn.cursor()
'''Handles connections and returns a data to clients.'''
class TCPhandler(socketserver.BaseRequestHandler):
def handle(self):
self.data = self.request.recv(1024).strip()
if str(self.data).strip("... | 8 | 0 | 0 | 1,173 | 0 | 0 | 0 | -10 | 44 |
f6a86d14e08ecedfbe75dfaa84c2f975a99d6c43 | 8,316 | py | Python | john_doe/cities/us/nebraska.py | xioren/JohnDoe | 4bd16f394709cac246438c8ffd650b4b301cb2b7 | [
"MIT"
] | null | null | null | john_doe/cities/us/nebraska.py | xioren/JohnDoe | 4bd16f394709cac246438c8ffd650b4b301cb2b7 | [
"MIT"
] | null | null | null | john_doe/cities/us/nebraska.py | xioren/JohnDoe | 4bd16f394709cac246438c8ffd650b4b301cb2b7 | [
"MIT"
] | null | null | null | cities = [
'Abie',
'Adams',
'Ainsworth',
'Albion',
'Alda',
'Alexandria',
'Allen',
'Alliance',
'Alma',
'Alvo',
'Amelia',
'Ames',
'Amherst',
'Angora',
'Anselmo',
'Ansley',
'Arapahoe',
'Arcadia',
'Archer',
'Arlington',
'Arnold',
'Arthu... | 15.314917 | 23 | 0.472102 | cities = [
'Abie',
'Adams',
'Ainsworth',
'Albion',
'Alda',
'Alexandria',
'Allen',
'Alliance',
'Alma',
'Alvo',
'Amelia',
'Ames',
'Amherst',
'Angora',
'Anselmo',
'Ansley',
'Arapahoe',
'Arcadia',
'Archer',
'Arlington',
'Arnold',
'Arthu... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6f993d04def6e44a04a5dd8169dac5ed56c6448a | 1,312 | py | Python | fabfile.py | MinnPost/minnpost-heroku-cron | bc956ae8d8de90ce303cf6797c257b79954f7537 | [
"MIT"
] | null | null | null | fabfile.py | MinnPost/minnpost-heroku-cron | bc956ae8d8de90ce303cf6797c257b79954f7537 | [
"MIT"
] | null | null | null | fabfile.py | MinnPost/minnpost-heroku-cron | bc956ae8d8de90ce303cf6797c257b79954f7537 | [
"MIT"
] | null | null | null | from __future__ import with_statement
import requests
import pprint
import boto
import json
"""
Some defaults
"""
env.s3_bucket = 'minnpost.data'
env.project_name = 'minnpost-cron'
def s3_bucket(bucket):
"""
Select bucket
"""
env.s3_bucket = bucket
def cache_google_spreadsheet_to_s3(key = ''):
"""
C... | 21.508197 | 107 | 0.714177 | from __future__ import with_statement
from fabric.api import *
import requests
import pprint
import boto
import json
"""
Some defaults
"""
env.s3_bucket = 'minnpost.data'
env.project_name = 'minnpost-cron'
def s3_bucket(bucket):
"""
Select bucket
"""
env.s3_bucket = bucket
def cache_google_spreadsheet_t... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 22 |
e6927d4ece95b86ceada7c692940a82d2c51bda0 | 263 | py | Python | AtCoder/AGC025/A.py | takaaki82/Java-Lessons | c4f11462bf84c091527dde5f25068498bfb2cc49 | [
"MIT"
] | 1 | 2018-11-25T04:15:45.000Z | 2018-11-25T04:15:45.000Z | AtCoder/AGC025/A.py | takaaki82/Java-Lessons | c4f11462bf84c091527dde5f25068498bfb2cc49 | [
"MIT"
] | null | null | null | AtCoder/AGC025/A.py | takaaki82/Java-Lessons | c4f11462bf84c091527dde5f25068498bfb2cc49 | [
"MIT"
] | 2 | 2018-08-08T13:01:14.000Z | 2018-11-25T12:38:36.000Z | N = int(input())
r = float("inf")
for i in range(1, N):
A = i
B = N - i
a = 0
b = 0
while A >= 1:
a += A % 10
A /= 10
while B >= 1:
b += B % 10
B /= 10
if a + b <= r:
r = a + b
print(int(r))
| 12.52381 | 21 | 0.323194 | N = int(input())
r = float("inf")
for i in range(1, N):
A = i
B = N - i
a = 0
b = 0
while A >= 1:
a += A % 10
A /= 10
while B >= 1:
b += B % 10
B /= 10
if a + b <= r:
r = a + b
print(int(r))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
354d23bb275cf064e3dedcbac4e544b3f0972f63 | 150 | py | Python | django/social_network/feed/urls.py | sixfwa/django-examples | 4da7f9d255e622482a8562f0eeb0417d623c9385 | [
"MIT"
] | null | null | null | django/social_network/feed/urls.py | sixfwa/django-examples | 4da7f9d255e622482a8562f0eeb0417d623c9385 | [
"MIT"
] | 24 | 2021-03-19T12:01:04.000Z | 2022-02-10T12:21:49.000Z | django/social_network/feed/urls.py | sixfwa/django-examples | 4da7f9d255e622482a8562f0eeb0417d623c9385 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path("", views.feed, name="feed"),
path("post", views.post, name="post")
]
| 16.666667 | 41 | 0.64 | from django.urls import path
from . import views
urlpatterns = [
path("", views.feed, name="feed"),
path("post", views.post, name="post")
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f27c0861338650a811b0a9e143bf2b344f299a1e | 392 | py | Python | tamanhostring.py | MatheusSouza70/Exerc-cios-Python | f8878a0c9d62e49db61dcbce0ee10a161e12a894 | [
"MIT"
] | 1 | 2022-03-14T01:35:09.000Z | 2022-03-14T01:35:09.000Z | tamanhostring.py | MatheusSouza70/Exerc-cios-Python | f8878a0c9d62e49db61dcbce0ee10a161e12a894 | [
"MIT"
] | null | null | null | tamanhostring.py | MatheusSouza70/Exerc-cios-Python | f8878a0c9d62e49db61dcbce0ee10a161e12a894 | [
"MIT"
] | null | null | null | frase = str(input("Informe algo entre 1 a 10 caracteres: "))
print(fraseprincipal()) | 28 | 61 | 0.602041 | frase = str(input("Informe algo entre 1 a 10 caracteres: "))
def fraseprincipal():
if len(frase) > 10:
print("Acima do limite de caracteres.")
return False
elif len(frase) < 1:
print("Abaixo do número necessário de caracteres.")
return False
else:
print("Es... | 6 | 0 | 0 | 0 | 0 | 277 | 0 | 0 | 25 |
d9a4e095632ea55a1d83eaa1417e34f04e2f2325 | 2,219 | py | Python | Python/teste2/src/main.py | RodrigoGCorrea/estagioIntuitiveCare | 4c82ff9842c7270c9d65a6d31c70b2e2f38c4303 | [
"MIT"
] | null | null | null | Python/teste2/src/main.py | RodrigoGCorrea/estagioIntuitiveCare | 4c82ff9842c7270c9d65a6d31c70b2e2f38c4303 | [
"MIT"
] | null | null | null | Python/teste2/src/main.py | RodrigoGCorrea/estagioIntuitiveCare | 4c82ff9842c7270c9d65a6d31c70b2e2f38c4303 | [
"MIT"
] | null | null | null | # encoding: utf-8
main() | 32.632353 | 108 | 0.649392 | # encoding: utf-8
from parse import *
from tabula import read_pdf
from pdfrw import PdfReader, PdfWriter
from pandas import to_numeric, concat
from zipfile import ZipFile, ZIP_DEFLATED
import os
def main():
# Cortei o pdf para conter somente a parte em que queremos tirar os dados para facilitar o processamento
... | 16 | 0 | 0 | 0 | 0 | 1,981 | 0 | 45 | 155 |
0be991d39f906017164e29dde0f547d5ec81b7bf | 1,424 | py | Python | bayes/challenge-1/data_gen.py | 4lrz/ml-newbie | 64bbf77fb3b5bf4fe7479eb75ea6182714de36f3 | [
"MIT"
] | 7 | 2019-04-18T12:12:50.000Z | 2019-04-30T05:47:30.000Z | bayes/challenge-1/data_gen.py | 4lrz/ml-newbie | 64bbf77fb3b5bf4fe7479eb75ea6182714de36f3 | [
"MIT"
] | null | null | null | bayes/challenge-1/data_gen.py | 4lrz/ml-newbie | 64bbf77fb3b5bf4fe7479eb75ea6182714de36f3 | [
"MIT"
] | 1 | 2020-05-31T09:18:07.000Z | 2020-05-31T09:18:07.000Z | import bayes.NB as nb
nb = nb.GaussNB()
data = generate_dataset(1000)
train_list, test_list = nb.split_data(data, weight=0.8)
# print("Using %s rows for training and %s rows for testing" % (len(train_list), len(test_list)))
group = nb.group_by_class(data, -1) # designating the last column as the class column
# pri... | 26.867925 | 97 | 0.609551 | import bayes.NB as nb
import numpy as np
import random
def data_generator(mean, cov, count):
np.random.seed(1)
x, y = np.random.multivariate_normal(mean, cov, count).T
# plt.plot(x, y, 'x')
# plt.axis('equal')
# plt.show()
return [x, y]
def generate_dataset(count):
# class 1
mean1 = ... | 0 | 0 | 0 | 0 | 0 | 803 | 0 | -11 | 90 |
d0462abd5a3ad50b073f98d830c1dcb8d789cb4f | 18,663 | py | Python | WechatBot.py | ChengxiX/WechatEnhanceBot | 438254bc0c44b43197cc3b90e843032af393e343 | [
"Apache-2.0"
] | 2 | 2021-02-17T04:11:08.000Z | 2021-11-19T14:40:19.000Z | WechatBot.py | ChengxiX/WechatEnhanceBot | 438254bc0c44b43197cc3b90e843032af393e343 | [
"Apache-2.0"
] | null | null | null | WechatBot.py | ChengxiX/WechatEnhanceBot | 438254bc0c44b43197cc3b90e843032af393e343 | [
"Apache-2.0"
] | null | null | null | from PyWeChatSpy import WeChatSpy
import logging
import os
import shutil
from queue import Queue
import json
from apscheduler.schedulers.background import BackgroundScheduler
logger = logging.getLogger(__file__)
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s [%(threadName)s] %(levelname)s:... | 48.224806 | 133 | 0.455339 | from PyWeChatSpy import WeChatSpy
from PyWeChatSpy.command import *
from PyWeChatSpy.proto import spy_pb2
from lxml import etree
import time
import logging
import os
import shutil
from queue import Queue
import json
import random
from apscheduler.schedulers.background import BackgroundScheduler
import re
import uuid
... | 2,652 | 0 | 0 | 0 | 0 | 15,650 | 0 | -18 | 224 |
f3c17fbbdbf185127806baf6be4b9912d78cee9f | 637 | py | Python | fdk_client/platform/models/Quantities.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | fdk_client/platform/models/Quantities.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | fdk_client/platform/models/Quantities.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | """Platform Models."""
| 21.233333 | 67 | 0.751962 | """Platform Models."""
from marshmallow import fields, Schema
from marshmallow.validate import OneOf
from ..enums import *
from ..models.BaseSchema import BaseSchema
from .NotAvailable import NotAvailable
from .Sellable import Sellable
from .OrderCommitted import OrderCommitted
from .Damaged import Damaged
class... | 0 | 0 | 0 | 294 | 0 | 0 | 0 | 109 | 204 |
e4efbc4844e349e36cf78d83d53369230e7ec9c5 | 4,387 | py | Python | others/fw-verif/8051secureboot/sha/atomic/ila/sim.py | tinochinamora/iw_imdb | 89964024bee7f8eaaa25530a8d40155251345be0 | [
"MIT"
] | 3 | 2021-09-10T08:14:45.000Z | 2022-02-25T04:53:12.000Z | others/fw-verif/8051secureboot/sha/atomic/ila/sim.py | PrincetonUniversity/ILA-Modeling-Verification | 88964aad8c465c9da82f1ec66425da9f16fc8d29 | [
"MIT"
] | 1 | 2018-06-25T08:49:22.000Z | 2018-06-25T08:49:22.000Z | others/fw-verif/8051secureboot/sha/atomic/ila/sim.py | PrincetonUniversity/ILA-Modeling-Verification | 88964aad8c465c9da82f1ec66425da9f16fc8d29 | [
"MIT"
] | 3 | 2018-06-26T11:31:40.000Z | 2021-12-01T20:16:21.000Z | # simulator for synthesizing SHA ILA without child-instructions.
| 34.007752 | 101 | 0.489856 | # simulator for synthesizing SHA ILA without child-instructions.
from mmio import mmiodev, NOP, RD, WR
import sha as SHAFunc
def as_chars (s, n):
b = []
for i in xrange (n):
byte = s & 0xff
s >>= 8
b.append (byte)
return [chr(i) for i in b]
def to_num (s, n):
num = 0
for i... | 0 | 0 | 0 | 3,975 | 0 | 216 | 0 | 16 | 114 |
8274044b161d333e3d02c5a1a8c4aadb43beed77 | 11,821 | py | Python | Python/airflow/custom_airflow_dag/dags_customer_invoice/postgresql-collect.py | lveagithub/misc_python | 1f6b8ca4cbb9f22954a9adb999791a97b522b33a | [
"MIT"
] | null | null | null | Python/airflow/custom_airflow_dag/dags_customer_invoice/postgresql-collect.py | lveagithub/misc_python | 1f6b8ca4cbb9f22954a9adb999791a97b522b33a | [
"MIT"
] | null | null | null | Python/airflow/custom_airflow_dag/dags_customer_invoice/postgresql-collect.py | lveagithub/misc_python | 1f6b8ca4cbb9f22954a9adb999791a97b522b33a | [
"MIT"
] | null | null | null | from airflow import DAG
from datetime import datetime, timedelta
from airflow.providers.postgres.operators.postgres import PostgresOperator
from airflow.providers.mysql.operators.mysql import MySqlOperator
from airflow.providers.postgres.hooks.postgres import PostgresHook
from airflow.providers.mysql.hooks.mysql import... | 35.605422 | 308 | 0.700787 | from airflow import DAG
from datetime import datetime, timedelta
from airflow.providers.postgres.operators.postgres import PostgresOperator
from airflow.providers.mysql.operators.mysql import MySqlOperator
from airflow.providers.postgres.hooks.postgres import PostgresHook
from airflow.providers.mysql.hooks.mysql import... | 0 | 0 | 0 | 0 | 0 | 464 | 0 | 9 | 45 |
eb01afe25b9a46e07d51f6148516bcfce352957d | 2,993 | py | Python | tests/test_run_remote.py | RedisLabsModules/redisbench-admin | d8573d3414e5e846411d2875555deca5c8a7d0f1 | [
"Apache-2.0"
] | 5 | 2021-08-03T12:38:30.000Z | 2022-03-23T07:35:38.000Z | tests/test_run_remote.py | RedisLabsModules/redisbench-admin | d8573d3414e5e846411d2875555deca5c8a7d0f1 | [
"Apache-2.0"
] | 91 | 2021-03-17T12:05:35.000Z | 2022-03-29T22:20:00.000Z | tests/test_run_remote.py | RedisLabsModules/redisbench-admin | d8573d3414e5e846411d2875555deca5c8a7d0f1 | [
"Apache-2.0"
] | 2 | 2021-06-07T14:06:58.000Z | 2021-07-27T10:37:15.000Z | # BSD 3-Clause License
#
# Copyright (c) 2021., Redis Labs Modules
# All rights reserved.
#
| 29.343137 | 84 | 0.598396 | # BSD 3-Clause License
#
# Copyright (c) 2021., Redis Labs Modules
# All rights reserved.
#
import os
import redis
from redisbench_admin.run.metrics import collect_redis_metrics
from redistimeseries.client import Client
from redisbench_admin.run_remote.run_remote import export_redis_metrics
def test_export_redis... | 0 | 0 | 0 | 0 | 0 | 2,672 | 0 | 90 | 135 |
f91828dda204b8ab4d040a8352b496d3ad165980 | 2,093 | py | Python | volvox-share.py | krylofficiall/volvox-share | 8d5493fc87d3e351a8075826494117bde17d6b0d | [
"Apache-2.0"
] | null | null | null | volvox-share.py | krylofficiall/volvox-share | 8d5493fc87d3e351a8075826494117bde17d6b0d | [
"Apache-2.0"
] | null | null | null | volvox-share.py | krylofficiall/volvox-share | 8d5493fc87d3e351a8075826494117bde17d6b0d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf8 -*-
import telebot
print("Coded and designed by Krylov Vladimir")
bot = telebot.TeleBot('your token here')
keyboard1 = telebot.types.ReplyKeyboardMarkup()
keyboard1.row(' ', ' ', ' ', ' ')
bot.polling() | 43.604167 | 123 | 0.62924 | # -*- coding: utf8 -*-
import telebot
import os
print("Coded and designed by Krylov Vladimir")
bot = telebot.TeleBot('your token here')
keyboard1 = telebot.types.ReplyKeyboardMarkup()
keyboard1.row('Загрузить файл', 'О проекте', 'Просмотр файлов', 'О компьютере')
@bot.message_handler(commands=['start'])
def... | 612 | 1,499 | 0 | 0 | 0 | 0 | 0 | -12 | 69 |
3f4b25b92bfb2d655012bf2c7736c0bc8ea1068d | 6,488 | py | Python | model/updating/drn.py | jiaming-wang/N_SR | 75eb04647ba0e778476fb0714fa20c8226e968b2 | [
"Apache-2.0"
] | 9 | 2020-05-13T14:02:37.000Z | 2021-12-06T06:54:47.000Z | model/updating/drn.py | jiaming-wang/N_SR | 75eb04647ba0e778476fb0714fa20c8226e968b2 | [
"Apache-2.0"
] | 1 | 2021-05-09T13:13:23.000Z | 2021-05-11T12:58:32.000Z | model/updating/drn.py | jiaming-wang/N_SR | 75eb04647ba0e778476fb0714fa20c8226e968b2 | [
"Apache-2.0"
] | 6 | 2020-11-13T08:15:41.000Z | 2021-09-15T17:56:58.000Z | #!/usr/bin/env python
# coding=utf-8
'''
@Author: wjm
@Date: 2020-06-05 11:36:25
@LastEditTime: 2020-06-07 09:23:40
@Description: path_size = 96, batch_size = 32, epoch = 1000, L1, the RCAB block is the same as RCAN.
'''
import torch.nn as nn
import torch.optim as optim
## Channel Attention (CA) Layer
## Residual Ch... | 34.328042 | 140 | 0.56119 | #!/usr/bin/env python
# coding=utf-8
'''
@Author: wjm
@Date: 2020-06-05 11:36:25
@LastEditTime: 2020-06-07 09:23:40
@Description: path_size = 96, batch_size = 32, epoch = 1000, L1, the RCAB block is the same as RCAN.
'''
import os
import torch.nn as nn
import torch.optim as optim
from model.base_net import *
from torch... | 0 | 0 | 0 | 5,934 | 0 | 0 | 0 | -2 | 208 |
437b0f8276d62c4cb120b15f5d49ca6d23779384 | 3,732 | py | Python | test/resources/boston/single_machine_customer_script.py | Chick-star/sagemaker-xgboost-container | e06e278b3a34515f79fa73ab770b574b9aafe5f0 | [
"Apache-2.0"
] | null | null | null | test/resources/boston/single_machine_customer_script.py | Chick-star/sagemaker-xgboost-container | e06e278b3a34515f79fa73ab770b574b9aafe5f0 | [
"Apache-2.0"
] | null | null | null | test/resources/boston/single_machine_customer_script.py | Chick-star/sagemaker-xgboost-container | e06e278b3a34515f79fa73ab770b574b9aafe5f0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017-2018 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fil... | 43.395349 | 120 | 0.71865 | # Copyright 2017-2018 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fil... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
07a063645356e44a17a4853cb1bbae9dae1c7966 | 751 | py | Python | legacy/scripts/lookingglasscyber.py | rubidev/wordpress-scraper | c4762b7366c1d17c02e05579d4237823ca0d8056 | [
"MIT"
] | 13 | 2021-01-27T10:52:12.000Z | 2021-11-29T09:10:25.000Z | legacy/scripts/lookingglasscyber.py | rubidev/wordpress-scraper | c4762b7366c1d17c02e05579d4237823ca0d8056 | [
"MIT"
] | 1 | 2021-09-07T14:11:57.000Z | 2021-09-07T14:11:57.000Z | legacy/scripts/lookingglasscyber.py | rubidev/wordpress-scraper | c4762b7366c1d17c02e05579d4237823ca0d8056 | [
"MIT"
] | 2 | 2021-06-29T06:41:21.000Z | 2022-02-16T14:07:23.000Z | from legacy.crawler import crawler
import os
url = "https://www.lookingglasscyber.com"
output_dir = os.path.join('.', 'data', 'lookingglasscyber')
headers = {
'Accept':'application/json, text/javascript, */*; q=0.01',
'Accept-Encoding':'*',
'Accept-Language':'zh-CN,zh;q=0.8',
'Connectio... | 37.55 | 139 | 0.664447 | from legacy.crawler import crawler
import os
url = "https://www.lookingglasscyber.com"
output_dir = os.path.join('.', 'data', 'lookingglasscyber')
headers = {
'Accept':'application/json, text/javascript, */*; q=0.01',
'Accept-Encoding':'*',
'Accept-Language':'zh-CN,zh;q=0.8',
'Connectio... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
432c8afdb731bda4f3c427a3229d3d58f32e0943 | 79 | py | Python | jam/__init__.py | jam-py/jam-py | 0c7f359e7a6a6522828da75dc986f87acc072333 | [
"BSD-3-Clause"
] | 384 | 2015-01-06T15:09:23.000Z | 2022-02-25T19:56:44.000Z | jam/__init__.py | jam-py/jam-py | 0c7f359e7a6a6522828da75dc986f87acc072333 | [
"BSD-3-Clause"
] | 222 | 2015-01-06T19:11:08.000Z | 2022-02-16T06:46:39.000Z | jam/__init__.py | jam-py/jam-py | 0c7f359e7a6a6522828da75dc986f87acc072333 | [
"BSD-3-Clause"
] | 86 | 2015-01-16T09:50:31.000Z | 2022-02-25T13:27:14.000Z | __version__ = (5, 4, 114)
| 13.166667 | 35 | 0.582278 | __version__ = (5, 4, 114)
def version():
return '%s.%s.%s' % __version__
| 0 | 0 | 0 | 0 | 0 | 29 | 0 | 0 | 23 |
87e63d757428783e3ecc5ef15f70b88d9ca3762f | 2,176 | py | Python | client/mod_hexify.py | ThERisEn/hack-bundle-tampermonkey | beaddcc600c3ea2ed689488291f9b7c878e80dee | [
"MIT"
] | null | null | null | client/mod_hexify.py | ThERisEn/hack-bundle-tampermonkey | beaddcc600c3ea2ed689488291f9b7c878e80dee | [
"MIT"
] | null | null | null | client/mod_hexify.py | ThERisEn/hack-bundle-tampermonkey | beaddcc600c3ea2ed689488291f9b7c878e80dee | [
"MIT"
] | 4 | 2019-07-11T21:17:12.000Z | 2022-02-02T03:13:42.000Z | #!/usr/local/bin/python
##/usr/bin/env python
import sys
#XXX hack
if __name__ == "__main__":
outputString = "invert:\n%s\n" % ( obfs(sys.argv[1])[0] )
#print( outputString )
| 29.405405 | 106 | 0.430147 | #!/usr/local/bin/python
##/usr/bin/env python
import sys
#XXX hack
def convertnewlines(s):
#print("convert newlines len(s) = %s" %(len(s)))
newstr = ""
i = 0
while i < len(s):
if s[i] == '\\' and i < len(s)-1: #if find escape character
#print ("[%d] hit found, i=%s, s[i] = %c"%(len... | 0 | 0 | 0 | 0 | 0 | 1,934 | 0 | 0 | 46 |
01b06b341499db12728598e5cc0fbe1674d9d8c8 | 4,266 | py | Python | generateSchools.py | mattiastofte/VismaCalendar | 38adc4196dd50ec8d6b4e0b312e8517fbc0ac80a | [
"MIT"
] | null | null | null | generateSchools.py | mattiastofte/VismaCalendar | 38adc4196dd50ec8d6b4e0b312e8517fbc0ac80a | [
"MIT"
] | null | null | null | generateSchools.py | mattiastofte/VismaCalendar | 38adc4196dd50ec8d6b4e0b312e8517fbc0ac80a | [
"MIT"
] | null | null | null |
# https://www.akershus.no/ansvarsomrader/opplering/akershusoppleringen/visma-inschool/
TARGET_FILE = "schools.json"
schoolString = """
<option value="https://asker-vgs.inschool.visma.no">Asker videregende skole</option>
<option value="https://bjertnes-vgs.inschool.visma.no">Bjertnes videregende skole</option>
<optio... | 52.02439 | 102 | 0.71894 | import json
# https://www.akershus.no/ansvarsomrader/opplering/akershusoppleringen/visma-inschool/
TARGET_FILE = "schools.json"
schoolString = """
<option value="https://asker-vgs.inschool.visma.no">Asker videregående skole</option>
<option value="https://bjertnes-vgs.inschool.visma.no">Bjertnes videregående skole</... | 88 | 0 | 0 | 0 | 0 | 782 | 0 | -10 | 91 |
78fcb805ceb0a0b69f2ac86806e197864f206aa5 | 285 | py | Python | scripts/exercicios/ex020.py | RuanBarretodosSantos/python | 4142ccd71c4ffb4bb6a10d61c85f612758f5bb41 | [
"MIT"
] | null | null | null | scripts/exercicios/ex020.py | RuanBarretodosSantos/python | 4142ccd71c4ffb4bb6a10d61c85f612758f5bb41 | [
"MIT"
] | null | null | null | scripts/exercicios/ex020.py | RuanBarretodosSantos/python | 4142ccd71c4ffb4bb6a10d61c85f612758f5bb41 | [
"MIT"
] | null | null | null | from random import shuffle
aluno1 = str(input('Primeiro aluno: '))
aluno2 = str(input('Segundo aluno: '))
aluno3 = str(input('Terceiro aluno: '))
aluno4 = str(input('Quarto aluno: '))
lista = [aluno1, aluno2, aluno3, aluno4]
shuffle(lista)
print(f'A ordem de apresentao ser{lista}') | 35.625 | 45 | 0.715789 | from random import shuffle
aluno1 = str(input('Primeiro aluno: '))
aluno2 = str(input('Segundo aluno: '))
aluno3 = str(input('Terceiro aluno: '))
aluno4 = str(input('Quarto aluno: '))
lista = [aluno1, aluno2, aluno3, aluno4]
shuffle(lista)
print(f'A ordem de apresentação será{lista}') | 6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1612d8341978584c169575a9aeedbaeabeeb32ac | 257 | py | Python | app/grandchallenge/archives/migrations/0007_remove_archive_images.py | kaczmarj/grand-challenge.org | 8dc8a2170e51072354f7e94f2a22578805a67b94 | [
"Apache-2.0"
] | 7 | 2016-11-05T07:16:30.000Z | 2017-11-23T03:38:03.000Z | app/grandchallenge/archives/migrations/0007_remove_archive_images.py | kaczmarj/grand-challenge.org | 8dc8a2170e51072354f7e94f2a22578805a67b94 | [
"Apache-2.0"
] | 113 | 2015-05-26T09:27:59.000Z | 2018-03-21T10:45:56.000Z | app/grandchallenge/archives/migrations/0007_remove_archive_images.py | kaczmarj/grand-challenge.org | 8dc8a2170e51072354f7e94f2a22578805a67b94 | [
"Apache-2.0"
] | 7 | 2015-07-16T20:11:22.000Z | 2017-06-06T02:41:24.000Z | # Generated by Django 3.1.9 on 2021-05-12 05:36
| 25.7 | 78 | 0.735409 | # Generated by Django 3.1.9 on 2021-05-12 05:36
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("archives", "0006_archiveitem")]
operations = [migrations.RemoveField(model_name="archive", name="images")]
| 0 | 0 | 0 | 151 | 0 | 0 | 0 | 11 | 46 |
b29a4891ed4e37c026e02822ff70a9d650254581 | 4,331 | py | Python | trie/utils.py | lovesh/Merkle-Patricia-Trie | 99574518e5c25c61caedfef92a24a41a8a59e31f | [
"Apache-2.0"
] | 1 | 2019-09-25T10:32:24.000Z | 2019-09-25T10:32:24.000Z | trie/utils.py | lovesh/Merkle-Patricia-Trie | 99574518e5c25c61caedfef92a24a41a8a59e31f | [
"Apache-2.0"
] | 1 | 2019-09-26T06:54:04.000Z | 2019-09-30T04:57:27.000Z | trie/utils.py | lovesh/Merkle-Patricia-Trie | 99574518e5c25c61caedfef92a24a41a8a59e31f | [
"Apache-2.0"
] | 1 | 2019-04-22T16:59:27.000Z | 2019-04-22T16:59:27.000Z |
from eth_utils import int_to_big_endian
from trie.constants import NIBBLE_TERMINATOR, hex_to_int, TT256
def encode_int(v):
"""encodes an integer into serialization"""
if not isinstance(v, int) or v < 0 or v >= TT256:
raise Exception("Integer invalid or out of range: %r" % v)
return int_to_big... | 24.468927 | 67 | 0.574694 | import binascii
from eth_utils import int_to_big_endian
from rlp.utils import ALL_BYTES
from trie.constants import NIBBLE_TERMINATOR, hex_to_int, TT256
def ascii_chr(n):
return ALL_BYTES[n]
def decode_hex(s):
if isinstance(s, str):
return bytes.fromhex(s)
if isinstance(s, bytes):
retur... | 0 | 0 | 0 | 0 | 0 | 1,561 | 0 | 4 | 297 |
ab064ffadcf374a31ce31eed00de4886fa218b4e | 835 | py | Python | metabase/metabase/doctype/metabase_settings/metabase_settings.py | srajelli/frappe-metabase | 022f2e6967e3612ca3d725a82a7f961f879c0008 | [
"MIT"
] | 1 | 2020-08-26T23:23:41.000Z | 2020-08-26T23:23:41.000Z | metabase/metabase/doctype/metabase_settings/metabase_settings.py | srajelli/frappe-metabase | 022f2e6967e3612ca3d725a82a7f961f879c0008 | [
"MIT"
] | null | null | null | metabase/metabase/doctype/metabase_settings/metabase_settings.py | srajelli/frappe-metabase | 022f2e6967e3612ca3d725a82a7f961f879c0008 | [
"MIT"
] | 1 | 2020-08-26T23:24:19.000Z | 2020-08-26T23:24:19.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Officexlr Business Solutions Pvt Ltd. and Contributors
# For license information, please see license.txt
from __future__ import unicode_literals
| 36.304348 | 109 | 0.74012 | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Officexlr Business Solutions Pvt Ltd. and Contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
import jwt, json, time
class MetabaseSettings(Document):
def get_sign... | 0 | 0 | 0 | 540 | 0 | 0 | 0 | 14 | 89 |
2476a7edabf676815d3a4e6cec1eef52478ecb57 | 414 | py | Python | setup_cx.py | deathbreakfast/ManageService | 3b7e21b02af35f93aadc609890e3dff33812e937 | [
"MIT"
] | null | null | null | setup_cx.py | deathbreakfast/ManageService | 3b7e21b02af35f93aadc609890e3dff33812e937 | [
"MIT"
] | null | null | null | setup_cx.py | deathbreakfast/ManageService | 3b7e21b02af35f93aadc609890e3dff33812e937 | [
"MIT"
] | null | null | null | from cx_Freeze import setup, Executable
executables = [
Executable(
'manageservice/manage-service.py',
base = None,
targetName = 'manage-service'
)
]
setup(
name='Manage Service',
version = '1.0.0',
description = 'A python service that can b... | 23 | 107 | 0.591787 | from cx_Freeze import setup, Executable
executables = [
Executable(
'manageservice/manage-service.py',
base = None,
targetName = 'manage-service'
)
]
setup(
name='Manage Service',
version = '1.0.0',
description = 'A python service that can b... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d7bc453002cbc2c16e76d98f378065ebb6376b27 | 17,413 | py | Python | indexer/language_codes.py | BCLibraries/bc-lib-search | 68e8404d9529d20e6936a95c86323abd92401ce3 | [
"MIT"
] | null | null | null | indexer/language_codes.py | BCLibraries/bc-lib-search | 68e8404d9529d20e6936a95c86323abd92401ce3 | [
"MIT"
] | null | null | null | indexer/language_codes.py | BCLibraries/bc-lib-search | 68e8404d9529d20e6936a95c86323abd92401ce3 | [
"MIT"
] | null | null | null | lang_code = {'aar': 'Afar',
'abk': 'Abkhaz',
'ace': 'Achinese',
'ach': 'Acoli',
'ada': 'Adangme',
'ady': 'Adygei',
'afa': 'Afroasiatic (Other)',
'afh': 'Afrihili (Artificial language)',
'afr': 'Afrikaans',
... | 33.486538 | 81 | 0.351576 | lang_code = {'aar': 'Afar',
'abk': 'Abkhaz',
'ace': 'Achinese',
'ach': 'Acoli',
'ada': 'Adangme',
'ady': 'Adygei',
'afa': 'Afroasiatic (Other)',
'afh': 'Afrihili (Artificial language)',
'afr': 'Afrikaans',
... | 20 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
abda445136084ad7b0eb48d4fec7072f36e41a7c | 1,193 | py | Python | target-pendo/src/endpoints.py | kc-bonilla/data-pipeline-development | a99f08f65d32ae69bac0bfca575975fc2bb3fdb3 | [
"MIT"
] | null | null | null | target-pendo/src/endpoints.py | kc-bonilla/data-pipeline-development | a99f08f65d32ae69bac0bfca575975fc2bb3fdb3 | [
"MIT"
] | null | null | null | target-pendo/src/endpoints.py | kc-bonilla/data-pipeline-development | a99f08f65d32ae69bac0bfca575975fc2bb3fdb3 | [
"MIT"
] | 1 | 2021-09-24T02:19:54.000Z | 2021-09-24T02:19:54.000Z | """ * endpoint: API endpoint relative path, when added to the base URL, creates the full path
* kind: type of record to be updated ('account' or 'visitor')
* group: type of Pendo attribute to be updated ('agent' or 'custom')
"""
| 32.243243 | 93 | 0.577536 | """ * endpoint: API endpoint relative path, when added to the base URL, creates the full path
* kind: type of record to be updated ('account' or 'visitor')
* group: type of Pendo attribute to be updated ('agent' or 'custom')
"""
class Endpoint:
def __init__(self, stream):
self.stream = stream
... | 0 | 0 | 0 | 928 | 0 | 0 | 0 | 0 | 23 |
d5b76556a3907acd705e61b472ad31a7725ad92a | 12,753 | py | Python | Code/SimulatePatientDynamics_Final.py | MichiKal/healthcare-resilience | ad67db3f9ff9af52e8d80a52f15bd2a9147ed155 | [
"MIT"
] | null | null | null | Code/SimulatePatientDynamics_Final.py | MichiKal/healthcare-resilience | ad67db3f9ff9af52e8d80a52f15bd2a9147ed155 | [
"MIT"
] | null | null | null | Code/SimulatePatientDynamics_Final.py | MichiKal/healthcare-resilience | ad67db3f9ff9af52e8d80a52f15bd2a9147ed155 | [
"MIT"
] | null | null | null | __author__ = 'Jana Lasser'
__copyright__ = 'Copyright 2021, Patient Dynamics Simulation'
__credits__ = ['Jana Lasser', 'Ruggiero LoSardo','Michaela Kaleta']
__license__ = 'MIT'
__status__ = 'Dev'
# std imports
import warnings
from importlib import reload
from os.path import join
import argparse
# third pa... | 44.43554 | 168 | 0.581902 | __author__ = 'Jana Lasser'
__copyright__ = 'Copyright 2021, Patient Dynamics Simulation'
__credits__ = ['Jana Lasser', 'Ruggiero LoSardo','Michaela Kaleta']
__license__ = 'MIT'
__status__ = 'Dev'
# std imports
import warnings
from importlib import reload
from os.path import join
import argparse
# third pa... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f28e242d5a7ccb7c67aeb19bcb662f1a3c653316 | 606 | py | Python | python_app/utils/responses.py | DarAkus1420/taller-de-integracion-3 | ec4450488698666790d98f836c1d98073e1ec2ba | [
"MIT"
] | 2 | 2021-08-18T15:57:53.000Z | 2021-12-26T15:11:16.000Z | python_app/utils/responses.py | DarAkus1420/taller-de-integracion-3 | ec4450488698666790d98f836c1d98073e1ec2ba | [
"MIT"
] | 8 | 2021-08-15T04:23:29.000Z | 2021-10-06T12:38:06.000Z | python_app/utils/responses.py | DarAkus1420/taller-de-integracion-3 | ec4450488698666790d98f836c1d98073e1ec2ba | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
response = Responses()
print(response.ok_response({'test': 21}))
| 18.9375 | 88 | 0.49835 | import json
class Responses:
"""Class used to create the responses that will be sent through the http protocol"""
@staticmethod
def response(data: dict):
'''Create a ``json`` for http responses
Parameters
----------
data: dict
The data that will be sent
... | 0 | 356 | 0 | 112 | 0 | 0 | 0 | -10 | 45 |
ac6ebf444fabda5dbb6f4c3cd5ed836a746971a8 | 1,487 | py | Python | cloudformation/cf_dumper.py | ajinabraham/aws_security_tools | 94448630b8382fb462030b4e8fb5dcf261cd3b5d | [
"BSD-3-Clause"
] | 47 | 2018-11-11T02:12:41.000Z | 2021-12-09T02:45:40.000Z | cloudformation/cf_dumper.py | ajinabraham/aws_security_tools | 94448630b8382fb462030b4e8fb5dcf261cd3b5d | [
"BSD-3-Clause"
] | null | null | null | cloudformation/cf_dumper.py | ajinabraham/aws_security_tools | 94448630b8382fb462030b4e8fb5dcf261cd3b5d | [
"BSD-3-Clause"
] | 19 | 2018-11-18T03:16:25.000Z | 2022-01-19T17:23:25.000Z | """
Python 3
Script to dump CloudFormation templates
aws configure
configure your AWS credentials
you should have permission for listing and downloading CloudFormation stacks
"""
import os
import shutil
if __name__ == "__main__":
print("CloudFormationDumper: Script for dumping CloudFormation templates - Ajin Abr... | 29.156863 | 93 | 0.662408 | """
Python 3
Script to dump CloudFormation templates
aws configure
configure your AWS credentials
you should have permission for listing and downloading CloudFormation stacks
"""
import os
import boto3
import requests
import yaml
import shutil
from cfn_flip import to_json
class CFNDumper:
def __init__(self, out... | 0 | 0 | 0 | 749 | 0 | 0 | 0 | -18 | 111 |
e467d242f4d78a79da9345a6da93d2b4b5eb3394 | 452 | py | Python | dashboard_api/widget_def/migrations/0037_geodataset_colour_map.py | data61/Openboard | aaf7ef49e05c0771094efc6be811c6ae88055252 | [
"Apache-2.0"
] | 2 | 2017-08-29T23:05:51.000Z | 2019-04-02T21:11:35.000Z | dashboard_api/widget_def/migrations/0037_geodataset_colour_map.py | data61/Openboard | aaf7ef49e05c0771094efc6be811c6ae88055252 | [
"Apache-2.0"
] | 1 | 2019-04-02T21:11:26.000Z | 2019-04-03T15:12:57.000Z | dashboard_api/widget_def/migrations/0037_geodataset_colour_map.py | data61/Openboard | aaf7ef49e05c0771094efc6be811c6ae88055252 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
| 22.6 | 91 | 0.628319 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('widget_def', '0036_auto_20150910_1447'),
]
operations = [
migrations.AddField(
model_name='geodataset',
... | 0 | 0 | 0 | 322 | 0 | 0 | 0 | 19 | 46 |
2a29a272655d13fe436b9a24329e58ed2abf7cf5 | 153 | py | Python | PythonExercicios/ex051.py | Caio-Moretti/115.Exercicios-Python | 7e66fb1f44ea3eb4ade63f37d843242ac42ade84 | [
"MIT"
] | null | null | null | PythonExercicios/ex051.py | Caio-Moretti/115.Exercicios-Python | 7e66fb1f44ea3eb4ade63f37d843242ac42ade84 | [
"MIT"
] | null | null | null | PythonExercicios/ex051.py | Caio-Moretti/115.Exercicios-Python | 7e66fb1f44ea3eb4ade63f37d843242ac42ade84 | [
"MIT"
] | null | null | null | a1 = int(input('Digite o primeiro termo da PA: '))
r = int(input('Digite a razo da PA: '))
a10 = a1 + (10 * r)
for c in range(a1, a10, r):
print(c)
| 25.5 | 50 | 0.588235 | a1 = int(input('Digite o primeiro termo da PA: '))
r = int(input('Digite a razão da PA: '))
a10 = a1 + (10 * r)
for c in range(a1, a10, r):
print(c)
| 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9a024979037005166c968dff1d02cb7023f8f9a3 | 2,316 | py | Python | src/test/tests/rendering/line3d.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/rendering/line3d.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/rendering/line3d.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: line3d.py
#
# Tests: mesh - 3D unstructured, single domain
# plots - Pseudocolor
# annotations - Line3D
#
# Programmer: Kathleen Biagas
# Date: August... | 22.269231 | 78 | 0.661917 | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: line3d.py
#
# Tests: mesh - 3D unstructured, single domain
# plots - Pseudocolor
# annotations - Line3D
#
# Programmer: Kathleen Biagas
# Date: August... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
530e61afa9d48005311325f5540d5fa1c6a95df1 | 38,055 | py | Python | PyDSS/pydss_results.py | JMorganUSU/PyDSS | 7e28c45204e6ba8e703162c24c8a585f038fff6a | [
"BSD-3-Clause"
] | 1 | 2022-03-03T16:05:41.000Z | 2022-03-03T16:05:41.000Z | PyDSS/pydss_results.py | JMorganUSU/PyDSS | 7e28c45204e6ba8e703162c24c8a585f038fff6a | [
"BSD-3-Clause"
] | null | null | null | PyDSS/pydss_results.py | JMorganUSU/PyDSS | 7e28c45204e6ba8e703162c24c8a585f038fff6a | [
"BSD-3-Clause"
] | 1 | 2022-03-03T16:05:31.000Z | 2022-03-03T16:05:31.000Z | """Provides access to PyDSS result data."""
import logging
import re
logger = logging.getLogger(__name__)
def _read_capacitor_changes(event_log_text):
"""Read the capacitor state changes from an OpenDSS event log.
Parameters
----------
event_log_text : str
Text of event log
Returns
... | 34.191375 | 114 | 0.590172 | """Provides access to PyDSS result data."""
from collections import defaultdict
from datetime import datetime
import json
import logging
import os
import re
from pathlib import Path
import h5py
import numpy as np
import pandas as pd
from PyDSS.common import DatasetPropertyType
from PyDSS.dataset_buffer import Datase... | 0 | 1,642 | 0 | 33,964 | 0 | 0 | 0 | 375 | 422 |
deb0164cb1da008bff71b8a8e5bbde27e917b6c8 | 6,441 | py | Python | tests/test_rl_accel.py | nickpack/reportlab | ad19a08d2ce7d047b01e78d8e15b9ec6d2889feb | [
"BSD-3-Clause"
] | null | null | null | tests/test_rl_accel.py | nickpack/reportlab | ad19a08d2ce7d047b01e78d8e15b9ec6d2889feb | [
"BSD-3-Clause"
] | null | null | null | tests/test_rl_accel.py | nickpack/reportlab | ad19a08d2ce7d047b01e78d8e15b9ec6d2889feb | [
"BSD-3-Clause"
] | 1 | 2020-07-13T15:24:00.000Z | 2020-07-13T15:24:00.000Z | __version__=''' $Id'''
__doc__='''basic tests.'''
from reportlab.lib.testutils import setOutDir, printLocation
setOutDir(__name__)
import unittest
#noruntests
if __name__ == "__main__":
unittest.TextTestRunner().run(makeSuite())
printLocation()
| 40.765823 | 278 | 0.578792 | __version__=''' $Id'''
__doc__='''basic tests.'''
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, printLocation
setOutDir(__name__)
import unittest
def getrc(defns,depth=1):
from sys import getrefcount, _getframe
f = _getframe(depth)
G0 = f.f_globals
L = f.f_locals
i... | 0 | 0 | 0 | 5,170 | 0 | 885 | 0 | 20 | 100 |
93568ba0bca2ff52ed63f1c2811c197fe38e50d3 | 200 | py | Python | phase-diag.py | dantaylor688/dantaylor688.github.io | f430224693c94a7469826f88b88bd9b1460e1cc9 | [
"MIT"
] | null | null | null | phase-diag.py | dantaylor688/dantaylor688.github.io | f430224693c94a7469826f88b88bd9b1460e1cc9 | [
"MIT"
] | null | null | null | phase-diag.py | dantaylor688/dantaylor688.github.io | f430224693c94a7469826f88b88bd9b1460e1cc9 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
x = arange(-2*pi,2*pi,0.01)
figure(1)
plot(x,sin(x))
xlabel('x')
ylabel('\dot{x}') | 18.181818 | 31 | 0.585 | from numpy import *
from matplotlib import *
from pylab import *
if __name__ == "__main__":
x = arange(-2*pi,2*pi,0.01)
figure(1)
plot(x,sin(x))
xlabel('x')
ylabel('\dot{x}') | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 66 |
6eaa28a28c8db5ee49f518406bb977f26bd87b8a | 231 | py | Python | src/colors.py | michael-stanin/PackmanReturns | ca0f943fe87e102d77179d0be7751ee7f1784134 | [
"MIT"
] | null | null | null | src/colors.py | michael-stanin/PackmanReturns | ca0f943fe87e102d77179d0be7751ee7f1784134 | [
"MIT"
] | null | null | null | src/colors.py | michael-stanin/PackmanReturns | ca0f943fe87e102d77179d0be7751ee7f1784134 | [
"MIT"
] | null | null | null |
#Define some basic colors
BLACK = ( 0, 0, 0)
BLUE = ( 50, 50, 255)
WHITE = (255, 255, 255)
GREEN = ( 0, 255, 0)
RED = (255, 0, 0)
GOLD = (255, 215, 0)
GOLDEN_ROD = (218, 165, 32)
| 21 | 28 | 0.437229 |
#Define some basic colors
BLACK = ( 0, 0, 0)
BLUE = ( 50, 50, 255)
WHITE = (255, 255, 255)
GREEN = ( 0, 255, 0)
RED = (255, 0, 0)
GOLD = (255, 215, 0)
GOLDEN_ROD = (218, 165, 32)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1739f46d27fd4254b1a8c91010e676bb2071c3b3 | 2,590 | py | Python | perrec/fusion.py | Tbabm/PerRec | 1f711d70df8354156b37857719db0559876be08c | [
"MIT"
] | 3 | 2019-07-24T12:03:24.000Z | 2019-08-28T14:42:51.000Z | perrec/fusion.py | Tbabm/PerRec | 1f711d70df8354156b37857719db0559876be08c | [
"MIT"
] | null | null | null | perrec/fusion.py | Tbabm/PerRec | 1f711d70df8354156b37857719db0559876be08c | [
"MIT"
] | null | null | null | # encoding=utf-8
import numpy as np
def fusion(perm_score_sets, perm_list, ftype):
"""fusion method for combining scores output by different components
Args:
perm_score_sets (3d-array): List of permission scores. Each element
is the score set output by one method. The size of the element is
... | 37.536232 | 86 | 0.695753 | # encoding=utf-8
import numpy as np
def sum_fusion(perm_score_sets):
# test_num * len(perm_list)
score_matrix_sum = perm_score_sets.sum(axis=0)
return score_matrix_sum
def anz_fusion(perm_score_sets):
# test_num * len(perm_list)
score_matrix_sum = perm_score_sets.sum(axis=0)
# test_num * len(... | 0 | 0 | 0 | 0 | 0 | 1,390 | 0 | 0 | 138 |
420d8ef0e23d9a371a95d15121966f2201e3172d | 3,163 | py | Python | software/glasgow/device/config.py | emilazy/Glasgow | 4575ad07ccce76b0b92d29a76fc18a3700a68823 | [
"Apache-2.0",
"0BSD"
] | 3 | 2020-04-30T22:58:29.000Z | 2021-02-25T11:58:51.000Z | software/glasgow/device/config.py | emilazy/Glasgow | 4575ad07ccce76b0b92d29a76fc18a3700a68823 | [
"Apache-2.0",
"0BSD"
] | null | null | null | software/glasgow/device/config.py | emilazy/Glasgow | 4575ad07ccce76b0b92d29a76fc18a3700a68823 | [
"Apache-2.0",
"0BSD"
] | null | null | null |
__all__ = ["GlasgowConfig"]
| 33.648936 | 87 | 0.576984 | import struct
import re
__all__ = ["GlasgowConfig"]
class GlasgowConfig:
"""
Glasgow EEPROM configuration data.
:ivar int size:
Total size of configuration block (currently 64).
:ivar str[1] revision:
Revision letter, ``A``-``Z``.
:ivar str[16] serial:
Serial number, i... | 0 | 1,372 | 0 | 1,713 | 0 | 0 | 0 | -20 | 67 |