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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
24e8f42fb69a58735f8366c27b2e6cef3f698596 | 630 | py | Python | cctbx/eltbx/tests/tst_covalent_radii.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 155 | 2016-11-23T12:52:16.000Z | 2022-03-31T15:35:44.000Z | cctbx/eltbx/tests/tst_covalent_radii.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 590 | 2016-12-10T11:31:18.000Z | 2022-03-30T23:10:09.000Z | cctbx/eltbx/tests/tst_covalent_radii.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 115 | 2016-11-15T08:17:28.000Z | 2022-02-09T15:30:14.000Z | from __future__ import absolute_import, division, print_function
if (__name__ == "__main__"):
run()
| 23.333333 | 64 | 0.634921 | from __future__ import absolute_import, division, print_function
from cctbx.eltbx import covalent_radii
from libtbx.test_utils import approx_equal
def exercise():
t = covalent_radii.table("sI")
assert t.label() == "Si"
assert approx_equal(t.radius(), 1.11)
assert approx_equal(t.esd(), 0.02)
n = 0
for t in ... | 0 | 0 | 0 | 0 | 0 | 399 | 0 | 38 | 90 |
3b31d2eb1eaceedfdd5dadd19c5a42b359e8839f | 657 | py | Python | FEniCSUI/dashboard/migrations/0001_initial.py | nasserarbabi/FEniCSUI-dev | f8f161e1b49932843e01301212e7d031fff4f6c8 | [
"MIT"
] | null | null | null | FEniCSUI/dashboard/migrations/0001_initial.py | nasserarbabi/FEniCSUI-dev | f8f161e1b49932843e01301212e7d031fff4f6c8 | [
"MIT"
] | 8 | 2021-03-10T21:59:52.000Z | 2021-09-22T19:12:57.000Z | FEniCSUI/dashboard/migrations/0001_initial.py | nasserarbabi/FEniCSUI | f8f161e1b49932843e01301212e7d031fff4f6c8 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.6 on 2020-05-06 02:47
| 27.375 | 114 | 0.607306 | # Generated by Django 3.0.6 on 2020-05-06 02:47
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='projects',
fields=[
('id', mode... | 0 | 0 | 0 | 531 | 0 | 0 | 0 | 9 | 68 |
f585917f64d5d88d972e368b266b05ac3ff11180 | 288 | py | Python | tests/conftest.py | k3vb0t/pyinvestigate | 26df7ab7ab67f547eb71e57fa48ca5e01131cd8a | [
"MIT"
] | 1 | 2019-02-11T17:24:13.000Z | 2019-02-11T17:24:13.000Z | tests/conftest.py | k3vb0t/pyinvestigate | 26df7ab7ab67f547eb71e57fa48ca5e01131cd8a | [
"MIT"
] | null | null | null | tests/conftest.py | k3vb0t/pyinvestigate | 26df7ab7ab67f547eb71e57fa48ca5e01131cd8a | [
"MIT"
] | null | null | null | import sys, os
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath + '/../')
| 26.181818 | 75 | 0.746528 | import sys, os
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath + '/../')
import pytest
import investigate # use the local path, instead of what has been installed
@pytest.fixture
def inv():
return investigate.Investigate(os.environ['INVESTIGATE_KEY'])
| 0 | 71 | 0 | 0 | 0 | 0 | 0 | -11 | 125 |
ba1169ee74c608dfd3410c275ecc4b53082b8064 | 3,061 | py | Python | src/wip/compile.py | bink81/python-tools | 57f9aa13051a9ac925da293241f4be9cd54e8fb3 | [
"MIT"
] | null | null | null | src/wip/compile.py | bink81/python-tools | 57f9aa13051a9ac925da293241f4be9cd54e8fb3 | [
"MIT"
] | null | null | null | src/wip/compile.py | bink81/python-tools | 57f9aa13051a9ac925da293241f4be9cd54e8fb3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
import os
import shutil
import stat
programpath = os.path.abspath(sys.path[0])
sys.path.append(os.path.join(programpath,"Lib"))
from optparse import OptionParser
import PackingUnits
import SPULib
import OsLib
parser = OptionParser(usage="%prog [-f] [-q] FILENAME APPLICA... | 34.393258 | 122 | 0.68311 | #!/usr/bin/env python
import sys
import os
import shutil
import stat
programpath = os.path.abspath(sys.path[0])
sys.path.append(os.path.join(programpath,"Lib"))
from optparse import OptionParser
import PackingUnits
import SPULib
import OsLib
parser = OptionParser(usage="%prog [-f] [-q] FILENAME APPLICA... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4a11ff40bddb03bd4d44f2d08cf22f63a96fcc26 | 2,931 | py | Python | jupiter/domain/metrics/metric.py | horia141/jupiter | 2c721d1d44e1cd2607ad9936e54a20ea254741dc | [
"MIT"
] | 15 | 2019-05-05T14:34:58.000Z | 2022-02-25T09:57:28.000Z | jupiter/domain/metrics/metric.py | horia141/jupiter | 2c721d1d44e1cd2607ad9936e54a20ea254741dc | [
"MIT"
] | 3 | 2020-02-22T16:09:39.000Z | 2021-12-18T21:33:06.000Z | jupiter/domain/metrics/metric.py | horia141/jupiter | 2c721d1d44e1cd2607ad9936e54a20ea254741dc | [
"MIT"
] | null | null | null | """A metric."""
| 33.689655 | 113 | 0.683385 | """A metric."""
from dataclasses import dataclass
from typing import Optional
from jupiter.domain.entity_name import EntityName
from jupiter.domain.metrics.metric_key import MetricKey
from jupiter.domain.metrics.metric_unit import MetricUnit
from jupiter.domain.recurring_task_gen_params import RecurringTaskGenParams
f... | 0 | 2,418 | 0 | 0 | 0 | 0 | 0 | 274 | 222 |
a68caf4d36747699226321649185f3318894cee2 | 273 | py | Python | fairseq/speech_recognition/datasets/ori_datasets/sen_piece_encode.py | haiyangxue/fairseq | b142ceec20d69130aea823054b193a0d04a780e3 | [
"MIT"
] | null | null | null | fairseq/speech_recognition/datasets/ori_datasets/sen_piece_encode.py | haiyangxue/fairseq | b142ceec20d69130aea823054b193a0d04a780e3 | [
"MIT"
] | null | null | null | fairseq/speech_recognition/datasets/ori_datasets/sen_piece_encode.py | haiyangxue/fairseq | b142ceec20d69130aea823054b193a0d04a780e3 | [
"MIT"
] | null | null | null | import sentencepiece as spm
import sys
path=sys.argv[1]
input=sys.argv[2]
out=sys.argv[3]
sp = spm.SentencePieceProcessor()
sp.Load(path)
with open(input) as f:
with open(out,"w") as w:
for item in f:
w.write(" ".join(sp.EncodeAsPieces(item))+"\n")
| 22.75 | 59 | 0.652015 | import sentencepiece as spm
import sys
path=sys.argv[1]
input=sys.argv[2]
out=sys.argv[3]
sp = spm.SentencePieceProcessor()
sp.Load(path)
with open(input) as f:
with open(out,"w") as w:
for item in f:
w.write(" ".join(sp.EncodeAsPieces(item))+"\n")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
522047565b15fc65844cedafecec958e4ba7795e | 3,235 | py | Python | app/main.py | ASavageCabbage/starter-snake-python | fa887c2c65f1ae0188a11c73599b1fb74c4d6454 | [
"MIT"
] | null | null | null | app/main.py | ASavageCabbage/starter-snake-python | fa887c2c65f1ae0188a11c73599b1fb74c4d6454 | [
"MIT"
] | null | null | null | app/main.py | ASavageCabbage/starter-snake-python | fa887c2c65f1ae0188a11c73599b1fb74c4d6454 | [
"MIT"
] | null | null | null | import logging
import os
import bottle
from sys import argv
# Set log level
LOG_LEVEL = 'DEBUG'
if len(argv) > 1 and hasattr(logging, argv[1]):
LOG_LEVEL = argv[1]
logging.basicConfig(level=getattr(logging, LOG_LEVEL))
logger = logging.getLogger()
# Constants
COLOR = '#993333'
HEAD = 'sand-worm'
TAIL = 'pixel'
... | 25.472441 | 87 | 0.634003 | import json
import logging
import os
import bottle
from sys import argv
from api import ping_response, start_response, move_response, end_response
from utils.arena import Arena
# Set log level
LOG_LEVEL = 'DEBUG'
if len(argv) > 1 and hasattr(logging, argv[1]):
LOG_LEVEL = argv[1]
logging.basicConfig(level=getattr... | 0 | 2,276 | 0 | 0 | 0 | 0 | 0 | 51 | 204 |
adf791c9a114e5768599ef4aacd624bd177cd99f | 546 | py | Python | close_far.py | HeyIamJames/CodingInterviewPractice | ea7f849e4eba9c4c7269b52aa7be48e7995c0f37 | [
"MIT"
] | null | null | null | close_far.py | HeyIamJames/CodingInterviewPractice | ea7f849e4eba9c4c7269b52aa7be48e7995c0f37 | [
"MIT"
] | null | null | null | close_far.py | HeyIamJames/CodingInterviewPractice | ea7f849e4eba9c4c7269b52aa7be48e7995c0f37 | [
"MIT"
] | null | null | null | """
Given three ints, a b c, return True if one of b or c is "close" (differing from a by at most 1), while the other is "far", differing from both other values by 2 or more. Note: abs(num) computes the absolute value of a number.
close_far(1, 2, 10) True
close_far(1, 2, 3) False
close_far(4, 1, 3) True
"""
| 30.333333 | 227 | 0.59707 | """
Given three ints, a b c, return True if one of b or c is "close" (differing from a by at most 1), while the other is "far", differing from both other values by 2 or more. Note: abs(num) computes the absolute value of a number.
close_far(1, 2, 10) → True
close_far(1, 2, 3) → False
close_far(4, 1, 3) → True
"""
... | 9 | 0 | 0 | 0 | 0 | 203 | 0 | 0 | 24 |
d4ec743f881fdeb2f0864e5d6401c9c6bb0d4768 | 2,143 | py | Python | examples/crossmodel.py | sed-i/python-libjuju | b001298c002f860e14ffd23c4cb9903b119be153 | [
"Apache-2.0"
] | null | null | null | examples/crossmodel.py | sed-i/python-libjuju | b001298c002f860e14ffd23c4cb9903b119be153 | [
"Apache-2.0"
] | null | null | null | examples/crossmodel.py | sed-i/python-libjuju | b001298c002f860e14ffd23c4cb9903b119be153 | [
"Apache-2.0"
] | null | null | null | """
This example:
1. Connects to the current model
2. Deploys a charm and waits until it reports itself active
3. Creates an offer
4. Lists the offer
3. Destroys the unit and application
"""
from logging import getLogger
from juju import loop
log = getLogger(__name__)
if __name__ == '__main__':
loop.run(main... | 27.831169 | 116 | 0.651423 | """
This example:
1. Connects to the current model
2. Deploys a charm and waits until it reports itself active
3. Creates an offer
4. Lists the offer
3. Destroys the unit and application
"""
import tempfile
from logging import getLogger
from juju import loop
from juju.controller import Controller
log = getLogger(__... | 0 | 0 | 1,741 | 0 | 0 | 0 | 0 | 11 | 67 |
05797af72add0ce8937a108700265c2c4aa4c99a | 16,008 | py | Python | homework.py | JusesCheng/Bayes | 61f5e7c621d072615f86babdb60385fb1332446e | [
"MIT"
] | null | null | null | homework.py | JusesCheng/Bayes | 61f5e7c621d072615f86babdb60385fb1332446e | [
"MIT"
] | null | null | null | homework.py | JusesCheng/Bayes | 61f5e7c621d072615f86babdb60385fb1332446e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'homework.ui'
#
# Created by: PyQt5 UI code generator 5.9
#
# WARNING! All changes made in this file will be lost!
| 50.498423 | 76 | 0.705147 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'homework.ui'
#
# Created by: PyQt5 UI code generator 5.9
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow... | 18 | 0 | 0 | 15,741 | 0 | 0 | 0 | 21 | 46 |
55a62debbdfc5cf6be4e30d414d11a1488eeb624 | 191 | py | Python | campus/urls.py | CaptainMorch/TJU_Cats | c0f692ffce9132936538b991b825744d89933ea7 | [
"MIT"
] | null | null | null | campus/urls.py | CaptainMorch/TJU_Cats | c0f692ffce9132936538b991b825744d89933ea7 | [
"MIT"
] | null | null | null | campus/urls.py | CaptainMorch/TJU_Cats | c0f692ffce9132936538b991b825744d89933ea7 | [
"MIT"
] | null | null | null | from django.urls import path
from .views import LocationCreateView
app_name = 'campus'
urlpatterns = [
path('location/create/', LocationCreateView.as_view(), name='create_location'),
]
| 21.222222 | 83 | 0.753927 | from django.urls import path
from .views import LocationCreateView
app_name = 'campus'
urlpatterns = [
path('location/create/', LocationCreateView.as_view(), name='create_location'),
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
dd8bb128c20acc2065e5bfc3db8c7a3ab4817b23 | 4,422 | py | Python | tests/unit/plugins/openstack/scenarios/cinder/test_volume_types.py | TeamXgrid/xgrid-rally | 828ff148da4395af615c79cd94db7878e1e08491 | [
"Apache-2.0"
] | 1 | 2018-06-03T13:52:28.000Z | 2018-06-03T13:52:28.000Z | tests/unit/plugins/openstack/scenarios/cinder/test_volume_types.py | TeamXgrid/xgrid-rally | 828ff148da4395af615c79cd94db7878e1e08491 | [
"Apache-2.0"
] | null | null | null | tests/unit/plugins/openstack/scenarios/cinder/test_volume_types.py | TeamXgrid/xgrid-rally | 828ff148da4395af615c79cd94db7878e1e08491 | [
"Apache-2.0"
] | null | null | null | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 42.932039 | 79 | 0.706694 | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 0 | 0 | 0 | 3,669 | 0 | 0 | 0 | 40 | 114 |
9e599f071716a1af64a7b21f1a0db4b2e277188a | 37 | py | Python | paci/helpers/__init__.py | tradebyte/paci | d330b553ae0e0dd3662fdcae65aefbcfecd99a31 | [
"MIT"
] | 5 | 2017-04-05T15:22:43.000Z | 2022-03-28T14:40:09.000Z | paci/helpers/__init__.py | tradebyte/paci | d330b553ae0e0dd3662fdcae65aefbcfecd99a31 | [
"MIT"
] | 26 | 2017-04-03T15:14:06.000Z | 2021-05-20T06:13:50.000Z | paci/helpers/__init__.py | tradebyte/paci | d330b553ae0e0dd3662fdcae65aefbcfecd99a31 | [
"MIT"
] | 1 | 2017-04-05T12:05:41.000Z | 2017-04-05T12:05:41.000Z | """Init file for the paci helpers"""
| 18.5 | 36 | 0.675676 | """Init file for the paci helpers"""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0c32865b713284fd56bf31eb6492323364ad5eb8 | 9,604 | py | Python | iemic_global.py | merijn/iemic-global | 1206a3fa1cfea7c63131c7fd4b53941f6073d5a2 | [
"Apache-2.0"
] | null | null | null | iemic_global.py | merijn/iemic-global | 1206a3fa1cfea7c63131c7fd4b53941f6073d5a2 | [
"Apache-2.0"
] | null | null | null | iemic_global.py | merijn/iemic-global | 1206a3fa1cfea7c63131c7fd4b53941f6073d5a2 | [
"Apache-2.0"
] | null | null | null | import numpy
from omuse.units import units, constants
from omuse.community.iemic.implicit_utils import newton, continuation
from matplotlib import pyplot
from bstream import barotropic_streamfunction, overturning_streamfunction, z_from_cellcenterz
"""
default OCEAN parameters:
Ocean__Analyze_Jacobian: True
Ocean_... | 34.546763 | 156 | 0.808726 | import numpy
from omuse.units import units, constants
from omuse.community.iemic.interface import iemic
from omuse.community.iemic.implicit_utils import newton, continuation
from matplotlib import pyplot
from bstream import barotropic_streamfunction, overturning_streamfunction,z_from_cellcenterz
"""
default OCEAN... | 0 | 0 | 0 | 0 | 0 | 2,470 | 0 | 27 | 46 |
e2441af18c4ff341f0f785aaeb9fedd5325e7b4f | 4,580 | py | Python | t05_network_node_api.py | Cocos-BCX/Cocos-Chain-API | 4b36079629d6cb6fa8742bfde5ab61a82530eaa5 | [
"MIT"
] | 14 | 2021-01-17T22:07:10.000Z | 2021-02-16T12:25:42.000Z | t05_network_node_api.py | Cocos-BCX/Cocos-Chain-API | 4b36079629d6cb6fa8742bfde5ab61a82530eaa5 | [
"MIT"
] | null | null | null | t05_network_node_api.py | Cocos-BCX/Cocos-Chain-API | 4b36079629d6cb6fa8742bfde5ab61a82530eaa5 | [
"MIT"
] | 1 | 2020-03-25T02:53:24.000Z | 2020-03-25T02:53:24.000Z | #-*- coding: utf-8 -*-
import unittest
if __name__ == '__main__':
unittest.main()
| 34.43609 | 81 | 0.587991 | #-*- coding: utf-8 -*-
import unittest
from utils import *
from config import *
import sys
from websocket import create_connection
class test_asset_api(websocket_unittest):
@classmethod
def setUpClass(self):
self.ws = create_connection(node_ws_url)
req_data = {
"id":1,
... | 0 | 426 | 0 | 3,946 | 0 | 0 | 0 | 4 | 111 |
24ee08043857d46f3558b4cc4e0b1507802e3d98 | 447 | py | Python | pycoin/symbols/btx.py | jaschadub/pycoin | 1e8d0d9fe20ce0347b97847bb529cd1bd84c7442 | [
"MIT"
] | 1,210 | 2015-01-02T13:36:28.000Z | 2022-03-30T00:52:22.000Z | pycoin/symbols/btx.py | impactog/pycoin | 3db6f82afa3054d8d07caca4909e1aed3de2fceb | [
"MIT"
] | 280 | 2015-01-05T23:16:47.000Z | 2022-02-22T22:02:17.000Z | pycoin/symbols/btx.py | impactog/pycoin | 3db6f82afa3054d8d07caca4909e1aed3de2fceb | [
"MIT"
] | 459 | 2015-01-10T00:15:57.000Z | 2022-03-16T12:04:40.000Z | from pycoin.networks.bitcoinish import create_bitcoinish_network
network = create_bitcoinish_network(
symbol="BTX", network_name="BitCore", subnet_name="mainnet",
wif_prefix_hex="80", sec_prefix="BTXSEC:", address_prefix_hex="03", pay_to_script_prefix_hex="7D",
bip32_prv_prefix_hex="0488ADE4", bip32_pub_pr... | 40.636364 | 102 | 0.756152 | from pycoin.networks.bitcoinish import create_bitcoinish_network
network = create_bitcoinish_network(
symbol="BTX", network_name="BitCore", subnet_name="mainnet",
wif_prefix_hex="80", sec_prefix="BTXSEC:", address_prefix_hex="03", pay_to_script_prefix_hex="7D",
bip32_prv_prefix_hex="0488ADE4", bip32_pub_pr... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0eff419ee1ef9741b78991d7f7b27aa04f4efe7f | 6,047 | py | Python | python/oneflow/compatible/single_client/ops/categorical_ordinal_encode_op.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/compatible/single_client/ops/categorical_ordinal_encode_op.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/compatible/single_client/ops/categorical_ordinal_encode_op.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 36.648485 | 224 | 0.631884 | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 65 | 22 |
69e2480db6e5121298d39170161cd06de057fef8 | 1,282 | py | Python | test/test_task.py | zachliu/airflow-python-sdk | 70b5d08955a9e218fa6163b0612856e09eedce63 | [
"MIT"
] | 12 | 2021-01-22T15:07:47.000Z | 2021-10-19T13:47:40.000Z | test/test_task.py | zachliu/airflow-python-sdk | 70b5d08955a9e218fa6163b0612856e09eedce63 | [
"MIT"
] | null | null | null | test/test_task.py | zachliu/airflow-python-sdk | 70b5d08955a9e218fa6163b0612856e09eedce63 | [
"MIT"
] | 2 | 2021-04-04T13:30:53.000Z | 2021-07-20T13:58:07.000Z | """
Airflow API (Stable)
Apache Airflow management API. # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: zach.z.liu@gmail.com
Generated by: https://openapi-generator.tech
"""
import unittest
from airflow_python_sdk.model.class_reference import ClassReference
from airflow_python_s... | 26.163265 | 79 | 0.735569 | """
Airflow API (Stable)
Apache Airflow management API. # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: zach.z.liu@gmail.com
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import airflow_python_sdk
from airflow_python_sdk.model.class_reference impo... | 0 | 0 | 0 | 298 | 0 | 0 | 0 | 18 | 91 |
d784b6c8f186b3dbad05faf281a15ef964c36801 | 5,399 | py | Python | sqlalchemy_filtering/filter_util.py | cnatsis/sqlalchemy-filtering | 9ca2e1a07ec77e92a2d8f964214f8bffd6161f52 | [
"Apache-2.0"
] | 1 | 2021-12-31T14:02:13.000Z | 2021-12-31T14:02:13.000Z | sqlalchemy_filtering/filter_util.py | cnatsis/sqlalchemy-filtering | 9ca2e1a07ec77e92a2d8f964214f8bffd6161f52 | [
"Apache-2.0"
] | null | null | null | sqlalchemy_filtering/filter_util.py | cnatsis/sqlalchemy-filtering | 9ca2e1a07ec77e92a2d8f964214f8bffd6161f52 | [
"Apache-2.0"
] | null | null | null | import json
from sqlalchemy import Numeric
from sqlalchemy.sql.elements import BinaryExpression
from sqlalchemy_filtering.operators import FilterOperator, SQLDialect
from sqlalchemy_filtering.validators import FilterRequest, Filter, _get_numeric_types, SQLAlchemyField
def filter_apply(query, entity, obj: FilterReque... | 34.608974 | 116 | 0.510835 | import json
from sqlalchemy import Numeric
from sqlalchemy.sql.elements import BinaryExpression
from sqlalchemy_filtering.operators import FilterOperator, SQLDialect
from sqlalchemy_filtering.validators import FilterRequest, Filter, _get_numeric_types, SQLAlchemyField
def filter_apply(query, entity, obj: FilterReque... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
12b46e7df1e3279853ecca2f7584c1d66825860f | 377 | py | Python | mmdet/models/roi_heads/bbox_heads/__init__.py | choasup/mmdetection | 72f6c5976e111e5160c77c210ec033257fec2de0 | [
"Apache-2.0"
] | 1 | 2020-09-27T05:13:44.000Z | 2020-09-27T05:13:44.000Z | mmdet/models/roi_heads/bbox_heads/__init__.py | choasup/mmdetection | 72f6c5976e111e5160c77c210ec033257fec2de0 | [
"Apache-2.0"
] | null | null | null | mmdet/models/roi_heads/bbox_heads/__init__.py | choasup/mmdetection | 72f6c5976e111e5160c77c210ec033257fec2de0 | [
"Apache-2.0"
] | null | null | null | from .bbox_head import BBoxHead
from .convfc_bbox_head import (ConvFCBBoxHead, Shared2FCBBoxHead, Shared4Conv1FCBBoxHead)
from .double_bbox_head import DoubleConvFCBBoxHead
from .detr_head import DetrHead
__all__ = [
'BBoxHead', 'ConvFCBBoxHead', 'Shared2FCBBoxHead',
'Shared4Conv1FCBBoxHead', 'DoubleConvFCBBox... | 31.416667 | 65 | 0.729443 | from .bbox_head import BBoxHead
from .convfc_bbox_head import (ConvFCBBoxHead, Shared2FCBBoxHead,
Shared4Conv1FCBBoxHead)
from .double_bbox_head import DoubleConvFCBBoxHead
from .detr_head import DetrHead
__all__ = [
'BBoxHead', 'ConvFCBBoxHead', 'Shared2FCBBoxHead',
'Shared4Conv... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 31 | 0 |
77b623298203a576c583c2364375d44483e1c9d1 | 224 | py | Python | third_party/text_analysis.py | DahlitzFlorian/python-snippets | 212f63f820b6f5842f74913ed08da18d41dfe7a4 | [
"MIT"
] | 29 | 2019-03-25T09:35:12.000Z | 2022-01-08T22:09:03.000Z | third_party/text_analysis.py | DahlitzFlorian/python-snippets | 212f63f820b6f5842f74913ed08da18d41dfe7a4 | [
"MIT"
] | null | null | null | third_party/text_analysis.py | DahlitzFlorian/python-snippets | 212f63f820b6f5842f74913ed08da18d41dfe7a4 | [
"MIT"
] | 4 | 2020-05-19T21:18:12.000Z | 2021-05-18T12:49:21.000Z | from pathlib import Path
from textblob import TextBlob
path = Path("src/text.txt")
with open(path) as f:
text = f.read()
blob = TextBlob(text)
for sentence in blob.sentences:
print(sentence.sentiment.polarity)
| 14.933333 | 38 | 0.71875 | from pathlib import Path
from textblob import TextBlob
path = Path("src/text.txt")
with open(path) as f:
text = f.read()
blob = TextBlob(text)
for sentence in blob.sentences:
print(sentence.sentiment.polarity)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a767a9922f7c8c53b66021fce8b9643d7ee13bed | 18,857 | py | Python | source/lib/testDataCTE.py | AlainLich/COVID-Data | 43d7f950c86270bfe411af8bc899464f0599f48e | [
"MIT"
] | null | null | null | source/lib/testDataCTE.py | AlainLich/COVID-Data | 43d7f950c86270bfe411af8bc899464f0599f48e | [
"MIT"
] | 3 | 2020-05-16T07:29:01.000Z | 2021-08-29T10:04:17.000Z | source/lib/testDataCTE.py | AlainLich/COVID-Data | 43d7f950c86270bfe411af8bc899464f0599f48e | [
"MIT"
] | null | null | null | # coding: utf-8
__author__ = 'Alain Lichnewsky'
__license__ = 'MIT License'
__version__ = '1.0'
# (C) A.Lichnewsky, 2018, 2020
#
# My own library organization (TBD: clean up ?)
import sys
sys.path.append("pylib")
# Common toolkit imports
import numpy as NP
import numpy.random as RAND
import scip... | 33.733453 | 94 | 0.507557 | # coding: utf-8
__author__ = 'Alain Lichnewsky'
__license__ = 'MIT License'
__version__ = '1.0'
# (C) A.Lichnewsky, 2018, 2020
#
# My own library organization (TBD: clean up ?)
import sys
import traceback
sys.path.append("pylib")
from UnitTest import *
# Common toolkit imports
import numpy as NP
impor... | 0 | 518 | 0 | 8,250 | 0 | 7,102 | 0 | 224 | 375 |
9ab387fb827dab9f8c3fc2dd303379c75c4c7d2e | 2,479 | py | Python | routes_ips.py | sauloal/pifollow | a5324991aa02bc2d749d3eebf69f8367f5b9fa18 | [
"MIT"
] | null | null | null | routes_ips.py | sauloal/pifollow | a5324991aa02bc2d749d3eebf69f8367f5b9fa18 | [
"MIT"
] | null | null | null | routes_ips.py | sauloal/pifollow | a5324991aa02bc2d749d3eebf69f8367f5b9fa18 | [
"MIT"
] | null | null | null |
##
# SHOW
##
##
# LOG
##
#@app.route('/'+app.config['RNG_ID']+'/ips/add/<pi_id>/<pi_ip>/')
#def log_ip(pi_id, pi_ip):
#
# info = Ips(pi_id, request.remote_addr, pi_ip)
#
# db.session.add(info)
# db.session.commit()
#
# return jsonify({'pi_id': pi_id, 'external_ip': request.remote_addr, 'internal_ip': ... | 29.511905 | 127 | 0.584913 | from funcs import *
from db import *
##
# SHOW
##
@app.route('/'+app.config['RNG_ID']+'/ips/list/all/', defaults={'pi_id': None})
@app.route('/'+app.config['RNG_ID']+'/ips/list/all/<pi_id>/')
def show_log_all(pi_id):
try:
if pi_id is None:
res = { 'all': [ x.as_dict() for x in Ip... | 0 | 2,008 | 0 | 0 | 0 | 0 | 0 | 8 | 111 |
bc73600529cbf7c680a07e0abfafc54498d90598 | 5,099 | py | Python | youtubewatched/utils/gen.py | todokku/youtube-watched | 9bdcb3bc3d939062f974d94e156c2ed12f9b23bc | [
"MIT"
] | 5 | 2019-04-11T17:28:25.000Z | 2020-09-15T10:39:29.000Z | youtubewatched/utils/gen.py | todokku/youtube-watched | 9bdcb3bc3d939062f974d94e156c2ed12f9b23bc | [
"MIT"
] | 2 | 2020-01-11T15:24:33.000Z | 2021-03-31T19:12:22.000Z | youtubewatched/utils/gen.py | VldmrB/youtube-watched | 7a7178b454977df83e1518aa0c1ecd8adc6c69d2 | [
"MIT"
] | 2 | 2020-01-11T19:24:20.000Z | 2020-01-12T08:06:09.000Z | import bisect
import logging
import sys
from datetime import datetime
from logging import handlers
from youtubewatched.config import MAX_TIME_DIFFERENCE
def logging_config(log_file_path: str,
file_level: int = logging.DEBUG,
console_out_level: int = logging.DEBUG,
... | 39.223077 | 79 | 0.650324 | import bisect
import logging
import sys
from datetime import datetime
from logging import handlers
from youtubewatched.config import MAX_TIME_DIFFERENCE
def logging_config(log_file_path: str,
file_level: int = logging.DEBUG,
console_out_level: int = logging.DEBUG,
... | 0 | 0 | 0 | 219 | 0 | 814 | 0 | 0 | 96 |
e08bceec3a9c3d786610028f1a21f4007fb4dd20 | 6,204 | py | Python | emission/net/api/visualize.py | Andrew-Tan/e-mission-server | 91d59bee86e63d803e401f10f4b6a2502effedda | [
"BSD-3-Clause"
] | null | null | null | emission/net/api/visualize.py | Andrew-Tan/e-mission-server | 91d59bee86e63d803e401f10f4b6a2502effedda | [
"BSD-3-Clause"
] | 1 | 2017-08-31T19:54:16.000Z | 2017-08-31T19:54:16.000Z | emission/net/api/visualize.py | Andrew-Tan/e-mission-server | 91d59bee86e63d803e401f10f4b6a2502effedda | [
"BSD-3-Clause"
] | null | null | null | __author__ = 'Yin'
# Standard imports
# Our imports
import emission.core.wrapper.motionactivity as ecwm
import emission.storage.decorations.location_queries as esdlq
import emission.storage.timeseries.geoquery as estg
import emission.storage.decorations.analysis_timeseries_queries as esda
import emission.storage.times... | 44.956522 | 136 | 0.704384 | __author__ = 'Yin'
# Standard imports
import logging
from uuid import UUID
# Our imports
from emission.analysis.result.carbon import getModeCarbonFootprint, carbonFootprintForMode
from emission.core.common import Inside_polygon,berkeley_area,getConfirmationModeQuery
from emission.core.get_database import get_section_d... | 0 | 0 | 0 | 0 | 0 | 3,023 | 0 | 480 | 494 |
1137f4626bfd1372f51d5b62b09837c0e911bc4e | 3,438 | py | Python | files/plugins/check_esx_wbem.py | espinosaemanuele/ansible_nagios4_server_plugins | 2ef37eed25062efc3c3aa71ae4411e619dff56cb | [
"MIT"
] | null | null | null | files/plugins/check_esx_wbem.py | espinosaemanuele/ansible_nagios4_server_plugins | 2ef37eed25062efc3c3aa71ae4411e619dff56cb | [
"MIT"
] | 3 | 2017-10-04T14:08:08.000Z | 2020-03-28T00:33:40.000Z | files/plugins/check_esx_wbem.py | espinosaemanuele/ansible_nagios4_server_plugins | 2ef37eed25062efc3c3aa71ae4411e619dff56cb | [
"MIT"
] | 6 | 2019-02-11T19:48:44.000Z | 2019-10-03T21:03:01.000Z | #!/usr/bin/python
#
# Script for checking global health of host running VMware ESX/ESXi
#
# Licence : GNU General Public Licence (GPL) http://www.gnu.org/
# Pre-req : pywbem
#
#@---------------------------------------------------
#@ History
#@---------------------------------------------------
#@ Date : 20080820
#@ A... | 28.890756 | 101 | 0.628854 | #!/usr/bin/python
#
# Script for checking global health of host running VMware ESX/ESXi
#
# Licence : GNU General Public Licence (GPL) http://www.gnu.org/
# Pre-req : pywbem
#
#@---------------------------------------------------
#@ History
#@---------------------------------------------------
#@ Date : 20080820
#@ A... | 0 | 0 | 0 | 0 | 0 | 96 | 0 | 0 | 23 |
0a62186e534f8e0927d7bb8eb2889eb3ca8d3d84 | 2,681 | py | Python | components/scenes/play.py | theodorklauritzen/FlappyBird | aa3e225c7f04470ff4747ebb49acfce67ca53d41 | [
"MIT"
] | 1 | 2019-12-13T10:24:06.000Z | 2019-12-13T10:24:06.000Z | components/scenes/play.py | theodorklauritzen/FlappyBird | aa3e225c7f04470ff4747ebb49acfce67ca53d41 | [
"MIT"
] | null | null | null | components/scenes/play.py | theodorklauritzen/FlappyBird | aa3e225c7f04470ff4747ebb49acfce67ca53d41 | [
"MIT"
] | null | null | null |
# The play scene function
| 28.521277 | 92 | 0.572175 | import pygame
# The play scene function
def play(window, sprites, s):
# init the clock
Clock = pygame.time.Clock()
# store sprites from previous scenes in variables
bird = pygame.sprite.GroupSingle(s[0])
background = s[1]
ground = s[2]
# Create a pipe group
pipes = pygame.sprite.Grou... | 0 | 0 | 0 | 0 | 0 | 2,618 | 0 | -8 | 44 |
e784a20d69a5166512800a9ecf8e698cadfa650a | 238 | py | Python | api/tacticalrmm/scripts/urls.py | jeffreyvh/tacticalrmm | dcfb1732954c2c165e82e6b24686e27f9f909eb3 | [
"MIT"
] | 1 | 2021-01-19T20:39:02.000Z | 2021-01-19T20:39:02.000Z | api/tacticalrmm/scripts/urls.py | jeffreyvh/tacticalrmm | dcfb1732954c2c165e82e6b24686e27f9f909eb3 | [
"MIT"
] | 5 | 2021-04-08T19:44:31.000Z | 2021-09-22T19:34:33.000Z | api/tacticalrmm/scripts/urls.py | jeffreyvh/tacticalrmm | dcfb1732954c2c165e82e6b24686e27f9f909eb3 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path("scripts/", views.GetAddScripts.as_view()),
path("<int:pk>/script/", views.GetUpdateDeleteScript.as_view()),
path("<int:pk>/download/", views.download),
]
| 26.444444 | 68 | 0.689076 | from django.urls import path
from . import views
urlpatterns = [
path("scripts/", views.GetAddScripts.as_view()),
path("<int:pk>/script/", views.GetUpdateDeleteScript.as_view()),
path("<int:pk>/download/", views.download),
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
13beebf4acd9b21bb28b852b68ff91457137cd72 | 9,767 | py | Python | backend/social_quiz.py | jmigual/socialQuiz | 3d9d0980961619b555732899121d8ce6366fa96f | [
"MIT"
] | null | null | null | backend/social_quiz.py | jmigual/socialQuiz | 3d9d0980961619b555732899121d8ce6366fa96f | [
"MIT"
] | null | null | null | backend/social_quiz.py | jmigual/socialQuiz | 3d9d0980961619b555732899121d8ce6366fa96f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import random
import re
from flask import Flask
from flaskrun.flaskrun import flask_run
app = Flask(__name__)
# Regular expression to only accept certain files
fileChecker = re.compile(r"(.*\.js|.*\.html|.*\.png|.*\.css|.*\.map)$")
numberOfAnswers = 4
random.seed(7)
if _... | 33.221088 | 115 | 0.61288 | # -*- coding: utf-8 -*-
import json
import os.path
import random
import re
from flask import Flask, send_from_directory
from flask import request, abort
from flaskrun.flaskrun import flask_run
import datab.social_database as db
app = Flask(__name__)
# Regular expression to only accept certain files
fileChecker = r... | 0 | 8,806 | 0 | 0 | 0 | 68 | 0 | 28 | 503 |
601ba249396407498a73b0ee284df531e3712fae | 467 | py | Python | python2/runner/writeln_decorator.py | polarization/python_koans | bd0f78a66d7fa60272d21bb24202ebff87e73e41 | [
"MIT"
] | null | null | null | python2/runner/writeln_decorator.py | polarization/python_koans | bd0f78a66d7fa60272d21bb24202ebff87e73e41 | [
"MIT"
] | null | null | null | python2/runner/writeln_decorator.py | polarization/python_koans | bd0f78a66d7fa60272d21bb24202ebff87e73e41 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
# Taken from legacy python unittest
| 24.578947 | 74 | 0.640257 | #!/usr/bin/env python
# encoding: utf-8
# Taken from legacy python unittest
class WritelnDecorator:
"""Used to decorate file-like objects with a handy 'writeln' method"""
def __init__(self, stream):
self.stream = stream
def __getattr__(self, attr):
return getattr(self.stream, attr)
... | 0 | 0 | 0 | 367 | 0 | 0 | 0 | 0 | 22 |
109f667b79b1aa5dc4e61160b5ef973b6c358a68 | 2,367 | py | Python | functions/scopelab.py | kookoochris/QTMtoolbox | 9ead661ef8fc3468f09108eee2c4457acc00f79a | [
"MIT"
] | 1 | 2021-04-19T12:34:31.000Z | 2021-04-19T12:34:31.000Z | functions/scopelab.py | kookoochris/QTMtoolbox | 9ead661ef8fc3468f09108eee2c4457acc00f79a | [
"MIT"
] | null | null | null | functions/scopelab.py | kookoochris/QTMtoolbox | 9ead661ef8fc3468f09108eee2c4457acc00f79a | [
"MIT"
] | 2 | 2021-03-22T10:27:21.000Z | 2021-04-19T12:36:59.000Z | # -*- coding: utf-8 -*-
"""
Functions to capture oscilloscope data. The curves are saved into a single
file within the 'ScopeData' directory.
Version 1.0 (2018-10-11)
Daan Wielens - PhD at ICE/QTM
University of Twente
daan@daanwielens.com
"""
| 29.5875 | 96 | 0.613012 | # -*- coding: utf-8 -*-
"""
Functions to capture oscilloscope data. The curves are saved into a single
file within the 'ScopeData' directory.
Version 1.0 (2018-10-11)
Daan Wielens - PhD at ICE/QTM
University of Twente
daan@daanwielens.com
"""
import visa
import numpy as np
from struct import unpack
import matplotlib.... | 0 | 0 | 0 | 0 | 0 | 1,988 | 0 | -21 | 156 |
903bf33190f9697a6f967f423d6cb245c6f22e42 | 3,070 | py | Python | top.py | madisonjordan/KNN_Parallelized | c65b06e726aacc4a8a4a243d28824a8ac1ffc411 | [
"MIT"
] | null | null | null | top.py | madisonjordan/KNN_Parallelized | c65b06e726aacc4a8a4a243d28824a8ac1ffc411 | [
"MIT"
] | null | null | null | top.py | madisonjordan/KNN_Parallelized | c65b06e726aacc4a8a4a243d28824a8ac1ffc411 | [
"MIT"
] | null | null | null | # top.py - top words
'''
input: txt files from ./books folder
output: csv files into the ./data folder
This is a program that will find the top 100 words from a book discluding the stop words. These 100 top words will
be stored in a csv file in the ./data folder for later use in the set.py program.
'''
# https://to... | 34.886364 | 117 | 0.618893 | # top.py - top words
'''
input: txt files from ./books folder
output: csv files into the ./data folder
This is a program that will find the top 100 words from a book discluding the stop words. These 100 top words will
be stored in a csv file in the ./data folder for later use in the set.py program.
'''
# https://to... | 3 | 0 | 0 | 0 | 0 | 2,137 | 0 | -6 | 111 |
248db6090cbbc43c47404802d0badb6f4ee70084 | 5,350 | py | Python | merfishdecoder/util/segmentation.py | r3fang/MERlin | 2ee81a4e18c3fe406d91ee6ce65ca38b69ee9d68 | [
"MIT"
] | null | null | null | merfishdecoder/util/segmentation.py | r3fang/MERlin | 2ee81a4e18c3fe406d91ee6ce65ca38b69ee9d68 | [
"MIT"
] | null | null | null | merfishdecoder/util/segmentation.py | r3fang/MERlin | 2ee81a4e18c3fe406d91ee6ce65ca38b69ee9d68 | [
"MIT"
] | null | null | null | import numpy as np
from skimage.segmentation import find_boundaries
from shapely.geometry import Polygon
from cellpose import models
def extract_polygon_per_index(
img, idx):
"""Extract features from a segmented image.
Parameters
----------
img : np.array
Segmented image.
idx ... | 29.722222 | 149 | 0.595514 | import numpy as np
import geopandas as geo
import pandas as pd
from skimage.segmentation import find_boundaries
from shapely.geometry import Polygon
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import connected_components
from merfishdecoder.core import zplane
from merfishdecoder.core import dataset
... | 0 | 0 | 0 | 0 | 0 | 2,258 | 0 | 86 | 225 |
60d16d782f6a267cd6bbff60af139d3cc3f77c06 | 3,497 | py | Python | PythonSelenium/src/bot.py | talhaHavadar/MomTV | 1673b8d41a3d6157b7e1ba5ba4bd3ad7a70a3ba9 | [
"MIT"
] | 1 | 2019-02-23T06:41:58.000Z | 2019-02-23T06:41:58.000Z | PythonSelenium/src/bot.py | talhaHavadar/MomTV | 1673b8d41a3d6157b7e1ba5ba4bd3ad7a70a3ba9 | [
"MIT"
] | null | null | null | PythonSelenium/src/bot.py | talhaHavadar/MomTV | 1673b8d41a3d6157b7e1ba5ba4bd3ad7a70a3ba9 | [
"MIT"
] | null | null | null | """
Implementation of bot that automates browsing
for watch live broadcasts of tvs.
"""
TV_NONE = None
TV_FOX = 1
TV_STAR = 2
TV_KANALD = 3
TV_SHOW = 4
TV_TRT = 5
TV_ATV = 6
TV_TV2 = 7
| 40.662791 | 147 | 0.595367 | """
Implementation of bot that automates browsing
for watch live broadcasts of tvs.
"""
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
TV_NONE = None
TV_FOX = 1
TV_STAR = 2
TV_KANALD = 3
TV_SHOW = 4
TV_TRT = 5
TV_A... | 0 | 0 | 0 | 3,135 | 0 | 0 | 0 | 78 | 89 |
5dc27975529a86cf280eb1a24a577f5fc6f75e12 | 3,498 | py | Python | pytorch_utils.py | vasulkalivearchive/audio | 6359f2a906b29f5aaa15f4397d87d0e5e81b9056 | [
"MIT"
] | null | null | null | pytorch_utils.py | vasulkalivearchive/audio | 6359f2a906b29f5aaa15f4397d87d0e5e81b9056 | [
"MIT"
] | null | null | null | pytorch_utils.py | vasulkalivearchive/audio | 6359f2a906b29f5aaa15f4397d87d0e5e81b9056 | [
"MIT"
] | null | null | null | import numpy as np
import torch
def do_mixup(x, mixup_lambda):
"""Mixup x of even indexes (0, 2, 4, ...) with x of odd indexes
(1, 3, 5, ...).
Args:
x: (batch_size * 2, ...)
mixup_lambda: (batch_size * 2,)
Returns:
out: (batch_size, ...)
"""
out = (x[0 :: 2].transpose(0, -1)... | 30.417391 | 91 | 0.642939 | import numpy as np
import torch
def move_data_to_device(x, device):
if 'float' in str(x.dtype):
x = torch.Tensor(x)
elif 'int' in str(x.dtype):
x = torch.LongTensor(x)
else:
return x
return x.to(device)
def do_mixup(x, mixup_lambda):
"""Mixup x of even indexes (0, 2, 4, ... | 0 | 0 | 0 | 0 | 0 | 303 | 0 | 0 | 46 |
a4319e67875f08d9f8123a0346ea62a6b245a570 | 5,857 | py | Python | vision/capture/capture_harv.py | BrianOfrim/boja | 6571fbbfb7f015e96e80e822d9dc96b4636b4119 | [
"MIT"
] | 7 | 2020-01-27T18:39:02.000Z | 2022-02-14T13:23:40.000Z | vision/capture/capture_harv.py | a428tm/boja | 6571fbbfb7f015e96e80e822d9dc96b4636b4119 | [
"MIT"
] | 1 | 2021-06-02T00:55:25.000Z | 2021-06-02T00:55:25.000Z | vision/capture/capture_harv.py | a428tm/boja | 6571fbbfb7f015e96e80e822d9dc96b4636b4119 | [
"MIT"
] | 6 | 2020-01-28T21:28:23.000Z | 2020-12-28T14:35:06.000Z |
from .._settings import (DEFAULT_LOCAL_DATA_DIR, DEFAULT_S3_DATA_DIR, DEFAULT_GENTL_PRODUCER_PATH)
WINDOW_NAME = "Capture"
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
parser.add_argument(
"--gentl_producer_path",
type=str,
default=DEFAULT... | 26.382883 | 87 | 0.636503 | import copy
import os
import time
import threading
import typing
import queue
from cv2 import cv2
from genicam.gentl import TimeoutException
from harvesters.core import Harvester
import numpy as np
from .._file_utils import create_output_dir
from .._image_utils import RGB8Image
from .._s3_utils import s3_upload_files... | 0 | 0 | 0 | 0 | 0 | 4,401 | 0 | 121 | 403 |
b851b55c79595fa7c8e14bc40e4b5e02b4a6f408 | 438 | py | Python | activity_log/migrations/0007_convert_user_id_to_char.py | Thao-Tran/django-user-activity-log | 005bd0ca3f16ad72ff8b0c89c1f8ae2d3468250d | [
"MIT"
] | null | null | null | activity_log/migrations/0007_convert_user_id_to_char.py | Thao-Tran/django-user-activity-log | 005bd0ca3f16ad72ff8b0c89c1f8ae2d3468250d | [
"MIT"
] | null | null | null | activity_log/migrations/0007_convert_user_id_to_char.py | Thao-Tran/django-user-activity-log | 005bd0ca3f16ad72ff8b0c89c1f8ae2d3468250d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
| 21.9 | 75 | 0.621005 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('activity_log', '0006_auto_20190816_1641'),
]
operations = [
migrations.AlterField(
model_name='activitylog',
... | 0 | 0 | 0 | 308 | 0 | 0 | 0 | 19 | 46 |
365e796862ef4f38f47eb7dd7599e7d3edd719f5 | 2,309 | py | Python | qiskit/opflow/legacy/__init__.py | KOLANICH/qiskit-terra | 3947f258ddb31a2b8dd17aff5d2d041d29d74601 | [
"Apache-2.0"
] | 1 | 2021-04-28T14:37:16.000Z | 2021-04-28T14:37:16.000Z | qiskit/opflow/legacy/__init__.py | timgates42/qiskit-terra | 3947f258ddb31a2b8dd17aff5d2d041d29d74601 | [
"Apache-2.0"
] | 6 | 2021-01-17T17:56:08.000Z | 2021-04-01T12:40:21.000Z | qiskit/opflow/legacy/__init__.py | timgates42/qiskit-terra | 3947f258ddb31a2b8dd17aff5d2d041d29d74601 | [
"Apache-2.0"
] | 2 | 2021-03-07T07:58:54.000Z | 2021-04-28T03:40:49.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 27.819277 | 97 | 0.721091 | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 42 | 0 |
78a9acc77c87a73b415d8525ebd301c1961444fd | 2,914 | py | Python | jspider/web/app.py | goodking-bq/Jspider | 2ae484fe8ec59824ba40df5aa3d3c434486da2d8 | [
"Apache-2.0"
] | null | null | null | jspider/web/app.py | goodking-bq/Jspider | 2ae484fe8ec59824ba40df5aa3d3c434486da2d8 | [
"Apache-2.0"
] | null | null | null | jspider/web/app.py | goodking-bq/Jspider | 2ae484fe8ec59824ba40df5aa3d3c434486da2d8 | [
"Apache-2.0"
] | null | null | null | # coding:utf-8
from __future__ import absolute_import, unicode_literals
__author__ = "golden"
__date__ = '2018/6/1'
| 31.333333 | 98 | 0.550446 | # coding:utf-8
from __future__ import absolute_import, unicode_literals
from sanic import Sanic
from sanic.response import html, json
import os
from .api import bp
from sanic_cors import CORS
from sanic_auth import Auth, User
__author__ = "golden"
__date__ = '2018/6/1'
def app_creator(config: dict, manager=None):
... | 30 | 2,055 | 0 | 0 | 0 | 554 | 0 | 22 | 155 |
7a61d877a4eb404537553722f55dc09d8c969c36 | 112 | py | Python | napalm_inspector/main/__init__.py | napalm-automation/napalm-inspector | 744e1439b10c38792f97252f7e834fe8ceaa8a8d | [
"Apache-2.0"
] | 3 | 2019-05-13T15:34:12.000Z | 2021-05-26T15:31:50.000Z | napalm_inspector/main/__init__.py | napalm-automation/napalm-inspector | 744e1439b10c38792f97252f7e834fe8ceaa8a8d | [
"Apache-2.0"
] | null | null | null | napalm_inspector/main/__init__.py | napalm-automation/napalm-inspector | 744e1439b10c38792f97252f7e834fe8ceaa8a8d | [
"Apache-2.0"
] | 1 | 2020-02-03T19:18:54.000Z | 2020-02-03T19:18:54.000Z | from flask import Blueprint
bp = Blueprint("main", __name__)
| 18.666667 | 48 | 0.776786 | from flask import Blueprint
bp = Blueprint("main", __name__)
from napalm_inspector.main import routes # noqa
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 19 | 31 |
0e415cb6c3b71872ae9d5840c7e0213cb3c23354 | 323 | py | Python | Desafio 43.py | MoomenEltelbany/PythonDesafios | aa2f44d3104cf3607f58dc42c2f8fc8023f128de | [
"MIT"
] | null | null | null | Desafio 43.py | MoomenEltelbany/PythonDesafios | aa2f44d3104cf3607f58dc42c2f8fc8023f128de | [
"MIT"
] | null | null | null | Desafio 43.py | MoomenEltelbany/PythonDesafios | aa2f44d3104cf3607f58dc42c2f8fc8023f128de | [
"MIT"
] | null | null | null | peso = float(input('Qual o seu peso: (KG) '))
altura = float(input('Qual a sua altura: (m)'))
imc = peso / (altura ** 2)
if imc < 18.5:
print('Abaixo do peso.')
elif imc < 25:
print('Peso Ideal.')
elif imc < 30:
print('Sobrepeso')
elif imc < 40:
print('obesidade')
else:
print('Obesidade mrbida.') | 23.071429 | 49 | 0.600619 | peso = float(input('Qual é o seu peso: (KG) '))
altura = float(input('Qual é a sua altura: (m)'))
imc = peso / (altura ** 2)
if imc < 18.5:
print('Abaixo do peso.')
elif imc < 25:
print('Peso Ideal.')
elif imc < 30:
print('Sobrepeso')
elif imc < 40:
print('obesidade')
else:
print('Obesidade mórbida... | 6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b347237a4a7a615a7d47f60c8083b6f521e866d4 | 967 | py | Python | config.py | ireina7/zero-shot-segmentation | 870d08ad7ea3965f006d0eb44667f6ecd87ef205 | [
"MIT"
] | null | null | null | config.py | ireina7/zero-shot-segmentation | 870d08ad7ea3965f006d0eb44667f6ecd87ef205 | [
"MIT"
] | null | null | null | config.py | ireina7/zero-shot-segmentation | 870d08ad7ea3965f006d0eb44667f6ecd87ef205 | [
"MIT"
] | null | null | null | import os
import torch
split = "1"
os.environ["CUDA_VISIBLE_DEVICES"] = "7"
RESTORE_FROM_WHERE = "pretrained"
EMBEDDING = "all"
lambdaa = 0.2
#USE_CPU = True
DEVICE = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
BATCH_SIZE = 9
NUM_WORKERS = 3
ITER_SIZE = 1
IGNORE_LABEL = 255 # the background
INPUT_S... | 23.585366 | 73 | 0.747673 | import os
import os.path as ospx
import torch
split = "1"
os.environ["CUDA_VISIBLE_DEVICES"] = "7"
RESTORE_FROM_WHERE = "pretrained"
EMBEDDING = "all"
lambdaa = 0.2
#USE_CPU = True
DEVICE = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
BATCH_SIZE = 9
NUM_WORKERS = 3
ITER_SIZE = 1
IGNORE_LABEL = 255 #... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 22 |
a1b104eb96ac099a626080ee439ff9be55545d83 | 46 | py | Python | pyupload/__init__.py | nandemonogatari/pyupload | 64a351edbbe1d50d726c446bbe26926d016e3d17 | [
"MIT"
] | null | null | null | pyupload/__init__.py | nandemonogatari/pyupload | 64a351edbbe1d50d726c446bbe26926d016e3d17 | [
"MIT"
] | null | null | null | pyupload/__init__.py | nandemonogatari/pyupload | 64a351edbbe1d50d726c446bbe26926d016e3d17 | [
"MIT"
] | null | null | null | name = "pyupload" | 23 | 28 | 0.782609 | name = "pyupload"
from .main import pyuploader | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 22 |
8775aa8f6c4e3379e4a36ececc597ac859226ebb | 2,520 | py | Python | predict.py | canturan10/image.classification.on.EuroSAT | caaee82b8d1bae9888779e5d2e60674291cedb81 | [
"MIT"
] | null | null | null | predict.py | canturan10/image.classification.on.EuroSAT | caaee82b8d1bae9888779e5d2e60674291cedb81 | [
"MIT"
] | null | null | null | predict.py | canturan10/image.classification.on.EuroSAT | caaee82b8d1bae9888779e5d2e60674291cedb81 | [
"MIT"
] | null | null | null | import random
import os
import argparse
from cv2 import cv2
from model import Classifier
from matplotlib import pyplot as plt
def parse_arguments():
"""
Object for parsing command line strings into Python objects.
"""
arg = argparse.ArgumentParser()
arg.add_argument('--source', '-s', type=str, def... | 30.731707 | 91 | 0.621825 | import random
import os
import argparse
from cv2 import cv2
from model import Classifier
from matplotlib import pyplot as plt
def parse_arguments():
"""
Object for parsing command line strings into Python objects.
"""
arg = argparse.ArgumentParser()
arg.add_argument('--source', '-s', type=str, def... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
edaa872c0bf16cbbe07e719b55d795351da66016 | 7,537 | py | Python | CV_adv/DNNtest/coverage/pytorch_wrapper.py | ziqi-zhang/ReMoS_artifact | 9cbac09333aeb0891cc54d287d6829fdf4bd5d23 | [
"MIT"
] | 4 | 2022-03-14T06:11:19.000Z | 2022-03-16T09:21:59.000Z | CV_adv/DNNtest/coverage/pytorch_wrapper.py | ziqi-zhang/ReMoS_artifact | 9cbac09333aeb0891cc54d287d6829fdf4bd5d23 | [
"MIT"
] | null | null | null | CV_adv/DNNtest/coverage/pytorch_wrapper.py | ziqi-zhang/ReMoS_artifact | 9cbac09333aeb0891cc54d287d6829fdf4bd5d23 | [
"MIT"
] | 2 | 2022-03-14T22:58:24.000Z | 2022-03-16T05:29:37.000Z | """
Provides a class for torch model evaluation.
"""
from __future__ import absolute_import
| 36.765854 | 153 | 0.60077 | """
Provides a class for torch model evaluation.
"""
from __future__ import absolute_import
import warnings
import torch
from .utils import common
from pdb import set_trace as st
class PyTorchModel:
""" Class for torch model evaluation.
Provide predict, intermediate_layer_outputs and adversarial_attack
... | 0 | 0 | 0 | 7,331 | 0 | 0 | 0 | -1 | 114 |
b38d6a09eeb0157b5c4e60bec79de253eac3cf27 | 339 | py | Python | prospecting/urls.py | Tiniguar/Salesforce | beb29c0249366ec1e823ca04bbfb2198168f00b3 | [
"MIT"
] | 1 | 2019-08-07T20:39:04.000Z | 2019-08-07T20:39:04.000Z | prospecting/urls.py | Tiniguar/Salesforce | beb29c0249366ec1e823ca04bbfb2198168f00b3 | [
"MIT"
] | null | null | null | prospecting/urls.py | Tiniguar/Salesforce | beb29c0249366ec1e823ca04bbfb2198168f00b3 | [
"MIT"
] | null | null | null | from django.conf.urls import patterns, url
from views import index_view, search, purchase, get_balance
urlpatterns = patterns('',
url(r'^$', index_view, name='index'),
url(r'^search/(?P<sobject>[\w\-]+)/(?P<name>[\w\- ]+)$', search),
url(r'^purchase/(?P<sobject>[\w\-]+)$', purchase),
url(r'^getBalance... | 33.9 | 69 | 0.625369 | from django.conf.urls import patterns, url
from views import index_view, search, purchase, get_balance
urlpatterns = patterns('',
url(r'^$', index_view, name='index'),
url(r'^search/(?P<sobject>[\w\-]+)/(?P<name>[\w\- ]+)$', search),
url(r'^purchase/(?P<sobject>[\w\-]+)$', purchase),
url(r'^getBalance... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d3bf393fe2ed9c8b3e5e8008c18c3b7aadca63dc | 1,257 | py | Python | comancpipeline/Tools/stats.py | S-Yuan137/COMAPreduce | bcb8b171ae3a226b10978e83f85ec72f538466ff | [
"MIT"
] | null | null | null | comancpipeline/Tools/stats.py | S-Yuan137/COMAPreduce | bcb8b171ae3a226b10978e83f85ec72f538466ff | [
"MIT"
] | null | null | null | comancpipeline/Tools/stats.py | S-Yuan137/COMAPreduce | bcb8b171ae3a226b10978e83f85ec72f538466ff | [
"MIT"
] | null | null | null | import numpy as np
def MAD(d,axis=0):
"""
Return Median Absolute Deviation for array along one axis
"""
med_d = np.nanmedian(d,axis=axis)
rms = np.sqrt(np.nanmedian((d-med_d)**2,axis=axis))*1.48
return rms
def AutoRMS(tod):
"""
Auto-differenced RMS
"""
if len(tod.shape) == 2:... | 20.95 | 61 | 0.608592 | import numpy as np
from matplotlib import pyplot
import h5py
import healpy as hp
import sys
from tqdm import tqdm
from comancpipeline.Tools import Coordinates
from matplotlib.transforms import ScaledTranslation
from scipy.signal import fftconvolve
def MAD(d,axis=0):
"""
Return Median Absolute Deviation for ar... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 53 | 176 |
cce40674f6e51133682c440f27d199c9dfe8c9fb | 11,347 | py | Python | adplus.py | skyu0221/cmput692 | 7837c9f25c88ddeb0b04b13da1b37e16fd31cdb2 | [
"MIT"
] | null | null | null | adplus.py | skyu0221/cmput692 | 7837c9f25c88ddeb0b04b13da1b37e16fd31cdb2 | [
"MIT"
] | null | null | null | adplus.py | skyu0221/cmput692 | 7837c9f25c88ddeb0b04b13da1b37e16fd31cdb2 | [
"MIT"
] | null | null | null |
NUMBERS = "0123456789"
DELIMITERS = "~!@#$%^*()_+`-={}|[]:<>?;',/'\\" + '"'
ROMAN = "IVXL"
CATEGORY_RATIO = 0.3
CATEGORY_NUMBER = 5
FREQUENCY_RATIO = 0.1
FREQUENCY_NUMBER = 1
DISTANCE_THRESHOLD = 1
SIMILARITY_THRESHOLD = 0.9
little_result_counter = 0
if __name__ == '__main__':
extract_data()
| 33.178363 | 111 | 0.519256 | import csv, json
import numpy as np
from pprint import pprint
import difflib
import numeral
from scipy.stats.kde import gaussian_kde
from tqdm import tqdm
import Levenshtein
import itertools
NUMBERS = "0123456789"
DELIMITERS = "~!@#$%^*()_+`-={}|[]:<>?;',/'\\" + '"'
ROMAN = "IVXL"
CATEGORY_RATIO = 0.3
CATEGORY_NUMBER... | 0 | 0 | 0 | 2,138 | 0 | 8,546 | 0 | -7 | 359 |
ac99d9482189d1e627b0b25084eebbdc6cb06964 | 627 | py | Python | peoplemanager/migrations/0011_auto_20190627_1512.py | percevalm/aumyproject | b24b38005188ce9dd41ed663cf54dad5464afef3 | [
"bzip2-1.0.6"
] | null | null | null | peoplemanager/migrations/0011_auto_20190627_1512.py | percevalm/aumyproject | b24b38005188ce9dd41ed663cf54dad5464afef3 | [
"bzip2-1.0.6"
] | 16 | 2020-03-24T17:30:37.000Z | 2022-03-11T23:57:41.000Z | peoplemanager/migrations/0011_auto_20190627_1512.py | percevalm/aumyproject | b24b38005188ce9dd41ed663cf54dad5464afef3 | [
"bzip2-1.0.6"
] | null | null | null | # Generated by Django 2.2.2 on 2019-06-27 15:12
| 31.35 | 244 | 0.650718 | # Generated by Django 2.2.2 on 2019-06-27 15:12
from django.db import migrations
import multiselectfield.db.fields
class Migration(migrations.Migration):
dependencies = [
('peoplemanager', '0010_staffdetail_research_theme'),
]
operations = [
migrations.AlterField(
model_name... | 0 | 0 | 0 | 487 | 0 | 0 | 0 | 23 | 68 |
94746fc5c5b37c50cd3ee905585c1d1525a36ab3 | 810 | py | Python | tests/test_doctests.py | Open-EO/openeo-udf | cdd910c5da1f752991415d8732e5dbdcfeac2366 | [
"Apache-2.0"
] | 7 | 2018-06-21T12:29:55.000Z | 2022-02-05T11:48:48.000Z | tests/test_doctests.py | Open-EO/openeo-udf | cdd910c5da1f752991415d8732e5dbdcfeac2366 | [
"Apache-2.0"
] | 32 | 2018-06-05T11:11:36.000Z | 2021-06-10T09:07:25.000Z | tests/test_doctests.py | Open-EO/openeo-udf | cdd910c5da1f752991415d8732e5dbdcfeac2366 | [
"Apache-2.0"
] | 1 | 2019-07-31T08:04:00.000Z | 2019-07-31T08:04:00.000Z | # -*- coding: utf-8 -*-
"""
Temporal framework doctests
"""
import doctest
import unittest
from openeo_udf.api import collection_base, feature_collection, datacube, machine_learn_model, spatial_extent, udf_data, structured_data
def load_tests(loader, tests, ignore):
"""Load all doctests from the base implementat... | 31.153846 | 75 | 0.771605 | # -*- coding: utf-8 -*-
"""
Temporal framework doctests
"""
import doctest
import unittest
from openeo_udf.api import collection_base, feature_collection, datacube, \
machine_learn_model, spatial_extent, udf_data, structured_data
def load_tests(loader, tests, ignore):
"""Load all doctests from the base imple... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0 |
1ad27a64886b0c11ca57ee67396d9aff71810721 | 546 | py | Python | featurize.py | ijkilchenko/ml_photo_manipulation | 35b227adc768b18a0a831ab819c2062cb3bb6b23 | [
"MIT"
] | null | null | null | featurize.py | ijkilchenko/ml_photo_manipulation | 35b227adc768b18a0a831ab819c2062cb3bb6b23 | [
"MIT"
] | null | null | null | featurize.py | ijkilchenko/ml_photo_manipulation | 35b227adc768b18a0a831ab819c2062cb3bb6b23 | [
"MIT"
] | null | null | null | from pic2vec import ImageFeaturizer
import os
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--path', help='Path to the images')
parser.add_argument('--depth', help='Depth of Xception')
parser.set_defaults(depth=2)
args = parser.parse_args()
image_column_name = 'images'
my_featurizer = Image... | 32.117647 | 89 | 0.791209 | from pic2vec import ImageFeaturizer
import os
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--path', help='Path to the images')
parser.add_argument('--depth', help='Depth of Xception')
parser.set_defaults(depth=2)
args = parser.parse_args()
image_column_name = 'images'
my_featurizer = Image... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
575d3b73de22bb34c4b716a2b74ec2ecc471109a | 499 | py | Python | teamModule/migrations/0014_auto_20180625_0941.py | GeniALE/SiteWebGeniALE | 39488a89887d6855590ab39a59dbc2b6dca21892 | [
"MIT"
] | 4 | 2018-03-17T15:38:17.000Z | 2020-10-03T12:06:19.000Z | teamModule/migrations/0014_auto_20180625_0941.py | GeniALE/SiteWebGeniALE | 39488a89887d6855590ab39a59dbc2b6dca21892 | [
"MIT"
] | 80 | 2018-02-01T02:55:01.000Z | 2022-03-11T23:17:17.000Z | teamModule/migrations/0014_auto_20180625_0941.py | GeniALE/SiteWebGeniALE | 39488a89887d6855590ab39a59dbc2b6dca21892 | [
"MIT"
] | 2 | 2018-01-30T09:27:31.000Z | 2019-07-25T23:50:49.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-06-25 13:41
from __future__ import unicode_literals
| 24.95 | 76 | 0.721443 | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-06-25 13:41
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('teamModule', '0013_auto_20180620_1441'),
]
operations = [
migrations.AlterField(
model... | 0 | 0 | 0 | 322 | 0 | 0 | 0 | 19 | 46 |
26bd64e5bb630fa2654b78b361be1eb3066a8781 | 10,429 | py | Python | PyFin/arcap/regression1.py | QuantFinEcon/py-learn | 7151f01df9f7f096312e43434fe8026d1d7d7828 | [
"Apache-2.0"
] | 2 | 2021-03-07T17:13:49.000Z | 2022-03-29T08:55:17.000Z | PyFin/arcap/regression1.py | QuantFinEcon/py-learn | 7151f01df9f7f096312e43434fe8026d1d7d7828 | [
"Apache-2.0"
] | 1 | 2021-06-10T20:17:55.000Z | 2021-06-10T20:17:55.000Z | PyFin/arcap/regression1.py | QuantFinEcon/py-learn | 7151f01df9f7f096312e43434fe8026d1d7d7828 | [
"Apache-2.0"
] | null | null | null | filename = 'risk tickers.xlsx'
xls = pd.ExcelFile(filename)
sht = xls.sheet_names
for i in sht: print i
df = pd.read_excel(filename,sheetname='Iron Steel')
#print the column names
print df.columns
#get the values for a given column
FLDS = df['Tickers'].values
for i in FLDS: print i
FLDS.shape
FLDS = FLDS.tolist()
FLD... | 26.809769 | 118 | 0.597948 | filename = 'risk tickers.xlsx'
xls = pd.ExcelFile(filename)
sht = xls.sheet_names
for i in sht: print i
df = pd.read_excel(filename,sheetname='Iron Steel')
#print the column names
print df.columns
#get the values for a given column
FLDS = df['Tickers'].values
for i in FLDS: print i
FLDS.shape
FLDS = FLDS.tolist()
FLD... | 0 | 0 | 0 | 0 | 0 | 786 | 0 | 0 | 45 |
6554497e62b2070409b41a1debd5816cd7043db1 | 5,671 | py | Python | seq2seq.py | StuartCHAN/KARL | 2a4bb39d2db7646f57e66bda7c6694ba33022f76 | [
"MIT"
] | 1 | 2019-10-13T04:55:14.000Z | 2019-10-13T04:55:14.000Z | seq2seq.py | StuartCHAN/bert_rl_qa | 2a4bb39d2db7646f57e66bda7c6694ba33022f76 | [
"MIT"
] | 6 | 2021-04-30T20:56:34.000Z | 2022-03-12T00:02:12.000Z | seq2seq.py | StuartCHAN/bert_rl_qa | 2a4bb39d2db7646f57e66bda7c6694ba33022f76 | [
"MIT"
] | 1 | 2021-05-15T02:59:38.000Z | 2021-05-15T02:59:38.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 11 20:36:35 2019
@author: Stuart
"""
import torch.nn as nn
import neural_layers as nl #
from transf_decoder import Transformer
import utils
import matplotlib.pyplot as plt
plt.switch_backend('agg')
import argparse
"""class Seq2SeqModel:
def __init__(self, outp... | 42.962121 | 209 | 0.688944 | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 11 20:36:35 2019
@author: Stuart
"""
import torch
import torch.nn as nn
import torch.nn.utils.rnn as rnn_utils
import neural_layers as nl #
from transf_decoder import Transformer
import utils
import matplotlib.pyplot as plt
plt.switch_backend('agg')
import argparse
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 45 |
9cf3a0f345b850496711fb8d24cd484cf832c7d3 | 2,676 | py | Python | grch38/bash_experiment_scripts/summarize_mapping_acc.py | langmead-lab/reference_flow-experiments | 8838c56c5fff36a8aff708e24c72d9537e47ff9b | [
"MIT"
] | null | null | null | grch38/bash_experiment_scripts/summarize_mapping_acc.py | langmead-lab/reference_flow-experiments | 8838c56c5fff36a8aff708e24c72d9537e47ff9b | [
"MIT"
] | null | null | null | grch38/bash_experiment_scripts/summarize_mapping_acc.py | langmead-lab/reference_flow-experiments | 8838c56c5fff36a8aff708e24c72d9537e47ff9b | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
args = parse_args()
if args.mode == 'sensitivity':
organize_accuracy(args.input, args.output)
elif args.mode == 'unaligned':
organize_unaligned(args.input, args.output)
elif args.mode == 'num_incorrect':
organize_numincorrect(args.input, args.out... | 35.210526 | 120 | 0.565396 | import argparse
def organize_accuracy(fn_input, fn_output):
with open(fn_input, 'r') as f:
list_tp = []
list_all = []
for line in f:
if line.count('sensitivity_all') > 0:
line = line.split()
list_tp.append(int(line[3][1:]))
list_al... | 0 | 0 | 0 | 0 | 0 | 2,174 | 0 | -6 | 114 |
65f76ce53624e1fdf87b36c63dadb9c271788510 | 2,669 | py | Python | brax/tests/urdf_test.py | lweitkamp/brax | a854eccd3bbefd06a067f80e4d9695b5eadf963b | [
"Apache-2.0"
] | 1,162 | 2021-06-03T20:15:05.000Z | 2022-03-31T19:53:06.000Z | brax/tests/urdf_test.py | lweitkamp/brax | a854eccd3bbefd06a067f80e4d9695b5eadf963b | [
"Apache-2.0"
] | 160 | 2021-06-05T02:32:39.000Z | 2022-03-31T11:39:58.000Z | brax/tests/urdf_test.py | lweitkamp/brax | a854eccd3bbefd06a067f80e4d9695b5eadf963b | [
"Apache-2.0"
] | 117 | 2021-06-04T17:18:21.000Z | 2022-03-30T18:04:48.000Z | # Copyright 2021 The Brax Authors.
#
# 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 wri... | 32.156627 | 85 | 0.618584 | # Copyright 2021 The Brax Authors.
#
# 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 wri... | 0 | 0 | 0 | 515 | 0 | 0 | 0 | 6 | 45 |
2b05380922d0783456b1795d2a167f1b10e36b0f | 867 | py | Python | dakara_server/users/migrations/0003_dakara_user_username.py | DakaraProject/dakara-server | b28fc1a8561e431d562102932f3d6ff3607e545b | [
"MIT"
] | 4 | 2018-07-24T18:22:16.000Z | 2020-01-24T16:30:54.000Z | dakara_server/users/migrations/0003_dakara_user_username.py | DakaraProject/dakara-server | b28fc1a8561e431d562102932f3d6ff3607e545b | [
"MIT"
] | 88 | 2017-11-04T08:58:02.000Z | 2022-03-30T11:39:08.000Z | dakara_server/users/migrations/0003_dakara_user_username.py | DakaraProject/dakara-server | b28fc1a8561e431d562102932f3d6ff3607e545b | [
"MIT"
] | 1 | 2018-05-05T15:37:20.000Z | 2018-05-05T15:37:20.000Z | # Generated by Django 1.11.15 on 2018-11-25 08:34
| 32.111111 | 87 | 0.590542 | # Generated by Django 1.11.15 on 2018-11-25 08:34
import django.contrib.auth.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("users", "0002_dakara_user_username")]
replaces = [("users", "0003_auto_20181125_0834")]
operations = [
migrat... | 0 | 0 | 0 | 713 | 0 | 0 | 0 | 35 | 68 |
4fe9df32eb23ea9bcd08be9d49369e4807b437e7 | 771 | py | Python | tests/test_suite_1.py | influence-usa/campaign-finance_state_OH | 948c88257a321541c19738abeca07358062efaa8 | [
"MIT"
] | 1 | 2020-04-21T07:08:43.000Z | 2020-04-21T07:08:43.000Z | tests/test_suite_1.py | influence-usa/campaign-finance_state_OH | 948c88257a321541c19738abeca07358062efaa8 | [
"MIT"
] | null | null | null | tests/test_suite_1.py | influence-usa/campaign-finance_state_OH | 948c88257a321541c19738abeca07358062efaa8 | [
"MIT"
] | null | null | null | import sys, os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__),'..')))
from work import Ohio
import unittest
Ohio = Ohio()
if __name__=='__main__':
unittest.main( )
| 36.714286 | 106 | 0.71725 | import sys,os
import collections
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__),'..')))
from work import Ohio
import unittest
Ohio = Ohio()
class Ohiotests(unittest.TestCase):
def setUp(self):
self.Ohio = Ohio
self.Ohio.unzipped_dir = '/home/aaron/projects/campaign-finance_s... | 0 | 0 | 0 | 537 | 0 | 0 | 0 | -4 | 44 |
0d3d7e15bf4a3ff06701d801dd36db3ad286f152 | 2,603 | py | Python | Back/ecoreleve_server/GenericObjets/FrontModules.py | NaturalSolutions/NS.Bootstrap | c2cc73717dbe769e064c3254a5b20cb16b37bda2 | [
"MIT"
] | null | null | null | Back/ecoreleve_server/GenericObjets/FrontModules.py | NaturalSolutions/NS.Bootstrap | c2cc73717dbe769e064c3254a5b20cb16b37bda2 | [
"MIT"
] | null | null | null | Back/ecoreleve_server/GenericObjets/FrontModules.py | NaturalSolutions/NS.Bootstrap | c2cc73717dbe769e064c3254a5b20cb16b37bda2 | [
"MIT"
] | null | null | null |
FieldSizeToClass = {0:'col-md-3',1:'col-md-6',2:'col-md-12'}
| 36.152778 | 135 | 0.614291 | from ecoreleve_server.Models import Base,DBSession
from sqlalchemy import Column, DateTime, Float, ForeignKey, Index, Integer, Numeric, String, Text, Unicode, text,Sequence,orm,and_,text
from sqlalchemy.dialects.mssql.base import BIT
from sqlalchemy.orm import relationship
FieldSizeToClass = {0:'col-md-3',1:'col-md-6'... | 0 | 72 | 0 | 2,147 | 0 | 0 | 0 | 186 | 134 |
ed0b7775406532aa2b43639f51681af603384b83 | 2,158 | py | Python | examples/scatter2.py | yang69can/pyngl | 78a7040ce9de4b7a442b0c3b5faecccab2f01426 | [
"Apache-2.0"
] | 125 | 2016-11-24T09:04:28.000Z | 2022-01-22T14:06:56.000Z | examples/scatter2.py | yang69can/pyngl | 78a7040ce9de4b7a442b0c3b5faecccab2f01426 | [
"Apache-2.0"
] | 52 | 2017-11-08T23:23:02.000Z | 2022-03-20T03:17:39.000Z | examples/scatter2.py | yang69can/pyngl | 78a7040ce9de4b7a442b0c3b5faecccab2f01426 | [
"Apache-2.0"
] | 25 | 2017-08-27T10:50:43.000Z | 2022-01-29T14:56:05.000Z | #
# File:
# scatter2.py
#
# Synopsis:
# Draws random markers using user-defined markers.
#
# Category:
# XY plots
# polymarkers
#
# Author:
# Mary Haley
#
# Date of initial publication:
# December, 2005
#
# Description:
# This example generates some random data and plots the data as an
# ... | 24.522727 | 78 | 0.610751 | #
# File:
# scatter2.py
#
# Synopsis:
# Draws random markers using user-defined markers.
#
# Category:
# XY plots
# polymarkers
#
# Author:
# Mary Haley
#
# Date of initial publication:
# December, 2005
#
# Description:
# This example generates some random data and plots the data as an
# ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
daf5e52957e4574d490eae4806c93052d56879c2 | 716 | py | Python | cryptopals/utils/conversion_util.py | rstoro/cryptopals | 5eb8f18ff48ff3b6cc02a687b5b9affa2a17b023 | [
"MIT"
] | null | null | null | cryptopals/utils/conversion_util.py | rstoro/cryptopals | 5eb8f18ff48ff3b6cc02a687b5b9affa2a17b023 | [
"MIT"
] | null | null | null | cryptopals/utils/conversion_util.py | rstoro/cryptopals | 5eb8f18ff48ff3b6cc02a687b5b9affa2a17b023 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
| 18.842105 | 57 | 0.695531 | #!/usr/bin/env python3
from base64 import b64encode, b64decode
from sys import byteorder
class ConversionUtil(object):
@staticmethod
def hex_to_bytes(h):
return bytes.fromhex(h)
@staticmethod
def str_to_bytes(s, encoding='utf-8'):
return bytes(s, encoding)
@staticmethod
def bytes_to_str(bs):
... | 0 | 418 | 0 | 8 | 0 | 0 | 0 | 22 | 244 |
c78bb737d7c0f55875bfa4cd771dae3232b3c35e | 4,180 | py | Python | napari/_vispy/experimental/tile_set.py | NHPatterson/napari | d8d2d301b71af79a6a7f8f4bafa1f55a18317dd8 | [
"BSD-3-Clause"
] | null | null | null | napari/_vispy/experimental/tile_set.py | NHPatterson/napari | d8d2d301b71af79a6a7f8f4bafa1f55a18317dd8 | [
"BSD-3-Clause"
] | null | null | null | napari/_vispy/experimental/tile_set.py | NHPatterson/napari | d8d2d301b71af79a6a7f8f4bafa1f55a18317dd8 | [
"BSD-3-Clause"
] | null | null | null | """TileSet class.
TiledImageVisual uses this class to track the tiles it's drawing.
"""
| 27.682119 | 77 | 0.598565 | """TileSet class.
TiledImageVisual uses this class to track the tiles it's drawing.
"""
from typing import Dict, List, NamedTuple, Set
from ...layers.image.experimental import OctreeChunk, OctreeChunkKey
from .texture_atlas import AtlasTile
class TileData(NamedTuple):
"""TileSet stores one TileData per tile.
... | 0 | 1,421 | 0 | 2,468 | 0 | 0 | 0 | 87 | 113 |
edf8590f630cfede5d4ce21f33ebeb52e72fa132 | 12,239 | py | Python | app/routes/businesses/controller/business_metrics/business_metric_controller.py | mampilly/backend-global | a2248758d521bf7f136fbc5fd12902448d137b33 | [
"MIT"
] | null | null | null | app/routes/businesses/controller/business_metrics/business_metric_controller.py | mampilly/backend-global | a2248758d521bf7f136fbc5fd12902448d137b33 | [
"MIT"
] | null | null | null | app/routes/businesses/controller/business_metrics/business_metric_controller.py | mampilly/backend-global | a2248758d521bf7f136fbc5fd12902448d137b33 | [
"MIT"
] | null | null | null | from __future__ import annotations
import datetime
from fastapi import APIRouter
router = APIRouter(prefix="/business-metric")
CALLS = 900
PERIOD = 900
start = datetime.date.today().isoformat()
| 35.78655 | 196 | 0.686657 | from __future__ import annotations
import logging
import datetime
from fastapi import APIRouter, Depends, params
from typing import List, Optional
from app.core.auth import get_current_user
from app.ratelimit.time_bucketed import rate_limit
from app.routes.businesses.service.business_metrics.business_metric_service im... | 21 | 10,259 | 0 | 0 | 0 | 0 | 0 | 1,092 | 674 |
e406b2aac56354b27f5432dc4bb98eb3b2a6e134 | 539 | py | Python | server/djangoapp/admin.py | albertoprimerano/agfzb-CloudAppDevelopment_Capstone | fc3cb1737716d8db17ccc997dd6272b7f866fdaf | [
"Apache-2.0"
] | 1 | 2022-03-09T20:08:54.000Z | 2022-03-09T20:08:54.000Z | server/djangoapp/admin.py | albertoprimerano/agfzb-CloudAppDevelopment_Capstone | fc3cb1737716d8db17ccc997dd6272b7f866fdaf | [
"Apache-2.0"
] | null | null | null | server/djangoapp/admin.py | albertoprimerano/agfzb-CloudAppDevelopment_Capstone | fc3cb1737716d8db17ccc997dd6272b7f866fdaf | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from .models import CarMake, CarModel
# Car Model Inline
# Car Make Inline
# Car Make Admin
# Car Model Admin
admin.site.register(CarMake)
admin.site.register(CarModel)
| 17.387097 | 39 | 0.732839 | from django.contrib import admin
from .models import CarMake, CarModel
# Car Model Inline
class CarModelInline(admin.ModelAdmin):
model = CarModel
extra = 5
# Car Make Inline
class CarMakeInline(admin.ModelAdmin):
model = CarMake
extra = 5
# Car Make Admin
class CarMakeAdmin(admin.ModelAdmin):
... | 0 | 0 | 0 | 239 | 0 | 0 | 0 | 0 | 88 |
2d94e675d3c0b35d2e5f3d04ea24e94bd341088a | 913 | py | Python | scripts/python/test/test_NDE.py | ScottLongmore/MIRS_TC | 51c3964b8192f71716f075fbe3fd2ffbdb656fb5 | [
"BSD-3-Clause"
] | 1 | 2020-04-03T05:26:32.000Z | 2020-04-03T05:26:32.000Z | scripts/python/test/test_NDE.py | ScottLongmore/MIRS_TC | 51c3964b8192f71716f075fbe3fd2ffbdb656fb5 | [
"BSD-3-Clause"
] | null | null | null | scripts/python/test/test_NDE.py | ScottLongmore/MIRS_TC | 51c3964b8192f71716f075fbe3fd2ffbdb656fb5 | [
"BSD-3-Clause"
] | null | null | null | # System
import unittest
import json
import logging
import pprint
try:
exePath=os.path.dirname(os.path.abspath(__file__))
parentPath,childDir=os.path.split(exePath)
sys.path.insert(1,os.path.join(parentPath,"lib"))
except:
print "Unable to load local library paths"
sys.exit(1)
# Local
import NDE
imp... | 22.825 | 74 | 0.683461 | # System
import unittest
import json
import logging
import pprint
try:
exePath=os.path.dirname(os.path.abspath(__file__))
parentPath,childDir=os.path.split(exePath)
sys.path.insert(1,os.path.join(parentPath,"lib"))
except:
print "Unable to load local library paths"
sys.exit(1)
# Local
import NDE
imp... | 0 | 0 | 0 | 490 | 0 | 0 | 0 | 0 | 24 |
8e25bcebc44f3cd80642cd9e4150606c8474ced6 | 2,217 | py | Python | zcmtypes/python/craebot/motor_feedback_t.py | sudhanvas/Craebot | e1ae401af06d8c89efb8ee8319725b21dadb5e2f | [
"BSD-3-Clause"
] | 4 | 2017-04-03T16:11:38.000Z | 2021-05-28T02:19:03.000Z | zcmtypes/python/craebot/motor_feedback_t.py | sudhanvas/Craebot | e1ae401af06d8c89efb8ee8319725b21dadb5e2f | [
"BSD-3-Clause"
] | null | null | null | zcmtypes/python/craebot/motor_feedback_t.py | sudhanvas/Craebot | e1ae401af06d8c89efb8ee8319725b21dadb5e2f | [
"BSD-3-Clause"
] | 1 | 2021-02-07T02:18:33.000Z | 2021-02-07T02:18:33.000Z | """ZCM type definitions
This file automatically generated by zcm.
DO NOT MODIFY BY HAND!!!!
"""
try:
import cStringIO.StringIO as BytesIO
except ImportError:
| 35.758065 | 158 | 0.694632 | """ZCM type definitions
This file automatically generated by zcm.
DO NOT MODIFY BY HAND!!!!
"""
try:
import cStringIO.StringIO as BytesIO
except ImportError:
from io import BytesIO
import struct
class motor_feedback_t(object):
__slots__ = ["utime", "left_wheel_position", "right_wheel_position", "left_whee... | 0 | 0 | 0 | 1,989 | 0 | 0 | 0 | -7 | 71 |
75855cc7565e9f355b3e622cfcf96d089d06b670 | 807 | py | Python | plyer/platforms/android/devicename.py | lcs-d3v/plyer | 7617bdba4ead0bd2768e40a942100a0d9d89a0ae | [
"MIT"
] | 1,184 | 2015-01-02T23:24:46.000Z | 2022-03-27T16:28:16.000Z | plyer/platforms/android/devicename.py | lcs-d3v/plyer | 7617bdba4ead0bd2768e40a942100a0d9d89a0ae | [
"MIT"
] | 469 | 2015-01-02T09:23:15.000Z | 2022-03-17T10:35:58.000Z | plyer/platforms/android/devicename.py | lcs-d3v/plyer | 7617bdba4ead0bd2768e40a942100a0d9d89a0ae | [
"MIT"
] | 431 | 2015-01-05T23:00:43.000Z | 2022-03-15T04:20:03.000Z | '''
Module of Android API for plyer.devicename.
'''
from jnius import autoclass
Build = autoclass('android.os.Build')
def instance():
'''
Instance for facade proxy.
'''
return AndroidDeviceName()
| 23.735294 | 78 | 0.681537 | '''
Module of Android API for plyer.devicename.
'''
from jnius import autoclass
from plyer.facades import DeviceName
Build = autoclass('android.os.Build')
class AndroidDeviceName(DeviceName):
'''
Implementation of Android devicename API.
'''
def _get_device_name(self):
"""
Method to... | 0 | 0 | 0 | 530 | 0 | 0 | 0 | 15 | 45 |
6bc7be0691735c71d78cfb50afb7b18bea7d8d64 | 538 | py | Python | src/main/python/retry/playground.py | islaterm/retry | 180d8b812bc889d7785e58916c04084e2c1ca409 | [
"CC-BY-4.0"
] | null | null | null | src/main/python/retry/playground.py | islaterm/retry | 180d8b812bc889d7785e58916c04084e2c1ca409 | [
"CC-BY-4.0"
] | null | null | null | src/main/python/retry/playground.py | islaterm/retry | 180d8b812bc889d7785e58916c04084e2c1ca409 | [
"CC-BY-4.0"
] | null | null | null | """
"ReTry" (c) by Ignacio Slater M.
"ReTry" is licensed under a
Creative Commons Attribution 4.0 International License.
You should have received a copy of the license along with this
work. If not, see <https://creativecommons.org/licenses/by/4.0/>.
"""
from retry.geometry import Point
from retry.tree.rtree import RTre... | 26.9 | 66 | 0.687732 | """
"ReTry" (c) by Ignacio Slater M.
"ReTry" is licensed under a
Creative Commons Attribution 4.0 International License.
You should have received a copy of the license along with this
work. If not, see <https://creativecommons.org/licenses/by/4.0/>.
"""
from retry.geometry import Point
from retry.tree.rtree import RTre... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3d8168adce803eee4c3ed862dcdb7ff5588a4c0c | 9,361 | py | Python | projects/python_plugin_code/pandas_1.2_code/plugin_code/patched_styler.py | rendner/py-plugin-dataframe-viewer | 188585bd31a6c14413949865b3467dcbf6f5e2d1 | [
"Apache-2.0"
] | 1 | 2021-11-07T03:47:51.000Z | 2021-11-07T03:47:51.000Z | projects/python_plugin_code/pandas_1.2_code/plugin_code/patched_styler.py | rendner/py-plugin-dataframe-viewer | 188585bd31a6c14413949865b3467dcbf6f5e2d1 | [
"Apache-2.0"
] | null | null | null | projects/python_plugin_code/pandas_1.2_code/plugin_code/patched_styler.py | rendner/py-plugin-dataframe-viewer | 188585bd31a6c14413949865b3467dcbf6f5e2d1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 cms.rendner (Daniel Schmidt)
#
# 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... | 46.805 | 127 | 0.690311 | # Copyright 2021 cms.rendner (Daniel Schmidt)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 0 | 3,689 | 0 | 4,353 | 0 | 0 | 0 | 382 | 309 |
edfe673f3ca1c57bfc7565f10dbcaa1273427802 | 695 | py | Python | gateway/app.py | harsha-bhat/docker-gateway | bf1dde9937ba2f3dbe13d4c985b113655d332437 | [
"MIT"
] | null | null | null | gateway/app.py | harsha-bhat/docker-gateway | bf1dde9937ba2f3dbe13d4c985b113655d332437 | [
"MIT"
] | null | null | null | gateway/app.py | harsha-bhat/docker-gateway | bf1dde9937ba2f3dbe13d4c985b113655d332437 | [
"MIT"
] | null | null | null | from flask import Flask
from .proxy import create_proxy
def create_app(config):
"""Create flask app"""
app = Flask(__name__)
routes = config["routes"]
for route in routes:
create_proxy(app, route["path_prefix"], route["backend"], config["backends"])
return app
| 21.71875 | 85 | 0.604317 | from flask import Flask
from .proxy import create_proxy
from . import stats
def create_app(config):
"""Create flask app"""
app = Flask(__name__)
routes = config["routes"]
@app.route("/")
def index():
return "<p>Gateway Service Running</p>"
for route in routes:
create_proxy(a... | 0 | 300 | 0 | 0 | 0 | 0 | 0 | -2 | 103 |
e9a5fb093e21cbb7b051a562f6d402b4c6088ef5 | 96 | py | Python | cap5/c5e5.1.py | JoseArtur/phyton-exercices | f3da4447044e445222233960f991fb2e36311131 | [
"MIT"
] | null | null | null | cap5/c5e5.1.py | JoseArtur/phyton-exercices | f3da4447044e445222233960f991fb2e36311131 | [
"MIT"
] | null | null | null | cap5/c5e5.1.py | JoseArtur/phyton-exercices | f3da4447044e445222233960f991fb2e36311131 | [
"MIT"
] | null | null | null | # Modify the program to show the numbers from 1 to 100.
x=1
while x<=100:
print(x)
x=x+1 | 19.2 | 55 | 0.645833 | # Modify the program to show the numbers from 1 to 100.
x=1
while x<=100:
print(x)
x=x+1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a1b9601c8502a9abbb2dda7c4de8ec7894291281 | 83,777 | py | Python | jtune/jtune.py | linkedin/JTune | 2266659f65054e7c021223eefe9e0755c4be540e | [
"Apache-2.0"
] | 301 | 2015-03-29T03:12:46.000Z | 2020-07-31T12:27:36.000Z | jtune/jtune.py | linkedin/JTune | 2266659f65054e7c021223eefe9e0755c4be540e | [
"Apache-2.0"
] | 28 | 2015-04-14T15:02:59.000Z | 2019-01-28T16:13:52.000Z | jtune/jtune.py | linkedin/JTune | 2266659f65054e7c021223eefe9e0755c4be540e | [
"Apache-2.0"
] | 73 | 2015-03-28T08:39:27.000Z | 2020-12-22T09:53:48.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author Eric Bullen <ebullen@linkedin.com>
@application jtune.py
@version 4.0.1
@abstract This tool will give detailed information about the running
JVM in real-time. It produces useful information that can
further assist the user ... | 43.724948 | 507 | 0.583955 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author Eric Bullen <ebullen@linkedin.com>
@application jtune.py
@version 4.0.1
@abstract This tool will give detailed information about the running
JVM in real-time. It produces useful information that can
further assist the user ... | 0 | 0 | 0 | 8,233 | 0 | 6,232 | 0 | -14 | 159 |
444ba10fa4a29280aecd2e5277aa82c440804601 | 1,216 | py | Python | lightningflower/model.py | ManuelRoeder/lightningflower | b790743eafd4035ea7958f3d886042d12b5856a6 | [
"MIT"
] | null | null | null | lightningflower/model.py | ManuelRoeder/lightningflower | b790743eafd4035ea7958f3d886042d12b5856a6 | [
"MIT"
] | null | null | null | lightningflower/model.py | ManuelRoeder/lightningflower | b790743eafd4035ea7958f3d886042d12b5856a6 | [
"MIT"
] | null | null | null | """LightningFlower Model"""
| 39.225806 | 100 | 0.678454 | """LightningFlower Model"""
import flwr as fl
import pytorch_lightning as pl
class LightningFlowerModel:
def __init__(self, model, name="", strict_params=False):
# Check if the model is a Lightning Module
assert isinstance(model, pl.LightningModule)
# Internally persist the model
s... | 0 | 0 | 0 | 1,115 | 0 | 0 | 0 | 5 | 67 |
ac48925f1605f65b16ad512d8353619e4552a08b | 278 | py | Python | web/sites/problemdel.py | interestingLSY/intOJ | 1800fb204ffc69931c376333ae3454f036bd180c | [
"BSD-2-Clause"
] | 8 | 2018-12-12T03:38:13.000Z | 2019-01-25T11:46:20.000Z | web/sites/problemdel.py | interestingLSY/intOJ | 1800fb204ffc69931c376333ae3454f036bd180c | [
"BSD-2-Clause"
] | 1 | 2019-03-10T05:06:34.000Z | 2019-03-18T10:55:42.000Z | web/sites/problemdel.py | interestingLSY/intOJ | 1800fb204ffc69931c376333ae3454f036bd180c | [
"BSD-2-Clause"
] | 1 | 2019-03-17T02:04:35.000Z | 2019-03-17T02:04:35.000Z | #coding:utf-8
| 23.166667 | 58 | 0.758993 | #coding:utf-8
from flask import *
import pymysql
import db,modules
def Run(problem_id):
if not modules.Current_User_Privilege(2):
flash(r'无此权限','error')
return modules.Page_Back()
db.Execute("DELETE FROM problems WHERE id=%s",problem_id)
return redirect('/problemlist')
| 12 | 0 | 0 | 0 | 0 | 184 | 0 | -13 | 89 |
cb044dbca569e5e7cbf382949c8dd8923fa33aea | 4,714 | py | Python | sphinx/source/_extensions/jinja.py | zguoch/OFTutorials | 9eddcb11e2404f18021cc8492900717c1d63d430 | [
"MIT"
] | null | null | null | sphinx/source/_extensions/jinja.py | zguoch/OFTutorials | 9eddcb11e2404f18021cc8492900717c1d63d430 | [
"MIT"
] | null | null | null | sphinx/source/_extensions/jinja.py | zguoch/OFTutorials | 9eddcb11e2404f18021cc8492900717c1d63d430 | [
"MIT"
] | null | null | null | #
# The sphinx-jinja extension is available from https://github.com/tardyp/sphinx-jinja,
# licensed under the MIT License.
#
#
# The MIT License
#
# Copyright (c) 2016-2019 Pierre Tardy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files... | 42.089286 | 99 | 0.622613 | #
# The sphinx-jinja extension is available from https://github.com/tardyp/sphinx-jinja,
# licensed under the MIT License.
#
#
# The MIT License
#
# Copyright (c) 2016-2019 Pierre Tardy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files... | 0 | 0 | 0 | 2,883 | 0 | 261 | 0 | 56 | 268 |
01219c12c2a9a67ffff4b890173d690f652400df | 1,878 | py | Python | snakemake_workflow_template/release_modules/create_identifiers/create_identifiers/regulondb_multigenomic/multigenomic_identifiers.py | regulondbunam/RegulonDB-MCO-Felipe | 6e5546907399d5712a8e69f2f8320af8d30b9d7b | [
"MIT"
] | null | null | null | snakemake_workflow_template/release_modules/create_identifiers/create_identifiers/regulondb_multigenomic/multigenomic_identifiers.py | regulondbunam/RegulonDB-MCO-Felipe | 6e5546907399d5712a8e69f2f8320af8d30b9d7b | [
"MIT"
] | null | null | null | snakemake_workflow_template/release_modules/create_identifiers/create_identifiers/regulondb_multigenomic/multigenomic_identifiers.py | regulondbunam/RegulonDB-MCO-Felipe | 6e5546907399d5712a8e69f2f8320af8d30b9d7b | [
"MIT"
] | null | null | null | import identifiers_api
from .identifier_object_builder import set_identifier_object
def manage_ids(jsons_data, **metadata_properties):
"""
:param jsons_data:
:param kwargs:
:return:
"""
organism = metadata_properties.get("organism", None)
for dataset in jsons_data:
collection_... | 42.681818 | 159 | 0.750266 | import identifiers_api
from .identifier_object_builder import set_identifier_object
def handle_id(identifier_object, collection_registered_identifiers):
# if the identifier already exists, we will updated its
# lastRegulonDBVersionUsed field
if identifier_object["_id"] in collection_registered_identifier... | 0 | 0 | 0 | 0 | 0 | 568 | 0 | 0 | 23 |
c4318b8bf8ef629d4bcba1f43be350298beff7da | 7,164 | py | Python | python/paddle/fluid/contrib/slim/tests/test_imperative_out_scale.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 17,085 | 2016-11-18T06:40:52.000Z | 2022-03-31T22:52:32.000Z | python/paddle/fluid/contrib/slim/tests/test_imperative_out_scale.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 29,769 | 2016-11-18T06:35:22.000Z | 2022-03-31T16:46:15.000Z | python/paddle/fluid/contrib/slim/tests/test_imperative_out_scale.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 4,641 | 2016-11-18T07:43:33.000Z | 2022-03-31T15:15:02.000Z | # copyright (c) 2018 paddlepaddle authors. all rights reserved.
#
# licensed under the apache license, version 2.0 (the "license");
# you may not use this file except in compliance with the license.
# you may obtain a copy of the license at
#
# http://www.apache.org/licenses/license-2.0
#
# unless required by app... | 33.792453 | 75 | 0.623395 | # copyright (c) 2018 paddlepaddle authors. all rights reserved.
#
# licensed under the apache license, version 2.0 (the "license");
# you may not use this file except in compliance with the license.
# you may obtain a copy of the license at
#
# http://www.apache.org/licenses/license-2.0
#
# unless required by app... | 0 | 0 | 0 | 5,213 | 0 | 134 | 0 | 302 | 335 |
48bec0353e9bc231773a5641a68ce37193dff890 | 641 | py | Python | site/sermons/migrations/0005_auto_20190808_0252.py | scottBowles/dailyoffice2019 | ca750ac77316d247ca7a7a820e085f9968fbc8ff | [
"MIT"
] | 19 | 2020-01-12T23:57:22.000Z | 2022-03-30T16:35:17.000Z | site/sermons/migrations/0005_auto_20190808_0252.py | scottBowles/dailyoffice2019 | ca750ac77316d247ca7a7a820e085f9968fbc8ff | [
"MIT"
] | 59 | 2020-01-13T00:45:27.000Z | 2022-02-20T04:10:05.000Z | site/sermons/migrations/0005_auto_20190808_0252.py | scottBowles/dailyoffice2019 | ca750ac77316d247ca7a7a820e085f9968fbc8ff | [
"MIT"
] | 7 | 2020-01-21T21:12:03.000Z | 2021-10-24T01:15:50.000Z | # Generated by Django 2.2.3 on 2019-08-08 02:52
| 29.136364 | 138 | 0.595944 | # Generated by Django 2.2.3 on 2019-08-08 02:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("sermons", "0004_auto_20190808_0251")]
operations = [
migrations.AlterField(
model_name="sermon",
name="primary_date_and_time_give... | 0 | 0 | 0 | 527 | 0 | 0 | 0 | 19 | 46 |
dfaec5e7b55b1c59719e1279741eb6567b4536cf | 230 | py | Python | 200116/Python/solution.py | ktaletsk/daily-problem | 62ea445d499b8c5211eba635373102627e1d2710 | [
"MIT"
] | 1 | 2020-01-20T20:31:44.000Z | 2020-01-20T20:31:44.000Z | 200116/Python/solution.py | ktaletsk/daily-problem | 62ea445d499b8c5211eba635373102627e1d2710 | [
"MIT"
] | null | null | null | 200116/Python/solution.py | ktaletsk/daily-problem | 62ea445d499b8c5211eba635373102627e1d2710 | [
"MIT"
] | null | null | null |
nums = [4, 6, 2, 6, 7, 2, 1] | 28.75 | 60 | 0.634783 | class Solution(object):
def findDisappearedNumbers(self, nums):
return list(set(range(1,len(nums)+1)) - set(nums))
nums = [4, 6, 2, 6, 7, 2, 1]
def test():
assert Solution().findDisappearedNumbers(nums) == [3, 5] | 0 | 0 | 0 | 105 | 0 | 51 | 0 | 0 | 45 |
d230bd1a76380fb950c6cafa0cfc50d88946482b | 5,607 | py | Python | Kaggle_Competitions/CV_CellSegmentation.py | kmader/qbi-2019-py | 25ca789cc35e02ac02eaa5e1943093ef55c096a5 | [
"Apache-2.0"
] | 2 | 2019-11-06T16:20:50.000Z | 2020-01-11T03:38:02.000Z | Kaggle_Competitions/CV_CellSegmentation.py | kmader/qbi-2019-py | 25ca789cc35e02ac02eaa5e1943093ef55c096a5 | [
"Apache-2.0"
] | 2 | 2019-11-06T16:41:39.000Z | 2019-11-07T13:02:17.000Z | Kaggle_Competitions/CV_CellSegmentation.py | kmader/qbi-2019-py | 25ca789cc35e02ac02eaa5e1943093ef55c096a5 | [
"Apache-2.0"
] | 1 | 2021-04-09T10:43:55.000Z | 2021-04-09T10:43:55.000Z | #!/usr/bin/env python
# coding: utf-8
# In this Kernel, I'd like to show you a very basic segmentation technique whihc only applies pure computer vision techniques. Nothing fancy.
#
# At first, I'll show the step-by-step processing and after that I will create the submission for the competition.
#
# With this kernel, ... | 22.074803 | 280 | 0.688782 | #!/usr/bin/env python
# coding: utf-8
# In this Kernel, I'd like to show you a very basic segmentation technique whihc only applies pure computer vision techniques. Nothing fancy.
#
# At first, I'll show the step-by-step processing and after that I will create the submission for the competition.
#
# With this kernel, ... | 0 | 0 | 0 | 0 | 126 | 907 | 0 | 15 | 115 |
e4e2c057d716503e6ba0401dde6b3f5ad2e211c8 | 1,959 | py | Python | shablbot/core/utils.py | Blackgard/vk-bot-python | 5d1eb269d76567a8e31dec47c0ea3c5cc1bcbc3c | [
"MIT"
] | 5 | 2019-11-12T05:15:07.000Z | 2022-01-20T06:26:55.000Z | shablbot/core/utils.py | Blackgard/vk-bot-python | 5d1eb269d76567a8e31dec47c0ea3c5cc1bcbc3c | [
"MIT"
] | 1 | 2021-06-02T00:33:47.000Z | 2021-06-02T00:33:47.000Z | shablbot/core/utils.py | Blackgard/vk-bot-python | 5d1eb269d76567a8e31dec47c0ea3c5cc1bcbc3c | [
"MIT"
] | 2 | 2021-12-18T17:03:10.000Z | 2022-01-29T17:08:35.000Z | from typing import Any, List
from anytree import Node
def render_state(name_module: str, module: Any) -> None:
""" Render state module bot. Use tree.
Args:
name_module (str): Modules name
module (Any): Object for check node
"""
render_state = RenderState({ name_module: module })
... | 31.596774 | 129 | 0.634507 | from typing import Any, List, Dict
from anytree import Node, RenderTree, ContRoundStyle
class RenderState:
" Render state class. View shablbot module active in tree style. "
def __init__(self, modules: Dict[str, Any], main_root: Node = None):
self.modules = modules
self.main_root = main_root
... | 0 | 0 | 0 | 1,053 | 0 | 0 | 0 | 34 | 23 |
3e4bd952403d2276a16fe6e594f1e94e0b8e90bf | 740 | py | Python | examples/plot_2d_graph.py | gfngoncalves/foam_graph | b1b735aef3eeaa6e9b8430c5520abff871ce3ffb | [
"MIT"
] | null | null | null | examples/plot_2d_graph.py | gfngoncalves/foam_graph | b1b735aef3eeaa6e9b8430c5520abff871ce3ffb | [
"MIT"
] | null | null | null | examples/plot_2d_graph.py | gfngoncalves/foam_graph | b1b735aef3eeaa6e9b8430c5520abff871ce3ffb | [
"MIT"
] | null | null | null | # %%
import matplotlib.pyplot as plt
from torch_geometric.data import download_url, extract_tar
from foam_graph.utils.graph_from_foam import read_foam
from foam_graph.visualization.graph_plotting import plot_graph
# %% Extract tar and read case as a graph
download_url("https://github.com/gfngoncalves/openfoam_cases/bl... | 26.428571 | 102 | 0.752703 | # %%
import matplotlib.pyplot as plt
from torch_geometric.data import download_url, extract_tar
from foam_graph.utils.graph_from_foam import read_foam
from foam_graph.visualization.graph_plotting import plot_graph
# %% Extract tar and read case as a graph
download_url("https://github.com/gfngoncalves/openfoam_cases/bl... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3093dbc865abb3135a47c825de9eebf66e5d0d5e | 4,954 | py | Python | src/VersionControl/Git/Branches/Feature/Finish.py | flexiooss/flexio-flow | 47491c7e5b49a02dc859028de0d486edc0014b26 | [
"Apache-2.0"
] | null | null | null | src/VersionControl/Git/Branches/Feature/Finish.py | flexiooss/flexio-flow | 47491c7e5b49a02dc859028de0d486edc0014b26 | [
"Apache-2.0"
] | 44 | 2019-04-05T06:08:15.000Z | 2021-09-13T19:37:49.000Z | src/VersionControl/Git/Branches/Feature/Finish.py | flexiooss/flexio-flow | 47491c7e5b49a02dc859028de0d486edc0014b26 | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
| 35.898551 | 116 | 0.646952 | from __future__ import annotations
from typing import Type, Optional, List
from Exceptions.BranchHaveDiverged import BranchHaveDiverged
from Exceptions.BranchNotExist import BranchNotExist
from Exceptions.GitMergeConflictError import GitMergeConflictError
from Exceptions.NotCleanWorkingTree import NotCleanWorkingTree... | 0 | 0 | 0 | 4,161 | 0 | 0 | 0 | 402 | 355 |
a980fa4865ba7ee280855f960b289e3b10b23ac7 | 3,439 | py | Python | omega_format/dynamics/dynamic_object.py | kai-storms/omega_format | 745f67d774d2da04201de9fe24fa24468a8b191b | [
"MIT"
] | 11 | 2021-07-15T13:47:59.000Z | 2022-03-16T14:06:22.000Z | omega_format/dynamics/dynamic_object.py | kai-storms/omega_format | 745f67d774d2da04201de9fe24fa24468a8b191b | [
"MIT"
] | 1 | 2022-01-19T10:15:05.000Z | 2022-01-31T12:28:35.000Z | omega_format/dynamics/dynamic_object.py | kai-storms/omega_format | 745f67d774d2da04201de9fe24fa24468a8b191b | [
"MIT"
] | 2 | 2021-07-17T05:37:09.000Z | 2022-01-20T07:35:50.000Z |
def in_timespan(obj, birth, death):
"""
birth = first timestamp idx
death = last timestamp idx
"""
return birth <= obj.end and death >= obj.birth
| 33.715686 | 98 | 0.635941 | from dataclasses import fields
from pydantic import conint
from pydantic.fields import Field
import numpy as np
from .bounding_box import BoundingBox
from .trajectory import Trajectory
from ..settings import DefaultValues
from ..enums import ReferenceTypes
from ..geometry import BBXCornersClass
from ..reference_resol... | 0 | 934 | 0 | 1,441 | 0 | 493 | 0 | 110 | 290 |
5ef70e448176718d624998272370abec0f1efc36 | 8,695 | py | Python | src/django_vcs_watch/models.py | svetlyak40wt/django-vcs-watch | fa341c488b8a863812dd2b25cb0bda6d9beffdc9 | [
"BSD-3-Clause"
] | 1 | 2016-05-08T13:45:53.000Z | 2016-05-08T13:45:53.000Z | src/django_vcs_watch/models.py | svetlyak40wt/django-vcs-watch | fa341c488b8a863812dd2b25cb0bda6d9beffdc9 | [
"BSD-3-Clause"
] | null | null | null | src/django_vcs_watch/models.py | svetlyak40wt/django-vcs-watch | fa341c488b8a863812dd2b25cb0bda6d9beffdc9 | [
"BSD-3-Clause"
] | 1 | 2019-06-10T16:49:02.000Z | 2019-06-10T16:49:02.000Z | from django.conf import settings
from django.contrib.auth.models import User
if 'django_globals' not in settings.INSTALLED_APPS:
raise Exception('Please, install django_globals application.')
if 'django_globals.middleware.User' not in settings.MIDDLEWARE_CLASSES:
raise Exception('Please, add django_globals.m... | 28.601974 | 110 | 0.6046 | import calendar
import datetime
import logging
import operator
import os
import pytz
from pdb import set_trace
from django.db import models
from django.conf import settings
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import DjangoUnico... | 0 | 447 | 0 | 6,524 | 0 | 354 | 0 | 299 | 497 |
3038ed4fb65985a3d843541d067e12a19deb1be3 | 1,225 | py | Python | act_to_gpl.py | muys4970/small_scripts | 4bcafd74c47a2b0c24aa67ac9f95611cf45f148b | [
"MIT"
] | 11 | 2021-01-04T18:16:34.000Z | 2022-03-07T20:18:42.000Z | act_to_gpl.py | muys4970/small_scripts | 4bcafd74c47a2b0c24aa67ac9f95611cf45f148b | [
"MIT"
] | null | null | null | act_to_gpl.py | muys4970/small_scripts | 4bcafd74c47a2b0c24aa67ac9f95611cf45f148b | [
"MIT"
] | 8 | 2020-12-11T00:51:18.000Z | 2022-01-13T18:52:41.000Z | #!/usr/bin/env python3
#
# Adobe Photoshop "*.act" palette file conversion to GIMP "*.gpl" palette
# format (which is also recognized by many other tools).
#
# How to use:
# ./act_to_gpl.py some_palette.act > some_palette.gpl
#
# Code based on swatchbook/codecs/adobe_act.py from:
# http://www.selapa.net/swatchbooker/... | 26.630435 | 82 | 0.610612 | #!/usr/bin/env python3
#
# Adobe Photoshop "*.act" palette file conversion to GIMP "*.gpl" palette
# format (which is also recognized by many other tools).
#
# How to use:
# ./act_to_gpl.py some_palette.act > some_palette.gpl
#
# Code based on swatchbook/codecs/adobe_act.py from:
# http://www.selapa.net/swatchbooker/... | 0 | 0 | 0 | 0 | 0 | 687 | 0 | -15 | 91 |
02ce5f1acf7dc53c2d03827ffa1683a44ab3b7ae | 2,444 | py | Python | predictor.py | ved789/ImageReader | 9d1f2bec9a7ccc270d9125a4e53bb93642662e34 | [
"Apache-2.0"
] | 1 | 2021-09-01T07:00:45.000Z | 2021-09-01T07:00:45.000Z | predictor.py | ved789/ImageReader | 9d1f2bec9a7ccc270d9125a4e53bb93642662e34 | [
"Apache-2.0"
] | null | null | null | predictor.py | ved789/ImageReader | 9d1f2bec9a7ccc270d9125a4e53bb93642662e34 | [
"Apache-2.0"
] | null | null | null | from flask import Flask
import os
import tensorflow as tf
food_classes = ['Broken street sign', 'Damaged bollard', 'Damaged street light', 'Pothole']
app = Flask(__name__, static_url_path='/static')
app.config["IMAGE_UPLOADS"] = './static'
app.config["ALLOWED_IMAGE_EXTENSIONS"] = ["JPEG", "JPG", "PNG"]
food_predic... | 27.155556 | 137 | 0.645254 | from flask import Flask, request, redirect, render_template
from werkzeug.utils import secure_filename
import os
import tensorflow as tf
import numpy as np
import cv2
food_classes = ['Broken street sign', 'Damaged bollard', 'Damaged street light', 'Pothole']
app = Flask(__name__, static_url_path='/static')
app.conf... | 0 | 1,556 | 0 | 0 | 0 | 212 | 0 | 44 | 135 |
5d31335ada9205591b56e394c748cdabaffb4985 | 1,284 | py | Python | src/dynamic-programming/mccall-job-search/opt-policy-example-0.py | jackg0/quantecon | 6f8305a41969ad9dbb8d6bf824054f695ec5ef89 | [
"MIT"
] | null | null | null | src/dynamic-programming/mccall-job-search/opt-policy-example-0.py | jackg0/quantecon | 6f8305a41969ad9dbb8d6bf824054f695ec5ef89 | [
"MIT"
] | null | null | null | src/dynamic-programming/mccall-job-search/opt-policy-example-0.py | jackg0/quantecon | 6f8305a41969ad9dbb8d6bf824054f695ec5ef89 | [
"MIT"
] | null | null | null | import numpy as np
from quantecon.distributions import BetaBinomial
n, a, b = 50, 200, 100
w_min, w_max = 10, 60
w_vals = np.linspace(w_min, w_max, n+1)
dist = BetaBinomial(n, a, b)
psi_vals = dist.pdf()
reservation_wage = compute_reservation_wage(w_vals, psi_vals)
print(reservation_wage)
| 25.176471 | 99 | 0.658879 | import numpy as np
from numba import jit
import matplotlib.pyplot as plt
import quantecon as qe
from quantecon.distributions import BetaBinomial
n, a, b = 50, 200, 100
w_min, w_max = 10, 60
w_vals = np.linspace(w_min, w_max, n+1)
dist = BetaBinomial(n, a, b)
psi_vals = dist.pdf()
def plot_w_distribution(w_vals, psi_... | 0 | 0 | 0 | 0 | 0 | 840 | 0 | 11 | 135 |
b003aa22f4a17b7c6740683c9d583a5038ef68eb | 1,587 | py | Python | main.py | AlessandroChen/AutoCnblogs | a537c94560e8dad8fe33a845ab9db2b45f80efe3 | [
"Apache-2.0"
] | null | null | null | main.py | AlessandroChen/AutoCnblogs | a537c94560e8dad8fe33a845ab9db2b45f80efe3 | [
"Apache-2.0"
] | null | null | null | main.py | AlessandroChen/AutoCnblogs | a537c94560e8dad8fe33a845ab9db2b45f80efe3 | [
"Apache-2.0"
] | null | null | null | import xmlrpc.client as xmlrpclib
import json
config_path = "./blog_config.json"
def have_config():
'''
return bool value : whether config file exists
'''
try:
with open(config_path, "r", encoding = "utf-8") as f:
try:
cfg = json.load(f)
return cfg !... | 28.854545 | 61 | 0.507246 | import xmlrpc.client as xmlrpclib
import json
config_path = "./blog_config.json"
def have_config():
'''
return bool value : whether config file exists
'''
try:
with open(config_path, "r", encoding = "utf-8") as f:
try:
cfg = json.load(f)
return cfg !... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4f90ba328bb371e24b317ddc9c92bfb92e127e4e | 383 | py | Python | dhukiya/apps/account/migrations/0004_account_about_me.py | fikryans/dhukiya_porto | 9108e51a2feeb275e07c77f81edae07636cf89b6 | [
"MIT"
] | null | null | null | dhukiya/apps/account/migrations/0004_account_about_me.py | fikryans/dhukiya_porto | 9108e51a2feeb275e07c77f81edae07636cf89b6 | [
"MIT"
] | null | null | null | dhukiya/apps/account/migrations/0004_account_about_me.py | fikryans/dhukiya_porto | 9108e51a2feeb275e07c77f81edae07636cf89b6 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.6 on 2021-02-11 12:42
| 20.157895 | 47 | 0.5953 | # Generated by Django 3.1.6 on 2021-02-11 12:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0003_auto_20210211_1228'),
]
operations = [
migrations.AddField(
model_name='account',
name='about_me',
... | 0 | 0 | 0 | 269 | 0 | 0 | 0 | 19 | 46 |
2a41a21fd019fee9b2c95b90771bd8705ec86740 | 12,272 | py | Python | referencesrv/resolver/common.py | golnazads/reference_service | 3cdd60d1113de099d3b355c1076badeec15f767d | [
"MIT"
] | 1 | 2021-04-28T21:14:30.000Z | 2021-04-28T21:14:30.000Z | referencesrv/resolver/common.py | golnazads/reference_service | 3cdd60d1113de099d3b355c1076badeec15f767d | [
"MIT"
] | 5 | 2020-12-22T19:07:08.000Z | 2022-02-28T15:38:53.000Z | referencesrv/resolver/common.py | golnazads/reference_service | 3cdd60d1113de099d3b355c1076badeec15f767d | [
"MIT"
] | 8 | 2019-08-29T21:22:33.000Z | 2021-11-10T18:06:47.000Z | from itertools import tee, filterfalse
SOURCE_MATCHER = DeferredSourceMatcher()
def round_two_significant_digits(num):
"""
:param num:
:return:
"""
return float('%s' % float('%.1g' % num))
def sorted2(iterable):
"""
source: https://stackoverflow.com/a/43456510
:param iterabl... | 26.562771 | 100 | 0.592731 | import traceback
from flask import current_app
from numbers import Real
from decimal import Decimal
from itertools import tee, filterfalse
class DeferredSourceMatcher(object):
"""
# Defer loading of the actual source matcher to runtime to save on
# startup time when we don't need it.
"""
def __g... | 0 | 0 | 0 | 11,140 | 0 | 42 | 0 | 12 | 392 |
0245172c85b78f4f4335204005de051e5effb0d9 | 9,361 | py | Python | TraceGenerator.py | tgale96/memory-address-trace-tools | 0087dea8764944a9bb20868badbc10cb6066cc27 | [
"MIT"
] | 1 | 2021-02-10T02:02:20.000Z | 2021-02-10T02:02:20.000Z | TraceGenerator.py | tgale96/memory-address-trace-tools | 0087dea8764944a9bb20868badbc10cb6066cc27 | [
"MIT"
] | null | null | null | TraceGenerator.py | tgale96/memory-address-trace-tools | 0087dea8764944a9bb20868badbc10cb6066cc27 | [
"MIT"
] | null | null | null | """ filename: TraceGenerator.py
contents: this script calls the GenerateSyntheticTrace method that
creates and stream of memory references that models the memory
performance of the input application or applications
author: Trevor Gale
date: 3.4.16"""
import h5py as h5
import numpy as np
import... | 37.444 | 123 | 0.649824 | """ filename: TraceGenerator.py
contents: this script calls the GenerateSyntheticTrace method that
creates and stream of memory references that models the memory
performance of the input application or applications
author: Trevor Gale
date: 3.4.16"""
import h5py as h5
import numpy as np
import... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8d9f7ecbe7901669fd46fcdcbed2e71b21fe5538 | 1,337 | py | Python | src/read_data.py | oneguynick/battery_model | ee9fa1f04a060b3486d5a496760b47db70a91888 | [
"MIT"
] | 37 | 2018-12-05T15:31:13.000Z | 2022-02-14T14:54:19.000Z | src/read_data.py | xxl4tomxu98/Energy_Storage_Pyomo | fa7bec0d9bb7a2d30a96e8fbc2e8957ecddc234c | [
"MIT"
] | 1 | 2020-09-01T02:50:00.000Z | 2020-09-02T12:42:48.000Z | src/read_data.py | xxl4tomxu98/Energy_Storage_Pyomo | fa7bec0d9bb7a2d30a96e8fbc2e8957ecddc234c | [
"MIT"
] | 13 | 2018-11-08T17:18:11.000Z | 2021-06-01T16:21:50.000Z | import pandas as pd
def read_filter_lbmp(path):
"""
Read one csv file with pandas. Convert the Time Stamp field to pandas
datetime format. Filter out non-NYC nodes and only keep required columns.
Change column names to snake case for easier access.
Parameters
----------
path : str or ... | 26.74 | 77 | 0.613313 | import pandas as pd
def read_filter_lbmp(path):
"""
Read one csv file with pandas. Convert the Time Stamp field to pandas
datetime format. Filter out non-NYC nodes and only keep required columns.
Change column names to snake case for easier access.
Parameters
----------
path : str or ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c4d2c99a44409cf5bcbe81080d8b5c90242aef43 | 5,232 | py | Python | fdroid_dl/update/index.py | nicopace/fdroid-dl | 06f8f46b947a01ace5a69ce442b4195e5386953c | [
"MIT"
] | null | null | null | fdroid_dl/update/index.py | nicopace/fdroid-dl | 06f8f46b947a01ace5a69ce442b4195e5386953c | [
"MIT"
] | null | null | null | fdroid_dl/update/index.py | nicopace/fdroid-dl | 06f8f46b947a01ace5a69ce442b4195e5386953c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
logger = logging.getLogger('update.IndexUpdate')
| 48.444444 | 184 | 0.613723 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import os.path
from concurrent.futures import as_completed
import requests
from ..download import FuturesSessionFlex
from ..processor import IndexFileProcessor
logger = logging.getLogger('update.IndexUpdate')
class IndexUpdate:
def __init__(self,confi... | 0 | 0 | 0 | 4,936 | 0 | 0 | 0 | 50 | 132 |
a82d0971f1f41de5777dfa876b35ba155a2396c9 | 5,594 | py | Python | models.py | Arturs/udacity-computer_vision1 | 0d71428c6542f02a001565404e5235f51b19bf89 | [
"MIT"
] | null | null | null | models.py | Arturs/udacity-computer_vision1 | 0d71428c6542f02a001565404e5235f51b19bf89 | [
"MIT"
] | null | null | null | models.py | Arturs/udacity-computer_vision1 | 0d71428c6542f02a001565404e5235f51b19bf89 | [
"MIT"
] | null | null | null | ## TODO: define the convolutional neural network architecture
import torch.nn as nn
# can use the below import should you choose to initialize the weights of your Net
| 33.698795 | 117 | 0.555417 | ## TODO: define the convolutional neural network architecture
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
# can use the below import should you choose to initialize the weights of your Net
import torch.nn.init as I
class Net(nn.Module):
def ... | 0 | 0 | 0 | 5,295 | 0 | 0 | 0 | 19 | 112 |
04d9fcf1d8d76ecdd25982beaa26335f1e0641bd | 6,160 | py | Python | Robot.py | btrice/Robotics | 89e718a08ab50b6cf957b2766eea6d653b518802 | [
"Apache-2.0"
] | 1 | 2019-10-10T12:54:47.000Z | 2019-10-10T12:54:47.000Z | Robot.py | btrice/Robotics | 89e718a08ab50b6cf957b2766eea6d653b518802 | [
"Apache-2.0"
] | null | null | null | Robot.py | btrice/Robotics | 89e718a08ab50b6cf957b2766eea6d653b518802 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
def main ():
"""Main function"""
rt = Robot()
p = rt.init_probability_map()
while True:
#rt.display_robot()
rt.display_probability_map(p)
m = rt.robot_random_move()
rt.perception()
rt.localisation(m,p)
#print("x : " ... | 30.49505 | 137 | 0.525325 | #! /usr/bin/env python
import pygame
import sys
import random
class Robot(object):
def __init__ (self):
self.pygame = pygame.init()
self.screen = pygame.display.set_mode((640,480))
self.x = random.randint(0,9) # robot x position
self.y = random.randint(0,9) # robot y position
... | 0 | 0 | 0 | 5,581 | 0 | 0 | 0 | -27 | 95 |
c9f18bb599d78b1a54d6f891a4ae00339b091379 | 6,010 | py | Python | geojson2java.py | Quar/AnyLogicGIS_from_geojson | 6037ae9b0480ff3e1ae16085baabec40d3425396 | [
"MIT"
] | 2 | 2018-06-18T15:27:45.000Z | 2019-11-23T00:16:32.000Z | geojson2java.py | Quar/AnyLogicGIS_from_geojson | 6037ae9b0480ff3e1ae16085baabec40d3425396 | [
"MIT"
] | 1 | 2019-09-16T05:35:51.000Z | 2019-09-16T05:35:51.000Z | geojson2java.py | Quar/AnyLogicGIS_from_geojson | 6037ae9b0480ff3e1ae16085baabec40d3425396 | [
"MIT"
] | null | null | null | import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="""
Generate Java Utility class from GeoJson Input for AnyLogic GISShape
""")
parser.add_argument('geojsonfile',
help='path to geojson file of regions',
metavar=... | 31.465969 | 142 | 0.59817 | import json
from io import StringIO
import argparse
def read_geo_obj(filepath):
with open(filepath, 'r') as f:
return json.load(f)
def print_key_trees(dict_obj):
def print_indent(obj, indent=0):
if isinstance(obj, dict):
for k, v in obj.items():
print('\t'*indent ... | 0 | 0 | 0 | 0 | 0 | 5,073 | 0 | -8 | 274 |
71460bc2648ba173cb08db66055f0c4bfbe42333 | 471 | py | Python | tests/unittests/http_functions/sync_logging/main.py | gohar94/azure-functions-python-worker | 4322e53ddbcc1eea40c1b061b42653336d9003f6 | [
"MIT"
] | 277 | 2018-01-25T23:13:03.000Z | 2022-02-22T06:12:04.000Z | tests/unittests/http_functions/sync_logging/main.py | gohar94/azure-functions-python-worker | 4322e53ddbcc1eea40c1b061b42653336d9003f6 | [
"MIT"
] | 731 | 2018-01-18T18:54:38.000Z | 2022-03-29T00:01:46.000Z | tests/unittests/http_functions/sync_logging/main.py | YunchuWang/azure-functions-python-worker | 1f23e038a506c6412e4efbf07eb471a6afab0c2a | [
"MIT"
] | 109 | 2018-01-18T02:22:57.000Z | 2022-02-15T18:59:54.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import logging
logger = logging.getLogger('my function')
| 23.55 | 74 | 0.711253 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import logging
import time
import azure.functions
logger = logging.getLogger('my function')
def main(req: azure.functions.HttpRequest):
try:
1 / 0
except ZeroDivisionError:
logger.error('a graceful... | 0 | 0 | 0 | 0 | 0 | 258 | 0 | -9 | 68 |
4a90ef174f0f3934bc571093ee16d87145d07aa4 | 1,050 | py | Python | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/common/djangoapps/third_party_auth/urls.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 3 | 2021-12-15T04:58:18.000Z | 2022-02-06T12:15:37.000Z | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/common/djangoapps/third_party_auth/urls.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | null | null | null | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/common/djangoapps/third_party_auth/urls.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 1 | 2019-01-02T14:38:50.000Z | 2019-01-02T14:38:50.000Z | """Url configuration for the auth module."""
from django.conf.urls import include, url
from .views import (IdPRedirectView, inactive_user_view, lti_login_and_complete_view, post_to_custom_auth_form, saml_metadata_view)
urlpatterns = [
url(r'^auth/inactive', inactive_user_view, name="third_party_inactive_redirect... | 43.75 | 105 | 0.74 | """Url configuration for the auth module."""
from django.conf.urls import include, url
from .views import (
IdPRedirectView,
inactive_user_view,
lti_login_and_complete_view,
post_to_custom_auth_form,
saml_metadata_view
)
urlpatterns = [
url(r'^auth/inactive', inactive_user_view, name="third_p... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 | 0 |
4eeaa2e94ebf0366cc4aae0128164fc2f00bbf83 | 9,991 | py | Python | maltpynt/rebin.py | matteobachetti/MaLTPyNT | 6c93d2e23041b6c932810b5a8d727ee1b6dabfed | [
"BSD-3-Clause"
] | 8 | 2015-02-23T13:43:21.000Z | 2021-07-17T11:35:24.000Z | maltpynt/rebin.py | matteobachetti/MaLTPyNT | 6c93d2e23041b6c932810b5a8d727ee1b6dabfed | [
"BSD-3-Clause"
] | 1 | 2017-09-14T07:55:07.000Z | 2017-09-14T07:55:07.000Z | maltpynt/rebin.py | matteobachetti/MaLTPyNT | 6c93d2e23041b6c932810b5a8d727ee1b6dabfed | [
"BSD-3-Clause"
] | 4 | 2016-03-02T20:36:07.000Z | 2018-02-26T13:23:53.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Functions to rebin light curves and frequency spectra."""
from __future__ import (absolute_import, unicode_literals, division,
print_function)
import numpy as np
from .io import get_file_type
from .io import save_data
from .io i... | 32.333333 | 78 | 0.572315 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Functions to rebin light curves and frequency spectra."""
from __future__ import (absolute_import, unicode_literals, division,
print_function)
import numpy as np
from .io import get_file_type
from .io import save_data
from .io i... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |